Bug 1257409 - executing (qemu)system_powerdown causes the linux guest frozen
executing (qemu)system_powerdown causes the linux guest frozen
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.2
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Markus Armbruster
Virtualization Bugs
:
Depends On: 1246944
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-26 23:48 EDT by Xueqiang Wei
Modified: 2016-07-25 02:11 EDT (History)
15 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1246944
Environment:
Last Closed: 2016-07-25 02:11:02 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)
Comment 1 Xueqiang Wei 2015-08-26 23:53:45 EDT
Version-Release number of selected component (if applicable):

Host:
kernel-3.10.0-306.0.1.el7.x86_64
qemu-kvm-1.5.3-101.el7

Guest:
kernel-3.10.0-309.el7.x86_64


BTW, also hit this issue with qmp command {"execute": "system_powerdown"}
Comment 3 Xueqiang Wei 2015-08-27 07:42:47 EDT
in guest
#runlevel
N 5

 
# init 3
then (qemu) system_powerdown, not hit this issue.
Comment 5 Andrei Stepanov 2016-05-31 14:40:13 EDT
Reproducible on:
kernel-3.10.0-418.el7.x86_64
qemu-kvm-1.5.3-112.el7.x86_64
Comment 6 Amit Shah 2016-07-22 04:19:47 EDT
As comment 3 shows, this is the guest trying to do a hibernate / suspend instead of a shutdown.

Using qemu commands for effecting shutdown isn't guaranteed to produce desired results, because the guest can (and, indeed, does) influence the action on such commands.

The safest way to shutdown a guest from the host is to issue commands via libvirt, which routes through the guest agent.

Perhaps QE can update the test cases to not use the qemu commands, since what the guest does on receiving those commands is not in our control, unless those commands are routed through the guest-agent.
Comment 7 Markus Armbruster 2016-07-22 04:58:28 EDT
system_powerdown triggers a System Control Interrupt in the guest.  The guest can react to it however it likes.  As long as qemu-kvm triggers an SCI, there is no qemu-kvm bug.

Closely related: bug 980692.  It was filed against qemu-kvm with the title "fail to poweroff guest when do system_powerdown in HMP monitor if did not login guest", and reassigned to gdm with the title changed to "gdm login screen in VMs: the ACPI power button should by default effect a shutdown".  The actual bug we fixed there was the guest's reaction to SCI while gdm is running.

To double-check it's the guest's decision not to shutdown, please

* confirm that shutdown works in run level 3, and

* retest run level 5 with a guest that has bug 980692 fixed.

Additionally:

* The expected result of tests involving system_powerdown depends on the guest.  Therefore, the test plan needs to spell out how to get the guest into a defined state that reliably produces the expected result.  Please confirm the test plan does that.

* Please confirm the test plan covers the preferred way to shut down guests, namely via libvirt commands to make the guest agent shut it down.
Comment 8 Xueqiang Wei 2016-07-25 01:48:03 EDT
(In reply to Markus Armbruster from comment #7)
> system_powerdown triggers a System Control Interrupt in the guest.  The
> guest can react to it however it likes.  As long as qemu-kvm triggers an
> SCI, there is no qemu-kvm bug.
> 
> Closely related: bug 980692.  It was filed against qemu-kvm with the title
> "fail to poweroff guest when do system_powerdown in HMP monitor if did not
> login guest", and reassigned to gdm with the title changed to "gdm login
> screen in VMs: the ACPI power button should by default effect a shutdown". 
> The actual bug we fixed there was the guest's reaction to SCI while gdm is
> running.
> 
> To double-check it's the guest's decision not to shutdown, please
> 
> * confirm that shutdown works in run level 3, and
> 
> * retest run level 5 with a guest that has bug 980692 fixed.
> 
> Additionally:
> 
> * The expected result of tests involving system_powerdown depends on the
> guest.  Therefore, the test plan needs to spell out how to get the guest
> into a defined state that reliably produces the expected result.  Please
> confirm the test plan does that.
> 
> * Please confirm the test plan covers the preferred way to shut down guests,
> namely via libvirt commands to make the guest agent shut it down.


Confirmed, shutdown works in run level 3, and retested bug 980692, it has fixed.
Will confirm with feature owner and update test plan. Thank you.
Comment 9 Markus Armbruster 2016-07-25 02:11:02 EDT
Your testing confirms that QEMU works as it should.  Closing NOTABUG.

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