mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu: Update domain state to pmsuspended while suspend event occurs
This commit is contained in:
parent
54d9026a2c
commit
321fa64bf5
@ -1092,6 +1092,19 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
|
||||
virDomainObjLock(vm);
|
||||
event = virDomainEventPMSuspendNewFromObj(vm);
|
||||
|
||||
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
|
||||
VIR_DEBUG("Transitioned guest %s to pmsuspended state due to "
|
||||
"QMP suspend event", vm->def->name);
|
||||
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_PMSUSPENDED,
|
||||
VIR_DOMAIN_PMSUSPENDED_UNKNOWN);
|
||||
|
||||
if (virDomainSaveStatus(driver->caps, driver->stateDir, vm) < 0) {
|
||||
VIR_WARN("Unable to save status on vm %s after suspend event",
|
||||
vm->def->name);
|
||||
}
|
||||
}
|
||||
|
||||
virDomainObjUnlock(vm);
|
||||
|
||||
if (event) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user