Skip to content

Commit 485a767

Browse files
committed
fixup! Allow selection of image format during VM migration
1 parent 167884d commit 485a767

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ocaml/xapi-storage-cli/main.ml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,15 +315,16 @@ let mirror_vm = Vm.of_string "SXM_mirror"
315315

316316
let copy_vm = Vm.of_string "SXM_copy"
317317

318-
let mirror_start common_opts sr vdi dp url dest verify_dest =
318+
let mirror_start common_opts sr vdi dp url dest verify_dest dest_img_format =
319319
on_vdi'
320320
(fun sr vdi ->
321321
let get_opt x err = match x with Some y -> y | None -> failwith err in
322322
let dp = get_opt dp "Need a local data path" in
323323
let url = get_opt url "Need a URL" in
324324
let dest = get_opt dest "Need a destination SR" in
325-
(* TODO: add image_format as a parameter of the CLI *)
326-
let image_format = "" in
325+
let image_format =
326+
match dest_img_format with Some s -> s | None -> ""
327+
in
327328
let task =
328329
Client.DATA.MIRROR.start dbg sr vdi image_format dp mirror_vm copy_vm
329330
url
@@ -531,6 +532,10 @@ let mirror_start_cmd =
531532
let doc = "Verify certicate of remote server" in
532533
Arg.(value & pos 5 bool false & info [] ~docv:"VERIFYDEST" ~doc)
533534
in
535+
let dest_img_format =
536+
let doc = "Specify the image format on the destination SR" in
537+
Arg.(value & pos 6 (some string) None & info [] ~docv:"IMAGEFORMAT" ~doc)
538+
in
534539
( Term.(
535540
ret
536541
(const mirror_start
@@ -541,6 +546,7 @@ let mirror_start_cmd =
541546
$ url
542547
$ dest
543548
$ verify_dest
549+
$ dest_img_format
544550
)
545551
)
546552
, Cmd.info "mirror-start" ~sdocs:_common_options ~doc ~man

0 commit comments

Comments
 (0)