Bug 1300454 - virsh shutdown/reboot requests fail to work after the first guest reboot
virsh shutdown/reboot requests fail to work after the first guest reboot
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev (Show other bugs)
7.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Wei Huang
Virtualization Bugs
:
Depends On:
Blocks: 1173755
  Show dependency treegraph
 
Reported: 2016-01-20 16:22 EST by Wei Huang
Modified: 2016-04-28 12:51 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-04-28 12:51:49 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Wei Huang 2016-01-20 16:22:39 EST
This bug is related to guest VM shutdown/reboot support for recent GPIO-based powerdown feature.

Symptom:
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.
Comment 2 Wei Huang 2016-01-25 15:56:30 EST
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.

-Wei


--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -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);
Comment 3 Andrew Jones 2016-04-26 09:24:13 EDT
This is a high priority, as it fixes basic functionality. Do we have upstream patches yet?
Comment 4 Wei Huang 2016-04-27 11:36:01 EDT
I will test them today with the latest composes (QEMU). Will update the status after complete.
Comment 5 Wei Huang 2016-04-28 12:51:49 EDT
Here is my testing results:

SETUP
* 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)

TESTING RESULTS
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.

CONCLUSION
shutdown/reboot should work properly under ACPI mode for RHELSA 7.3 kernel + QEMU 2.6. We can close this BZ.

Note You need to log in before you can comment on or make changes to this bug.