
On 11/30/18 9:53 AM, Wang King wrote:
The issue occurs when I make repeated calls to virDomainReboot with VIR_DOMAIN_REBOOT_DEFAULT flag. In the first call to reboot domain, the qemu driver chose ACPI path, and set priv->fakeReboot to true. Then in a second call, qemu driver chose agent to reboot which set fakeReboot to false. But because the guest already responded to ACPI shut down, libvirtd daemon will process a SHUTDOWN event in qemuProcessShutdownOrReboot and checks priv->fakeReboot. Since the fakeReboot flag is now false, qemu process is unexpectedly killed.
This sounds fishy. Looking at the code libvirt decides whether to use agent or ACPI based on: a) flags (but since you're passing 0 this is out of the picture), b) guest agent being available, This means that agent must have connected between two virDomainReboot() calls. Otherwise libvirt would make the same choice.
I have no idea how to fix it.
Well, the qemuDomainSetFakeReboot(false) call was added in b0c144c5792 which points to: https://www.redhat.com/archives/libvir-list/2015-April/msg00732.html I think the patch proposed there is actually right and not the one that was merged. Michal