Bug 1269575 - Guest state "crashed" does not get updated after "virsh reset"
Guest state "crashed" does not get updated after "virsh reset"
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.2
All Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: Martin Kletzander
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-07 11:04 EDT by Thomas Huth
Modified: 2016-11-03 14:25 EDT (History)
9 users (show)

See Also:
Fixed In Version: libvirt-2.0.0-5.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-03 14:25:34 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 Thomas Huth 2015-10-07 11:04:28 EDT
Description of problem:
The state of a crashed guest does not get updated after rebooting it via "virsh reset"

Version-Release number of selected component (if applicable):
libvirt-client-1.2.17-12.el7.ppc64le
qemu-kvm-rhev-2.3.0-28.el7.ppc64le

How reproducible:
100%

Steps to Reproduce:
1. Edit the XML definition of a guest so that it does not reboot
   automatically when it crashed:
     <on_crash>preserve</on_crash>
2. Start the guest and crash it by typing the following from the
   guest console:
     echo c > /proc/sysrq-trigger
3. Use "virsh list" from the host to check that the guest is
   in the "crashed" state
4. Reboot the guest by using "virsh reset" from the host
5. Issue "virsh list" again to check the state of the guest

Actual results:
The guest state is still shown as "crashed"

Expected results:
The guest state should be shown as "running" again
Comment 2 Martin Kletzander 2016-07-14 08:33:05 EDT
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2016-July/msg00439.html
Comment 3 Martin Kletzander 2016-08-02 07:38:36 EDT
Fixed upstream with v2.1.0-rc1-34-gdaf01a61254c:

commit daf01a61254cc21d90e15dae8080f13e9a34b489
Author: Martin Kletzander <mkletzan@redhat.com>
Date:   Wed Jul 13 16:13:58 2016 +0200

    qemu: Fix domain state after reset
Comment 6 Fangge Jin 2016-08-15 05:24:06 EDT
Reproduce this BZ on build libvirt-2.0.0-4.el7.x86_64

Steps:
0. Prepare a guest as below:
# virsh dumpxml rhel7
...
  <features>
    <acpi/>
    <apic/>
    <pmu state='on'/>
  </features>
...
  <on_crash>preserve</on_crash>
...


1. Start guest

2. In guest, # echo c > /proc/sysrq-trigger

3. Check guest status:
# virsh list
 Id    Name                           State
----------------------------------------------------
 6     rhel7                          crashed

4.Reset guest, and check status:
# virsh reset rhel7
Domain rhel7 was reset

# virsh list
 Id    Name                           State
----------------------------------------------------
 6     rhel7                          crashed
Comment 7 Fangge Jin 2016-08-15 05:33:51 EDT
Verify pass on build libvirt-2.0.0-5.el7.x86_64

Steps:
0. Prepare a guest as below:
# virsh dumpxml rhel7
...
  <features>
    <acpi/>
    <apic/>
    <pmu state='on'/>
  </features>
...
  <on_crash>preserve</on_crash>
...
    <panic model='isa'>
      <address type='isa' iobase='0x505'/>
    </panic>
...

1. Start guest

2. In guest: # echo c > /proc/sysrq-trigger

3. Check guest status
# virsh list
 Id    Name                           State
----------------------------------------------------
 80    rhel7                          crashed

# virsh domstate rhel7 --reason
crashed (panicked)

4. Reset guest and check guest status again:

# virsh reset rhel7
Domain rhel7 was reset

# virsh list
 Id    Name                           State
----------------------------------------------------
 80    rhel7                          paused

# virsh domstate rhel7 --reason
paused (crashed)

5.Resume guest and check guest status again:

# virsh resume rhel7
Domain rhel7 resumed

# virsh list
 Id    Name                           State
----------------------------------------------------
 80    rhel7                          running

# virsh domstate rhel7 --reason
running (unpaused)
Comment 8 Fangge Jin 2016-08-15 05:41:34 EDT
Hi Martin,

I have a question, why the guest is paused instead of running after reset?

Thank you!
Comment 9 Martin Kletzander 2016-08-15 07:17:20 EDT
Because that's how QEMU behaves.  You can start it afterwards normally.  Also the output of 'virsh domstate --reason' should be paused (crashed).
Comment 11 errata-xmlrpc 2016-11-03 14:25:34 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2577.html

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