Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Snowball/HFX-1008 #1640

Merged
merged 3 commits into from

4 participants

@ravippandey
Collaborator

No description provided.

@xen-git
Owner

Can one of the admins verify this patch for testing?

@thomassa
Owner

@xen-git ok to test

@jonludlam
Owner

Looks good to me.

@jonludlam jonludlam merged commit f887ea8 into xapi-project:sanibel-lcm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 28, 2014
  1. @ravippandey
  2. @ravippandey

    Allowing hard_shutdown and hard_reboot on a VM even when clean_shutdo…

    ravippandey authored
    …wn and clean_reboot are in progress respectively.
  3. @ravippandey

    SCTX-1334: Ensure that hard_shutdown and hard_reboot cancels clean_sh…

    ravippandey authored
    …utdown and clean_reboot respectively.
This page is out of date. Refresh to see the latest.
View
6 ocaml/xapi/message_forwarding.ml
@@ -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 =
@@ -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
View
4 ocaml/xapi/xapi_vm_lifecycle.ml
@@ -101,7 +101,9 @@ let is_allowed_concurrently ~(op:API.vm_operations) ~current_ops =
and snapshot = [`snapshot; `checkpoint]
and allowed_operations = (* a list of valid state -> operation *)
[ [`snapshot_with_quiesce], `snapshot;
- [`reverting], `hard_shutdown ] in
+ [`reverting], `hard_shutdown;
+ [`clean_shutdown], `hard_shutdown;
+ [`clean_reboot], `hard_reboot ] in
let state_machine () =
let current_state = List.map snd current_ops in
List.exists (fun (state, transition) -> state = current_state && transition = op) allowed_operations
View
7 ocaml/xenops/domain.ml
@@ -241,10 +241,9 @@ let shutdown ~xs domid req =
let shutdown_wait_for_ack ?(timeout=60.) ~xc ~xs domid req =
let di = Xc.domain_getinfo xc domid in
- if di.Xc.hvm_guest then begin
- if Xc.hvm_check_pvdriver xc domid
- then debug "HVM guest with PV drivers: not expecting any acknowledgement"
- else Xc.domain_shutdown xc domid (shutdown_to_xc_shutdown req)
+ if di.Xc.hvm_guest && not (Xc.hvm_check_pvdriver xc domid)then begin
+ debug "HVM guest without PV drivers. Not expecting any acknowledgement";
+ Xc.domain_shutdown xc domid (shutdown_to_xc_shutdown req)
end else begin
debug "Waiting for PV domain %d to acknowledge shutdown request" domid;
let path = control_shutdown ~xs domid in
Something went wrong with that request. Please try again.