qemuDomainReboot: use fakeReboot=true only for acpi mode

When acpi is used to reboot/shutdown qemu domain, qemu emits
SHUTDOWN event. Libvirt uses fakeReboot variable in order to
differentiate reboot or shutdown. fakeReboot value is reseted
to false after domain restart/reset.

When mode=agent is used to reboot qemu domain, qemu doesn't emit
SHUTDOWN event and libvirt doesn't reset fakeReboot value to false.
In this case next 'shutdown -h now' performs reboot. That's why
we don't need to set fakeReboot=true for mode=agent.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Dmitry Andreev 2016-01-20 16:10:09 +03:00 committed by Jiri Denemark
parent 3bd2ee5d55
commit e2b86f580c

View File

@ -2068,8 +2068,6 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
goto endjob;
}
qemuDomainSetFakeReboot(driver, vm, isReboot);
if (useAgent) {
qemuDomainObjEnterAgent(vm);
ret = qemuAgentShutdown(priv->agent, agentFlag);
@ -2096,6 +2094,7 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags)
#if WITH_YAJL
}
#endif
qemuDomainSetFakeReboot(driver, vm, isReboot);
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSystemPowerdown(priv->mon);
if (qemuDomainObjExitMonitor(driver, vm) < 0)