From: Jon Ludlam Date: Tue, 12 Oct 2010 10:56:52 +0000 (+0100) Subject: Allow the CLI command vdi-create to create sharable VDIs X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=ee6cfaa7da10031ef8ae3132c68947b4c80f5b58;p=xcp%2Fxen-api.git Allow the CLI command vdi-create to create sharable VDIs Signed-off-by: Jon Ludlam --- diff --git a/ocaml/xapi/cli_frontend.ml b/ocaml/xapi/cli_frontend.ml index 7bf4ecda..5a25dc52 100644 --- a/ocaml/xapi/cli_frontend.ml +++ b/ocaml/xapi/cli_frontend.ml @@ -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=[]; diff --git a/ocaml/xapi/cli_operations.ml b/ocaml/xapi/cli_operations.ml index b2e1bee8..c620f74d 100644 --- a/ocaml/xapi/cli_operations.ml +++ b/ocaml/xapi/cli_operations.ml @@ -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])