warn "vm didn't acked shutdown request %s" reason_str;
raise (Vm_not_listening_shutdown_request reason);
);
- change_vmstate state VmShutdowning;
+ if reason <> Domain.Suspend then change_vmstate state VmShutdowning;
+
info "vm acknowledged shutdown request. waiting release";
(* wait domain release with xal *)
);
let newstatus =
match reason with
- | Domain.Suspend -> VmSuspended
| Domain.Reboot -> VmRebooting
| _ -> VmShutdown
in
- change_vmstate state newstatus;
+ if reason <> Domain.Suspend then change_vmstate state newstatus;
info "vm has shutdowned";
) (fun () -> state.vm_expect_shutdown <- false)
Vmact.suspend xc xs state (if live then [ Domain.Live ] else [])
(with_datadir state.vm_cfg file);
Vmact.stop_vm xc xs state;
+ Vmact.change_vmstate state VmSuspended;
);
Xenvmlib.Ok
| Tasks.Restore ->
| Tasks.Checkpoint ->
let file = Tasks.args_get_string args "file" in
state.vm_on_suspend_action <- ActionResume;
- with_xcs (fun xc xs -> Vmact.suspend xc xs state [] (with_datadir state.vm_cfg file));
+ with_xcs (fun xc xs ->
+ Vmact.suspend xc xs state [] (with_datadir state.vm_cfg file);
+ Vmact.change_vmstate state VmSuspended;
+ );
Xenvmlib.Ok
| Tasks.GetDomid -> Xenvmlib.Msg (string_of_int state.vm_domid)
| Tasks.GetStatus -> Xenvmlib.Msg (string_of_vmlifestate state.vm_lifestate)