Skip to content

Commit 4e0b6be

Browse files
author
xen-git
committed
Merge commit '8b6ff18400dc6ba269e8146097af26b5f0859eee'
2 parents 3bf1b1a + 600f365 commit 4e0b6be

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

ocaml/idl/datamodel.ml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,14 @@ let _ =
781781
~doc:"VM cannot be started because it requires a VDI which cannot be attached" ();
782782
error Api_errors.vm_migrate_failed [ "vm"; "source"; "destination"; "msg" ]
783783
~doc:"An error occurred during the migration process." ();
784+
error Api_errors.vm_has_too_many_snapshots [ "vm" ]
785+
~doc:"You attempted to migrate a VM with more than one snapshot." ();
786+
error Api_errors.vdi_needs_vm_for_migrate [ "vdi" ]
787+
~doc:"You attempted to migrate a VDI which is not attached to a runnning VM." ();
788+
error Api_errors.mirror_failed [ "vdi" ]
789+
~doc:"The VDI mirroring cannot be performed" ();
790+
error Api_errors.too_many_storage_migrates [ "number" ]
791+
~doc:"You reached the maximal number of concurrently migrating VMs." ();
784792
error Api_errors.vm_failed_shutdown_ack []
785793
~doc:"VM didn't acknowledge the need to shutdown." ();
786794
error Api_errors.vm_shutdown_timeout [ "vm"; "timeout" ]

ocaml/xapi/message_forwarding.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3268,11 +3268,11 @@ module Forward = functor(Local: Custom_actions.CUSTOM_ACTIONS) -> struct
32683268
let vbds = Db.VBD.get_records_where ~__context
32693269
~expr:(Db_filter_types.Eq(Db_filter_types.Field "VDI", Db_filter_types.Literal (Ref.string_of vdi))) in
32703270
let vbds = List.filter (fun (_,vbd) -> vbd.API.vBD_currently_attached) vbds in
3271-
if List.length vbds <> 1 then raise (Api_errors.Server_error(Api_errors.vdi_needs_vm_for_migrate,[]));
3271+
if List.length vbds <> 1 then raise (Api_errors.Server_error(Api_errors.vdi_needs_vm_for_migrate,[Ref.string_of vdi]));
32723272

32733273
let vm = (snd (List.hd vbds)).API.vBD_VM in
32743274
let vmr = Db.VM.get_record ~__context ~self:vm in
3275-
if vmr.API.vM_power_state <> `Running then raise (Api_errors.Server_error(Api_errors.vdi_needs_vm_for_migrate,[]));
3275+
if vmr.API.vM_power_state <> `Running then raise (Api_errors.Server_error(Api_errors.vdi_needs_vm_for_migrate,[Ref.string_of vdi]));
32763276
let host = vmr.API.vM_resident_on in
32773277
(* hackity hack *)
32783278
let options = ("__internal__vm",Ref.string_of vm) :: (List.remove_assoc "__internal__vm" options) in

ocaml/xapi/xapi_vm_migrate.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ let migrate_send' ~__context ~vm ~dest ~live ~vdi_map ~vif_map ~options =
188188
let (snapshots_vbds,nb_snapshots) = get_snapshots_vbds ~__context ~vm in
189189
debug "get_snapshots VMs %d VBDs %d" nb_snapshots (List.length snapshots_vbds);
190190
if nb_snapshots > 1 then
191-
raise (Api_errors.Server_error(Api_errors.vm_has_too_many_snapshots, []));
191+
raise (Api_errors.Server_error(Api_errors.vm_has_too_many_snapshots, [Ref.string_of vm]));
192192
let vdi_filter snapshot vbd =
193193
if not(Db.VBD.get_empty ~__context ~self:vbd)
194194
then
@@ -550,7 +550,7 @@ let assert_can_migrate ~__context ~vm ~dest ~live ~vdi_map ~vif_map ~options =
550550
(* Check that the VM has no more than one snapshot *)
551551
let (snapshots_vbds, nb_snapshots) = get_snapshots_vbds ~__context ~vm in
552552
if nb_snapshots > 1 then
553-
raise (Api_errors.Server_error(Api_errors.vm_has_too_many_snapshots, []));
553+
raise (Api_errors.Server_error(Api_errors.vm_has_too_many_snapshots, [Ref.string_of vm]));
554554
(* Ignore vdi_map for now since we won't be doing any mirroring. *)
555555
inter_pool_metadata_transfer ~__context ~remote_rpc ~session_id ~remote_address ~vm ~vdi_map:[] ~dry_run:true ~live
556556

0 commit comments

Comments
 (0)