Bug 807898 - guest quit or device hot-unplug during streaming fails
guest quit or device hot-unplug during streaming fails
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.3
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Paolo Bonzini
Virtualization Bugs
: Reopened
: 808004 (view as bug list)
Depends On:
Blocks: 806280
  Show dependency treegraph
 
Reported: 2012-03-29 01:21 EDT by Shaolong Hu
Modified: 2013-01-09 19:49 EST (History)
11 users (show)

See Also:
Fixed In Version: qemu-kvm-0.12.1.2-2.274.el6
Doc Type: Bug Fix
Doc Text:
No documentation needed.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 07:45:45 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)
guest screenshot after s4 (12.78 KB, image/png)
2012-03-29 01:21 EDT, Shaolong Hu
no flags Details
patch to fix the bug, RHEL version (2.68 KB, patch)
2012-03-29 11:57 EDT, Paolo Bonzini
no flags Details | Diff

  None (edit)
Description Shaolong Hu 2012-03-29 01:21:10 EDT
Created attachment 573530 [details]
guest screenshot after s4

Description of problem:
------------------------
guest s4 + streaming fails


Version-Release number of selected component (if applicable):
-------------------------------------------------------------
qemu-kvm 267rhev
guest kernel 258


How reproducible:
------------------
2/2

Steps to Reproduce:
--------------------
1./usr/libexec/qemu-kvm -enable-kvm -M rhel6.3.0 -m 4G -name rhel6.3-64 -rtc base=utc,clock=host,driftfix=slew -no-kvm-pit-reinjection -uuid 3f2ea5cd-3d29-48ff-aab2-23df1b6ae213 -drive file=/root/RHEL-Server-6.3-64-virtio.qcow2,cache=none,if=none,rerror=stop,werror=stop,id=drive-virtio-disk0,format=qcow2 -device virtio-blk-pci,drive=drive-virtio-disk0,id=device-virtio-disk0 -netdev tap,script=/etc/qemu-ifup,id=netdev0 -device virtio-net-pci,netdev=netdev0,id=device-net0 -boot order=cd -monitor stdio -usb -device usb-tablet,id=input0 -chardev socket,id=s1,path=/tmp/s1,server,nowait -device isa-serial,chardev=s1 -vnc :10 -monitor tcp::1234,server,nowait -smp 4 -qmp tcp:0:5555,server,nowait -chardev socket,id=qmp_monitor_id_qmpmonitor1,path=/tmp/qmp,server,nowait -mon chardev=qmp_monitor_id_qmpmonitor1,mode=control

2.in qemu monitor:
(qemu) snapshot_blkdev drive-virtio-disk0 /root/sn1 qcow2

3.in qemu monitor:
(qemu) block_stream drive-virtio-disk0

4.in guest, s4:
echo disk > /sys/power/state

  
Actual results:
----------------
s4 fails to end, guest hang, screenshot in attachment, boot guest with sn1, guest boots as normal instead of resuming from s4.


Additional info:
-----------------
find this problem with bug 807894, maybe the same one.
Comment 2 Dor Laor 2012-03-29 03:17:53 EDT
Does s4 work 100% reliable w/o streaming? Same question to streaming w/o s4
Let's close it as a duplicate of # 807894 for the time being

*** This bug has been marked as a duplicate of bug 807894 ***
Comment 3 Shaolong Hu 2012-03-29 03:23:23 EDT
(In reply to comment #2)
> Does s4 work 100% reliable w/o streaming? Same question to streaming w/o s4
> Let's close it as a duplicate of # 807894 for the time being
> 
> *** This bug has been marked as a duplicate of bug 807894 ***

Yes, s4 w/o streaming works fine(try 2 times, not sure 100% works), after s4, qemu-kvm quits, start qemu-kvm again, guest resumes from s4 correctly.
Comment 4 Paolo Bonzini 2012-03-29 10:17:12 EDT
This is related to shutdown while streaming (bug 807894 comment 9).

The following works:

1) start qemu-kvm with -no-shutdown
2) snapshot_blkdev virtio0 /home/pbonzini/snap.qcow2 qcow2
3) block_stream virtio0
4) ... echo disk > /sys/power/state

when it finishes:
5) block_job_cancel virtio0
6) quit
7) reboot with snap.qcow2
Comment 5 Paolo Bonzini 2012-03-29 11:48:19 EDT
This happens if streaming does an iteration while qcow2_cache_flush runs.  It can be fixed by adding a proper qemu_aio_wait.  Submitting patch upstream for comments.
Comment 6 Paolo Bonzini 2012-03-29 11:57:45 EDT
Created attachment 573721 [details]
patch to fix the bug, RHEL version
Comment 7 Paolo Bonzini 2012-03-30 03:52:07 EDT
device_del also needs to be tested.
Comment 8 Shaolong Hu 2012-03-30 04:04:52 EDT
(In reply to comment #7)
> device_del also needs to be tested.

sure, we have a case covering it.
Comment 9 Paolo Bonzini 2012-04-03 10:33:50 EDT
*** Bug 808004 has been marked as a duplicate of this bug. ***
Comment 12 daiwei 2012-04-19 08:36:00 EDT
Reproduced this issue with steps and environment as follows:

# uname -r; rpm -q qemu-kvm
2.6.32-262.el6.x86_64
qemu-kvm-0.12.1.2-2.267.el6ev.x86_64

1.boot guest 

2.in qemu monitor:
(qemu) snapshot_blkdev drive-virtio-disk0 /root/sn1 qcow2

s4 fails to end, guest hangs.boot guest with sn1,guest boots as normal instead of resuming from s4.

Verified this issue with steps and environment as follows:

# uname -r ;rpm -q qemu-kvm-rhev
2.6.32-262.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.278.el6.x86_64

1. boot guest

2.in qemu monitor:
(qemu) snapshot_blkdev drive-virtio-disk0 /root/sn1 qcow2

qemu-kvm quit normally. boot guest with sn1,guest resumes from s4 .

3.boot guest with a datadisk 
/usr/libexec/qemu-kvm -enable-kvm -M rhel6.3.0 -m 4G -name rhel6.3-64 -rtc base=utc,clock=host,driftfix=slew -no-kvm-pit-reinjection -uuid 3f2ea5cd-3d29-48ff-aab2-23df1b6ae213 -drive file=/home/rhel6.3-64.qcow2,cache=none,if=none,rerror=stop,werror=stop,id=drive-virtio-disk0,format=qcow2 -device virtio-blk-pci,drive=drive-virtio-disk0,id=device-virtio-disk0 -netdev tap,script=/etc/qemu-ifup-switch,id=netdev0 -device virtio-net-pci,netdev=netdev0,id=device-net0 -boot order=cd -monitor stdio -usb -device usb-tablet,id=input0 -chardev socket,id=s1,path=/tmp/s1,server,nowait -device isa-serial,chardev=s1 -vnc :10 -monitor tcp::1234,server,nowait -smp 4 -qmp tcp:0:5555,server,nowait -chardev socket,id=qmp_monitor_id_qmpmonitor1,path=/tmp/qmp,server,nowait -mon chardev=qmp_monitor_id_qmpmonitor1,mode=control -drive file=/home/datadisk.qcow2,cache=none,if=none,rerror=stop,werror=stop,id=disk1,format=qcow2 -device virtio-blk-pci,drive=disk1,id=datadisk1

4.in qemu monitor:
(qemu) snapshot_blkdev disk1 /root/sn2 qcow2
(qemu) block-stream disk1
(qemu) device_del datadisk1

block-job was canceled , and boot guest with sn2 works well.

So, this bug has been fixed.
Comment 15 Michal Novotny 2012-05-04 09:16:36 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
NEEDINFO
Comment 16 Paolo Bonzini 2012-05-04 09:44:47 EDT
New feature in 6.3, no documentation needed.
Comment 17 Paolo Bonzini 2012-05-04 09:44:47 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-NEEDINFO+No documentation needed.
Comment 18 errata-xmlrpc 2012-06-20 07:45:45 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.

http://rhn.redhat.com/errata/RHBA-2012-0746.html

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