Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 637180 - watchdog timer isn't reset when qemu resets
watchdog timer isn't reset when qemu resets
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.1
All Linux
low Severity medium
: rc
: 6.1
Assigned To: Richard W.M. Jones
Virtualization Bugs
:
Depends On:
Blocks: 580954 634607
  Show dependency treegraph
 
Reported: 2010-09-24 10:36 EDT by Richard W.M. Jones
Modified: 2011-05-19 08:49 EDT (History)
8 users (show)

See Also:
Fixed In Version: qemu-kvm-0.12.1.2-2.134.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-05-19 07:34:42 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0534 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2011-05-19 07:20:36 EDT

  None (edit)
Description Richard W.M. Jones 2010-09-24 10:36:01 EDT
Description of problem:

The IB700 and I6300ESB watchdog timers don't include a handler
to reset them when the VM / qemu is reset.

The could lead to a failure case as follows:

(a) guest boots, watchdog is enabled

(b) guest does a reset eg:
  echo 'b' > /proc/sysrq-trigger
(note that an ordinary /sbin/reboot wouldn't hit this case
since that would properly disable the watchdog)

(c) the reboot takes longer than the remaining time on the
watchdog

(d) the watchdog therefore fires during the reboot

(e) probably the VM would just reboot again at this point which
  is pretty benign, but it could depend on the action that the
  user had selected for the watchdog

Version-Release number of selected component (if applicable):

All versions of qemu including upstream.

How reproducible:

Always.

Steps to Reproduce:

For the purpose of this demonstration, I'm going to directly
invoke qemu-kvm.  You need a guest with the watchdog daemon
installed and configured.  The guest should also have a grub
timeout so you can interrupt the boot.

(1) Run:

qemu-kvm \
    -enable-kvm \
    -m 1024 -vnc :11 \
    -drive file=watchdog-guest.img \
    -watchdog i6300esb \
    -watchdog-action reset

(2) Wait until this boots, check watchdog daemon is running.

(3) Inside the guest do:

sync
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger

Guest will immediately reboot.  Same qemu process will
still be running.

(4) Enter grub as the guest boots (ie. hit Esc), and wait for
a few seconds.

Actual results:

The watchdog will fire, causing the guest to reboot again while
you are waiting in grub.

Expected results:

Watchdog should have been reset by the action of resetting
qemu.

Additional info:
Comment 1 Richard W.M. Jones 2010-09-24 12:28:24 EDT
Patch posted upstream:
http://lists.nongnu.org/archive/html/qemu-devel/2010-09/msg01754.html
Comment 2 Richard W.M. Jones 2011-01-04 06:48:15 EST
Fixed (eventually) upstream in the following commits:

http://www.qemu.com/qemu.git/commit/?id=36888c6335422f07bbc50bf3443a39f24b90c7c6
Watchdog: disable watchdog timer when hard-rebooting a guest.

http://www.qemu.com/qemu.git/commit/?id=fa82e9c300df6f7b8bd44a26ac752c4ea5da02c1
wdt_i6300esb: register a reset function

(Note that both patches are needed)
Comment 9 Shaolong Hu 2011-02-17 04:52:40 EST
Reproduced on qemu-kvm-0.12.1.2-2.131.el6 as following steps.

Reproduce Procedure:
---------------------
1. boot guest with "-watchdog i6300esb -watchdog-action reset"
2. in the guest, enable watchdog:
   #cat /dev/watchdog
3. reboot guest using following commands before watch dog heartbeat expire:
   #sync
   #echo 1 > /proc/sys/kernel/sysrq
   #echo b > /proc/sysrq-trigger
4. enter grub interface, press ESC to interrupt the timer, and wait.

Actual results:
----------------
After step 4, for a few seconds, the guest reset.


Verify this bug on qemu-kvm-0.12.1.2-2.146.el6 as the same steps above.

Actual results:
----------------
After step 4, the guest stay in grub interface without reset.

Conclusion:
-------------
According to above results, this bug has been resolved.
Comment 10 Richard W.M. Jones 2011-03-02 05:33:10 EST
Should this be moved to VERIFIED now?
Comment 11 Miya Chen 2011-03-02 05:41:01 EST
Based on comment#9, change status to verified.
Comment 12 errata-xmlrpc 2011-05-19 07:34:42 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0534.html
Comment 13 errata-xmlrpc 2011-05-19 08:49:16 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0534.html

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