Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update the SMAPIv2, remove Mirror for now

  • Loading branch information...
commit 44d5a0d64d152e0f4313effc4bc3af14fd4ef29a 1 parent ed91201
Dave Scott authored
Showing with 38 additions and 43 deletions.
  1. +4 −4 Makefile
  2. +32 −39 smapiv2.ml
  3. +2 −0  types.ml
8 Makefile
View
@@ -1,15 +1,15 @@
idl: types.cmx smapiv2.cmx xenops.cmx memory.cmx main.cmx
- ocamlfind ocamlopt -package xmlm,yojson,stdext -linkpkg -g -o idl types.cmx smapiv2.cmx xenops.cmx memory.cmx main.cmx
+ ocamlfind ocamlopt -package xmlm,stdext -linkpkg -g -o idl types.cmx smapiv2.cmx xenops.cmx memory.cmx main.cmx
toplevel: types.cmo smapiv2.cmo xenops.cmo memory.cmo
- ocamlfind ocamlmktop -thread -package xmlm,yojson,stdext -linkpkg -g -o toplevel types.cmo smapiv2.cmo xenops.cmo memory.cmo
+ ocamlfind ocamlmktop -thread -package xmlm,stdext -linkpkg -g -o toplevel types.cmo smapiv2.cmo xenops.cmo memory.cmo
%.cmx: %.ml
- ocamlfind ocamlopt -package xmlm,yojson,stdext -c -g $<
+ ocamlfind ocamlopt -package xmlm,stdext -c -g $<
%.cmo: %.ml
- ocamlfind ocamlc -package xmlm,yojson,stdext -c -g $<
+ ocamlfind ocamlc -package xmlm,stdext -c -g $<
.PHONY: install
install: idl
71 smapiv2.ml
View
@@ -3,9 +3,9 @@ open Types
let api =
let vdi_info =
Type.(Struct(
- ( "vdi", Basic String, "The unique id of this VDI" ),
- [ "sr", Basic String, "The SR containing this VDI";
- "content_id", Basic String, "The unique id of the VDI contents. If two VDIs have the same content_id then they must have the same data inside";
+ ( "vdi", Name "vdi", "The unique id of this VDI" ),
+ [ "sr", Name "sr", "The SR containing this VDI";
+ "content_id", Name "content_id", "The unique id of the VDI contents. If two VDIs have the same content_id then they must have the same data inside";
"name_label", Basic String, "Human-readable name of the VDI";
"name_description", Basic String, "Human-readable description of the VDI";
"ty", Basic String, "Used by a toolstack to remember why a VDI was created";
@@ -28,6 +28,11 @@ let api =
ty = Type.(Basic String);
description = "The Virtual Disk Image to operate on";
} in
+ let attach_info =
+ Type.(Struct(
+ ( "params", Basic String, "The xenstore backend params key"),
+ [ "xenstore_data", Dict(String, Basic String), "Additional xenstore backend device keys" ]
+ )) in
let vdi_info' = {
Arg.name = "vdi_info";
(* ty = vdi_info; *)
@@ -44,10 +49,25 @@ let api =
title = "Storage Manager";
description = "The Storage Manager (SM) is responsible for all storage operations on an XCP host. It organises Virtual Disk Images (VDIs) into homogenous collections known as Storage Repositories (SRs) where each collection is stored in a specific format (e.g. .vhd files on NFS, raw LUN on a iSCSI/FC storage array). The Storage Manager API (SMAPI) provides a simple abstract interface which allows the toolstack to create, destroy, snapshot, clone, resize etc VDIs within SRs";
exn_decls = [];
- type_decls = [ { TyDecl.name = "vdi_info";
- description = "All per-VDI properties";
- ty = vdi_info
- } ];
+ type_decls = [
+ {
+ TyDecl.name = "vdi";
+ description = "Primary key for a Virtual Disk Image (e.g. path on a storage system)";
+ ty = Type.(Basic String);
+ }; {
+ TyDecl.name = "sr";
+ description = "Primary key for a Storage Repository (e.g. a UUID)";
+ ty = Type.(Basic String);
+ }; {
+ TyDecl.name = "content_id";
+ description = "Identifies the contents (i.e. bytes with) a VDI. Two VDIs with the same content_id must have the same content.";
+ ty = Type.(Basic String);
+ }; {
+ TyDecl.name = "vdi_info";
+ description = "All per-VDI properties";
+ ty = vdi_info
+ };
+ ];
interfaces =
[
{
@@ -283,7 +303,11 @@ let api =
sr;
];
outputs = [
- (* XXX: vdi_info list *)
+ {
+ Arg.name = "vdis";
+ ty = Type.(Array (Name "vdi_info"));
+ description = "List of all the visible VDIs in the SR";
+ }
];
}
]
@@ -335,37 +359,6 @@ let api =
];
}
]
- }; {
- Interface.name = "Mirror";
- description = "Operations which act on disk mirrors.";
- type_decls = [];
- methods = [
- {
- Method.name = "start";
- description = "[start task sr vdi url sr2] creates a VDI in remote [url]'s [sr2] and writes data synchronously. It returns the id of the VDI.";
- inputs = [
- sr;
- vdi;
- { Arg.name = "url";
- ty = Type.(Basic String);
- description = "The URL to mirror the VDI to";
- };
- { sr with Arg.name = "dest" }
- ];
- outputs = [
- { vdi with Arg.name = "new_vdi" }
- ];
- }; {
- Method.name = "stop";
- description = "[stop task sr vdi] stops mirroring local [vdi]";
- inputs = [
- sr;
- vdi;
- ];
- outputs = [
- ];
- }
- ]
}
]
}
2  types.ml
View
@@ -537,6 +537,7 @@ module To_rpclight = struct
add (sprintf "@.@]")
end
+(*
let to_json x =
let of_arg_list args =
`Assoc (List.map (fun arg -> arg.Arg.name, `String (Type.dbus_of_t [] arg.Arg.ty)) args) in
@@ -562,6 +563,7 @@ let to_json x =
] in
let json = of_interfaces x in
Yojson.Basic.to_string json
+*)
module To_dbus = struct
let of_arg env is_in arg add =
Please sign in to comment.
Something went wrong with that request. Please try again.