mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
libxl: send lifecycle event on PMSuspend
After a successful call to libxl_domain_suspend_only(), set domain state to VIR_DOMAIN_PMSUSPENDED and send lifecycle event. Signed-off-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
18d47d6112
commit
d6943eab14
@ -1434,6 +1434,7 @@ libxlDomainPMSuspendForDuration(virDomainPtr dom,
|
||||
int ret = -1;
|
||||
libxlDriverPrivatePtr driver = dom->conn->privateData;
|
||||
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
|
||||
virObjectEventPtr event = NULL;
|
||||
|
||||
virCheckFlags(0, -1);
|
||||
if (target != VIR_NODE_SUSPEND_TARGET_MEM) {
|
||||
@ -1474,6 +1475,10 @@ libxlDomainPMSuspendForDuration(virDomainPtr dom,
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_PMSUSPENDED, VIR_DOMAIN_PMSUSPENDED_UNKNOWN);
|
||||
event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_PMSUSPENDED,
|
||||
VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY);
|
||||
|
||||
ret = 0;
|
||||
|
||||
endjob:
|
||||
@ -1481,6 +1486,7 @@ libxlDomainPMSuspendForDuration(virDomainPtr dom,
|
||||
|
||||
cleanup:
|
||||
virDomainObjEndAPI(&vm);
|
||||
virObjectEventStateQueue(driver->domainEventState, event);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user