Red Hat Bugzilla – Bug 1300454
virsh shutdown/reboot requests fail to work after the first guest reboot
Last modified: 2016-04-28 12:51:49 EDT
This bug is related to guest VM shutdown/reboot support for recent GPIO-based powerdown feature.
The 1st shutdown/reboot always worked for a fresh VM. If VM has been rebooted, then shutdown/reboot requests will fail to trigger VM to act (no reaction). In other words,
* fresh VM -> shutdown (worked) -> fresh VM -> shutdown/reboot (worked)
* fresh VM -> reboot (worked) -> stale VM -> shutdown/reboot (failed)
How to reproduce:
1. Download QEMU source from at http://git.engineering.redhat.com/git/users/wehuang/rhel7-qemu-kvm.git/log/?h=wei/qemu-rhev-upstream25-backport
2. Use a guest VM with RHELSA 7.3 kernel (4.4+), which supports GPIO fully. Boots this kernel.
3. In virsh, send shutdown/reboot requests to VM using "shutdown" or "reboot" commands.
It looks like the problem was caused by GPIO IRQ triggering mechanism. The following patch solves the problem. A patch will be prepared for the upstream.
@@ -550,7 +550,9 @@ static DeviceState *pl061_dev;
static void virt_powerdown_req(Notifier *n, void *opaque)
/* use gpio Pin 3 for power button event */
+ qemu_set_irq(qdev_get_gpio_in(pl061_dev, 3), 0);
qemu_set_irq(qdev_get_gpio_in(pl061_dev, 3), 1);
This is a high priority, as it fixes basic functionality. Do we have upstream patches yet?
I will test them today with the latest composes (QEMU). Will update the status after complete.
Here is my testing results:
* Fresh RHELSA installation on Seattle
* Install the latest QEMU compose: qemu-kvm-rhev-2.6.0-0.el7.rc3.aarch64
* Install a new guest VM from 7.2 ISO (RHELSA 7.3 ISO isn't available yet) using virt-install (name it: VM KERNEL 1)
* Download the latest RHELSA 7.3 kernel (kernel-4.5.0-0.34.el7) inside the same VM. Compile and install the kernel-4.5.0-0.34.el7 kernel in guest VM (name it: VM KERNEL 2)
1) VM KERNEL 1
Shutdown/reboot (in virsh) doesn't work. This is because AMBA fix was not included in RHELSA 7.2 tree. See https://lkml.org/lkml/2015/9/30/392 for details.
2) VM KERNEL 2
Shutdown/reboot (in virsh) work. The issue described in this BZ wasn't observed anymore: no matter how early I issued shutdown/reboot command, guest VM was always able to comply.
shutdown/reboot should work properly under ACPI mode for RHELSA 7.3 kernel + QEMU 2.6. We can close this BZ.