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)
type vmlifestate =
| VmCreated
| VmShutdown | VmShutdowning
+ | VmRebooting
| VmPaused | VmSuspending | VmSuspended | VmRestoring
| VmRunning
| VmCreated -> "created"
| VmShutdown -> "shutdown"
| VmShutdowning -> "shutdowning"
+ | VmRebooting -> "rebooting"
| VmPaused -> "paused"
| VmSuspending -> "suspending" | VmSuspended -> "suspended"
| VmRestoring -> "restoring"