]> xenbits.xensource.com Git - xenclient/toolstack.git/commitdiff
add a rebooting state so that it can be reported and/or acted on.
authorVincent Hanquez <vincent.hanquez@eu.citrix.com>
Tue, 11 Aug 2009 17:00:31 +0000 (18:00 +0100)
committerVincent Hanquez <vincent.hanquez@eu.citrix.com>
Tue, 11 Aug 2009 17:00:31 +0000 (18:00 +0100)
xenvm/vmact.ml
xenvm/vmstate.ml

index 99cf255a0f72b3c4b249ac189e87d54c0523f912..30a30572ed9dbe4f32fcd406e9ddcfa143e607e8 100644 (file)
@@ -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)
 
index 94aef385b3314da1282ee70e7c990f00e1c4e18f..9af2ca71f2dd9573ccd8326bdff3eec622d11ea9 100644 (file)
@@ -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"