]> xenbits.xensource.com Git - xcp/xen-api.git/commitdiff
Allow the CLI command vdi-create to create sharable VDIs
authorJon Ludlam <jonathan.ludlam@eu.citrix.com>
Tue, 12 Oct 2010 10:56:52 +0000 (11:56 +0100)
committerJon Ludlam <jonathan.ludlam@eu.citrix.com>
Tue, 12 Oct 2010 10:56:52 +0000 (11:56 +0100)
Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
ocaml/xapi/cli_frontend.ml
ocaml/xapi/cli_operations.ml

index 7bf4ecda6aa5954a1045c139649df618bf59c644..5a25dc528d52a432337be96aa5add62a310ff233 100644 (file)
@@ -1614,7 +1614,7 @@ there are two or more empty CD devices, please use the command 'vbd-insert' and
    "vdi-create",
     {
       reqd=["sr-uuid";"name-label";"type";"virtual-size"];
-      optn=["sm-config:"];
+      optn=["sm-config:";"sharable"];
       help="Create a VDI. Type is 'system' 'user' 'suspend' or 'crashdump'.";
       implementation=No_fd Cli_operations.vdi_create;
       flags=[];
index b2e1bee86e80026464d48ac43f05f003c35d1eac..c620f74d2185dd24cb0ff7fa5ae36fc22b057ddf 100644 (file)
@@ -998,11 +998,11 @@ let vdi_create printer rpc session_id params =
        let str_type = List.assoc "type" params in
        let virtual_size = Record_util.bytes_of_string "virtual-size" (List.assoc "virtual-size" params) in
        let ty = vdi_type_of_string str_type in
-
+       let sharable = get_bool_param params "sharable" in
        let sm_config=read_map_params "sm-config" params in
 
        let vdi = Client.VDI.create ~rpc ~session_id ~name_label ~name_description:"" ~sR ~virtual_size ~_type:ty
-               ~sharable:false ~read_only:false ~xenstore_data:[] ~other_config:[] ~sm_config ~tags:[] in
+               ~sharable ~read_only:false ~xenstore_data:[] ~other_config:[] ~sm_config ~tags:[] in
        let vdi_uuid = Client.VDI.get_uuid rpc session_id vdi in
        printer (Cli_printer.PList [vdi_uuid])