Skip to content

Commit c15fad4

Browse files
robhoesBob Ball
authored andcommitted
CA-265683: Use a sub-task for VM.assert_can_migrate inside VM.migrate_send
VM.assert_can_migrate may now forward a VM.assert_can_migrate_sender call to the sending host, but it used the same task that was created for the VM.migrate_send call. This caused xapi to mark the entire migrate_send task as completed as soon as the assert_can_migrate_sender call finished. Using a sub-task avoids this. Signed-off-by: Rob Hoes <[email protected]>
1 parent 4351dc6 commit c15fad4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ocaml/xapi/message_forwarding.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1740,7 +1740,9 @@ module Forward = functor(Local: Custom_actions.CUSTOM_ACTIONS) -> struct
17401740
fst (forward_to_suitable_host ~local_fn ~__context ~vm ~snapshot ~host_op:`vm_migrate op)) in
17411741
with_vm_operation ~__context ~self:vm ~doc:"VM.migrate_send" ~op:`migrate_send
17421742
(fun () ->
1743-
assert_can_migrate ~__context ~vm ~dest ~live ~vdi_map ~vif_map ~vgpu_map ~options;
1743+
Server_helpers.exec_with_subtask ~__context "VM.assert_can_migrate" (fun ~__context ->
1744+
assert_can_migrate ~__context ~vm ~dest ~live ~vdi_map ~vif_map ~vgpu_map ~options
1745+
);
17441746
forwarder ~local_fn ~__context ~vm
17451747
(fun session_id rpc -> Client.VM.migrate_send rpc session_id vm dest live vdi_map vif_map options vgpu_map)
17461748
)

0 commit comments

Comments
 (0)