Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ocaml/xapi-cli-server/cli_frontend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2252,7 +2252,8 @@ let rec cmdtable_data : (string * cmd_spec) list =
reqd= ["name-label"; "type"]
; optn=
[
"host-uuid"
"name-description"
; "host-uuid"
; "device-config:"
; "shared"
; "physical-size"
Expand Down Expand Up @@ -2304,7 +2305,7 @@ let rec cmdtable_data : (string * cmd_spec) list =
; ( "sr-introduce"
, {
reqd= ["name-label"; "type"; "uuid"]
; optn= ["shared"; "content-type"]
; optn= ["name-description"; "shared"; "content-type"]
; help= "Introduces an SR (but does not create any PBDs)."
; implementation= No_fd Cli_operations.sr_introduce
; flags= []
Expand Down
7 changes: 4 additions & 3 deletions ocaml/xapi-cli-server/cli_operations.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2606,6 +2606,7 @@ let parse_host_uuid ?(default_master = true) rpc session_id params =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to modify cli_frontend.ml so that "name-description" shows up as an optional argument in the documentation.

let sr_create fd _printer rpc session_id params =
let name_label = List.assoc "name-label" params in
let name_description = Listext.assoc_default "name-description" params "" in
let shared = get_bool_param params "shared" in
let host = parse_host_uuid ~default_master:shared rpc session_id params in
let physical_size =
Expand Down Expand Up @@ -2640,21 +2641,21 @@ let sr_create fd _printer rpc session_id params =
let sm_config = read_map_params "sm-config" params in
let sr =
Client.SR.create ~rpc ~session_id ~host ~device_config ~name_label
~name_description:"" ~physical_size ~_type ~content_type ~shared
~sm_config
~name_description ~physical_size ~_type ~content_type ~shared ~sm_config
in
let sr_uuid = Client.SR.get_uuid ~rpc ~session_id ~self:sr in
marshal fd (Command (Print sr_uuid))

let sr_introduce printer rpc session_id params =
let name_label = List.assoc "name-label" params in
let name_description = Listext.assoc_default "name-description" params "" in
let _type = List.assoc "type" params in
let content_type = Listext.assoc_default "content-type" params "" in
let uuid = List.assoc "uuid" params in
let shared = get_bool_param params "shared" in
let sm_config = read_map_params "sm-config" params in
let _ =
Client.SR.introduce ~rpc ~session_id ~uuid ~name_label ~name_description:""
Client.SR.introduce ~rpc ~session_id ~uuid ~name_label ~name_description
~_type ~content_type ~shared ~sm_config
in
printer (Cli_printer.PList [uuid])
Expand Down
Loading