From: Vincent Hanquez Date: Tue, 11 Aug 2009 17:00:31 +0000 (+0100) Subject: add a rebooting state so that it can be reported and/or acted on. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d22f90b299e9e4c5c75fc3474fdb83d0fa13e709;p=xenclient%2Ftoolstack.git add a rebooting state so that it can be reported and/or acted on. --- diff --git a/xenvm/vmact.ml b/xenvm/vmact.ml index 99cf255..30a3057 100644 --- a/xenvm/vmact.ml +++ b/xenvm/vmact.ml @@ -394,7 +394,13 @@ let shutdown_vm xc xs xal state force reason = reason_str xalreason_str; raise (Vm_shutdown_wrong_reason (reason, xalreason)) ); - change_vmstate state (if reason = Domain.Suspend then VmSuspended else VmShutdown); + let newstatus = + match reason with + | Domain.Suspend -> VmSuspended + | Domain.Reboot -> VmRebooting + | _ -> VmShutdown + in + change_vmstate state newstatus; info "vm has shutdowned"; ) (fun () -> state.vm_expect_shutdown <- false) diff --git a/xenvm/vmstate.ml b/xenvm/vmstate.ml index 94aef38..9af2ca7 100644 --- a/xenvm/vmstate.ml +++ b/xenvm/vmstate.ml @@ -20,6 +20,7 @@ open Vmconfig type vmlifestate = | VmCreated | VmShutdown | VmShutdowning + | VmRebooting | VmPaused | VmSuspending | VmSuspended | VmRestoring | VmRunning @@ -28,6 +29,7 @@ let string_of_vmlifestate state = | VmCreated -> "created" | VmShutdown -> "shutdown" | VmShutdowning -> "shutdowning" + | VmRebooting -> "rebooting" | VmPaused -> "paused" | VmSuspending -> "suspending" | VmSuspended -> "suspended" | VmRestoring -> "restoring"