mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +00:00
libxl: initialize domain state with real data
When libvirtd is started, initialize domain objects state with its real state, not only RUNNING/SHUTOFF. Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> Reviewed-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
parent
cb50436c6f
commit
2f3681d62e
@ -412,6 +412,17 @@ libxlReconnectDomain(virDomainObjPtr vm,
|
||||
vm->def, hostdev_flags) < 0)
|
||||
goto error;
|
||||
|
||||
if (d_info.shutdown &&
|
||||
d_info.shutdown_reason == LIBXL_SHUTDOWN_REASON_SUSPEND)
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_PMSUSPENDED,
|
||||
VIR_DOMAIN_PMSUSPENDED_UNKNOWN);
|
||||
else if (d_info.paused)
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_PAUSED,
|
||||
VIR_DOMAIN_PAUSED_UNKNOWN);
|
||||
else
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_RUNNING,
|
||||
VIR_DOMAIN_RUNNING_UNKNOWN);
|
||||
|
||||
if (virAtomicIntInc(&driver->nactive) == 1 && driver->inhibitCallback)
|
||||
driver->inhibitCallback(true, driver->inhibitOpaque);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user