First this fixes the same issue as e2b86f580. Only difference is
that reboot is done via shutdown function with reboot semantics.
Second 8be502fd tells us that we need to always set fake reboot
flag if shutdown/reboot will trigger shutdown event. To put
it simple we need to set it false if agent is used.
References:
e2b86f580 - fixes guest shutdown becames reboot after API reboot thru agent
8be502fd - fixes API shutdown thru agent becames reboot after API reboot
thru acpi (more on
https://www.redhat.com/archives/libvir-list/2015-April/msg00715.html)
---
src/qemu/qemu_driver.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2089359..8855387 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1997,9 +1997,9 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int
flags)
useAgent = false;
}
- qemuDomainSetFakeReboot(driver, vm, isReboot);
if (useAgent) {
+ qemuDomainSetFakeReboot(driver, vm, false);
qemuDomainObjEnterAgent(vm);
ret = qemuAgentShutdown(priv->agent, agentFlag);
qemuDomainObjExitAgent(vm);
@@ -2018,6 +2018,7 @@ static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int
flags)
goto endjob;
}
+ qemuDomainSetFakeReboot(driver, vm, isReboot);
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSystemPowerdown(priv->mon);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
@@ -2091,6 +2092,7 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
}
if (useAgent) {
+ qemuDomainSetFakeReboot(driver, vm, false);
qemuDomainObjEnterAgent(vm);
ret = qemuAgentShutdown(priv->agent, agentFlag);
qemuDomainObjExitAgent(vm);
--
1.8.3.1