Bug 542378

Summary: fix suspend to disk of virtio block
Product: Red Hat Enterprise Linux 6 Reporter: Dor Laor <dlaor>
Component: kernelAssignee: Amit Shah <amit.shah>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 6.0CC: ddumas, gcosta, gleb, juzhang, kcao, knoel, lihuang, markmc, mhideo, michen, mishu, mst, qzhang, riek, rwheeler, shuang, tao, tburke, virt-maint, yvugenfi
Target Milestone: rcKeywords: Reopened
Target Release: 6.2   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kernel-2.6.32-231.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 516769 Environment:
Last Closed: 2012-06-20 07:32:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 516769, 582519    
Bug Blocks: 580948, 580954, 662543, 693510, 720669, 748534    

Comment 1 RHEL Program Management 2009-11-29 15:15:18 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 3 Dor Laor 2010-01-04 12:46:59 UTC
*** Bug 533342 has been marked as a duplicate of this bug. ***

Comment 4 Eduardo Habkost 2010-01-20 11:52:59 UTC
On RHEL-6, the KVM userspace package is named "qemu-kvm". Moving bug to the right component.

Comment 5 Dor Laor 2010-05-04 06:47:15 UTC
*** Bug 582519 has been marked as a duplicate of this bug. ***

Comment 6 Dor Laor 2010-05-04 06:50:37 UTC
Can QE try it on rhel6?

Comment 7 Gleb Natapov 2010-05-05 09:54:16 UTC
On resume new kernel boots and uses virtio-blk to load suspended OS image,
then control of virtio-blk device should be transfered from boot kernel
to resumed kernel. xen-blkfront.c for instance has function blkfront_resume() with comment:
/**
  * We are reconnecting to the backend, due to a suspend/resume, or a backend   
  * driver restart.  We tear down our blkif structure and recreate it, but
  * leave the device-layer structures intact so that this is transparent to the
  * rest of the kernel.
  */

I haven't seen such code in virtio-blk last time I looked.

Comment 8 chellwig@redhat.com 2010-05-07 11:58:57 UTC
Err. Just making sure I'm on the same page.  This is for doing suspend to disk of the guest, not the host?  In that case my previous comments don't apply and we'll have look at PM support in virtio_blk.

Comment 9 Gleb Natapov 2010-05-07 12:08:41 UTC
Correct. This is about suspending _guest_.

Comment 10 Gleb Natapov 2010-05-13 18:48:51 UTC
*** Bug 591585 has been marked as a duplicate of this bug. ***

Comment 17 Amit Shah 2011-05-30 10:49:53 UTC

*** This bug has been marked as a duplicate of bug 609286 ***

Comment 18 Amit Shah 2011-12-09 10:24:04 UTC
Each virtio driver needs to be updated to handle PM, so re-opening this.

Comment 20 RHEL Program Management 2011-12-13 04:41:53 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux maintenance release. Product Management has 
requested further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed 
products. This request is not yet committed for inclusion in an Update release.

Comment 21 Aristeu Rozanski 2012-02-15 19:55:43 UTC
Patch(es) available on kernel-2.6.32-231.el6

Comment 24 Qunfang Zhang 2012-04-16 08:12:03 UTC
Verified on kernel-2.6.32-262.el6, and this bug does not exist.
Related packages:
qemu-kvm-0.12.1.2-2.275.el6.x86_64
seabios-0.6.1.2-18.el6.x86_64

Steps:
1. Boot guest with virtio serial device:
# /usr/libexec/qemu-kvm -M rhel6.3.0 -cpu Conroe -enable-kvm -m 2G -smp
2,sockets=1,cores=2,threads=1 -name rhel6.3 -uuid
4c84db67-faf8-4498-9829-19a3d6431d9d -rtc base=localtime,driftfix=slew -drive
file=/home/rhel6.3-64-new.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=native
-device
virtio-blk-pci,bus=pci.0,drive=drive-virtio-disk0,id=virtio-disk0,addr=0x5
-netdev tap,id=hostnet0,script=/etc/qemu-ifup -device
virtio-net-pci,netdev=hostnet0,id=net0,mac=00:1a:2a:42:10:66,bus=pci.0,addr=0x3
-usb -device usb-tablet,id=input0 -boot c -monitor stdio -drive
if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device
ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -vnc :10 -qmp
tcp:0:4444,server,nowait -bios /usr/share/seabios/bios-pm.bin -chardev
socket,path=/tmp/qzhang-test,server,nowait,id=isa1 -device
isa-serial,chardev=isa1,id=isa-serial1 -device
virtio-serial-pci,id=virtio-serial0,max_ports=31,vectors=4,bus=pci.0 -chardev
socket,id=channel0,path=/tmp/virtio-serial,server,nowait -device
virtserialport,chardev=channel0,name=org.linux-kvm.port.0,bus=virtio-serial0.0,id=port0
-device virtio-balloon-pci,bus=pci.0,id=balloon0

2. Suspend guest to disk 
#pm-hibernate

3. Resume guest by booting up with the same command line.

4. After resume, check if guest works well. For example, network ping available, no crash, hang happened, etc.

5. Repeat step 2~4 for several times.

Result: Guest works well to suspend to disk with virtio block device.

So, this issue is fixed.

Comment 26 errata-xmlrpc 2012-06-20 07:32:33 UTC
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/RHSA-2012-0862.html