Skip to content

Commit

Permalink
SCTX-1334: Ensure that hard_shutdown and hard_reboot cancels clean_sh…
Browse files Browse the repository at this point in the history
…utdown and clean_reboot respectively.
  • Loading branch information
ravippandey committed Feb 28, 2014
1 parent 6049936 commit 8e54338
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ocaml/xapi/message_forwarding.ml
Expand Up @@ -1302,6 +1302,9 @@ module Forward = functor(Local: Custom_actions.CUSTOM_ACTIONS) -> struct
let local_fn = Local.VM.hard_shutdown ~vm in
with_vm_operation ~__context ~self:vm ~doc:"VM.hard_shutdown" ~op:`hard_shutdown
(fun () ->
List.iter (fun (task,op) ->
if op = `clean_shutdown then
try Local.Task.cancel ~__context ~task:(Ref.of_string task) with _ -> () )(Db.VM.get_current_operations ~__context ~self:vm);
(* If VM is actually suspended and we ask to hard_shutdown, we need to
forward to any host that can see the VDIs *)
let policy =
Expand Down Expand Up @@ -1343,6 +1346,9 @@ module Forward = functor(Local: Custom_actions.CUSTOM_ACTIONS) -> struct
let local_fn = Local.VM.hard_reboot ~vm in
with_vm_operation ~__context ~self:vm ~doc:"VM.hard_reboot" ~op:`hard_reboot
(fun () ->
List.iter (fun (task,op) ->
if op = `clean_reboot then
try Local.Task.cancel ~__context ~task:(Ref.of_string task) with _ -> () )(Db.VM.get_current_operations ~__context ~self:vm);
with_vbds_marked ~__context ~vm ~doc:"VM.hard_reboot" ~op:`attach
(fun vbds ->
with_vifs_marked ~__context ~vm ~doc:"VM.hard_reboot" ~op:`attach
Expand Down

0 comments on commit 8e54338

Please sign in to comment.