Skip to content

Commit

Permalink
Move the plugin query interface to a separate file
Browse files Browse the repository at this point in the history
Signed-off-by: David Scott <dave.scott@citrix.com>
  • Loading branch information
David Scott committed Oct 8, 2014
1 parent 894eff5 commit d11b2cb
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 76 deletions.
2 changes: 2 additions & 0 deletions doc/learn.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ <h1><a href="index.html">Xapi storage interface</a></h1>
<a href="#">Develop</a>
<ul class="dropdown">

<li><a href="p.html">p</a></li>

<li><a href="v.html">v</a></li>

<li><a href="d.html">d</a></li>
Expand Down
70 changes: 0 additions & 70 deletions generator/src/control.ml
Original file line number Diff line number Diff line change
Expand Up @@ -114,81 +114,11 @@ let api =
"change dynamically and can be queried by the Volume.stat call.";
];
ty = volume_decl
}; {
TyDecl.name = "query_result";
description = "properties of this implementation";
ty = Type.(Struct( ("plugin", Basic String, "plugin name, used in the XenAPI as SR.type"), [
"name", Basic String, "short name";
"description", Basic String, "description";
"vendor", Basic String, "entity (e.g. company, project, group) which produced this implementation";
"copyright", Basic String, "copyright";
"version", Basic String, "version";
"required_api_version", Basic String, "minimum required API version";
"features", Array (Basic String), "features supported by this plugin";
"configuration", Dict(String, Basic String), "key/description pairs describing required device_config parameters"
]))
}

];
interfaces =
[
{
Interface.name = "Plugin";
description = String.concat " " [
"Discover properties of this implementation. Every implementation ";
"must support the query interface or it will not be recognised as ";
"a storage plugin by xapi.";
];
type_decls = [
];
methods = [
{
Method.name = "query";
description = String.concat " " [
"Query this implementation and return its properties. This is ";
"called by xapi to determine whether it is compatible with xapi ";
"and to discover the supported features."
];
inputs = [];
outputs = [
{
Arg.name = "query_result";
ty = Type.Name "query_result";
description = "The properies of this implementation"
}
]
}; {
Method.name = "ls";
description = "[ls dbg]: returns a list of attached SRs";
inputs = [];
outputs = [
{
Arg.name = "srs";
ty = Type.(Array (Basic String));
description = "The attached SRs"
}
]
}; {
Method.name = "diagnostics";
description = String.concat " " [
"Returns a printable set of backend diagnostic information.";
"Implementations are encouraged to include any data which will ";
"be useful to diagnose problems. Note this data should not ";
"include personally-identifiable data as it is intended to be ";
"automatically included in bug reports.";
];
inputs = [
];
outputs = [
{ Arg.name = "diagnostics";
ty = Type.(Basic String);
description = "A string containing loggable human-readable diagnostics information";
}
];
}
]
};

{
Interface.name = "Volume";
description = "Operations which operate on volumes (also known as Virtual Disk Images)";
Expand Down
1 change: 1 addition & 0 deletions generator/src/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ open Files

let _ =
let apis = [
Plugin.api;
Control.api;
Data.api;
] in
Expand Down
2 changes: 1 addition & 1 deletion ocaml/_oasis
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Library storage
Path: lib
Pack: true
Findlibname: xapi-storage
Modules: S, V, D, Channel, Cmdliner_helpers
Modules: S, P, V, D, Channel, Cmdliner_helpers
BuildDepends: rpclib, cmdliner, re.str

#Executable storage_test
Expand Down
3 changes: 2 additions & 1 deletion ocaml/_tags
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# OASIS_START
# DO NOT EDIT (digest: 9ea1625b032075b781ec2197f4aa3a45)
# DO NOT EDIT (digest: 981a17adb69acea4d217dab9d80b662d)
# Ignore VCS directories, you can use the same kind of rule outside
# OASIS_START/STOP if you want to exclude directories that contains
# useless stuff for the build process
Expand All @@ -16,6 +16,7 @@
# Library storage
"lib/storage.cmxs": use_storage
"lib/s.cmx": for-pack(Storage)
"lib/p.cmx": for-pack(Storage)
"lib/v.cmx": for-pack(Storage)
"lib/d.cmx": for-pack(Storage)
"lib/channel.cmx": for-pack(Storage)
Expand Down
3 changes: 2 additions & 1 deletion ocaml/lib/storage.mlpack
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# OASIS_START
# DO NOT EDIT (digest: 5f0653b2ab4a1311465f505ec2f97bf9)
# DO NOT EDIT (digest: 4e583523fdfa36806298d423a35aaab8)
S
P
V
D
Channel
Expand Down
6 changes: 3 additions & 3 deletions ocaml/setup.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(* setup.ml generated for the first time by OASIS v0.3.0 *)

(* OASIS_START *)
(* DO NOT EDIT (digest: 6605e361ae5cbb1a824ef7fb0ed1b44a) *)
(* DO NOT EDIT (digest: 5a5121b3e1fe410aa74b6e6e38947147) *)
(*
Regenerated by OASIS v0.4.4
Visit http://oasis.forge.ocamlcore.org for more information and
Expand Down Expand Up @@ -6720,7 +6720,7 @@ let setup_t =
},
{
lib_modules =
["S"; "V"; "D"; "Channel"; "Cmdliner_helpers"];
["S"; "P"; "V"; "D"; "Channel"; "Cmdliner_helpers"];
lib_pack = true;
lib_internal_modules = [];
lib_findlib_parent = None;
Expand All @@ -6735,7 +6735,7 @@ let setup_t =
};
oasis_fn = Some "_oasis";
oasis_version = "0.4.4";
oasis_digest = Some "é/¹ø\154¡r\n9vIAfp\nT";
oasis_digest = Some "Ë\029²\019ª×¯1\012XA\129ÈôKÇ";
oasis_exec = None;
oasis_setup_args = [];
setup_update = false
Expand Down

0 comments on commit d11b2cb

Please sign in to comment.