提交 d6943eab 编写于 作者: J Jim Fehlig

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: NJim Fehlig <jfehlig@suse.com>
Reviewed-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
上级 18d47d61
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册