Skip to content

Commit 1ef03b6

Browse files
committed
CA-218163: Forward calls on running/paused VMs, execute on master otherwise
Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
1 parent d6d2f65 commit 1ef03b6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ocaml/xapi/message_forwarding.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,9 +793,11 @@ module Forward = functor(Local: Custom_actions.CUSTOM_ACTIONS) -> struct
793793

794794
(* Read resisdent-on field from vm to determine who to forward to *)
795795
let forward_vm_op ~local_fn ~__context ~vm op =
796-
Xapi_vm_lifecycle.assert_power_state_in ~__context ~self:vm
797-
~allowed:[`Running; `Paused];
798-
do_op_on ~local_fn ~__context ~host:(Db.VM.get_resident_on ~__context ~self:vm) op
796+
let power_state = Db.VM.get_power_state ~__context ~self:vm in
797+
if List.mem power_state [`Running; `Paused] then
798+
do_op_on ~local_fn ~__context ~host:(Db.VM.get_resident_on ~__context ~self:vm) op
799+
else
800+
local_fn ~__context
799801

800802
(* Clear scheduled_to_be_resident_on for a VM and all its vGPUs. *)
801803
let clear_scheduled_to_be_resident_on ~__context ~vm =

0 commit comments

Comments
 (0)