Bug 892118

Summary: Load guest from compressed file failed due to xbzrle is enabled during migrating to file
Product: Red Hat Enterprise Linux 7 Reporter: Qunfang Zhang <qzhang>
Component: qemu-kvmAssignee: Hai Huang <hhuang>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: hhuang, juzhang, michen, quintela, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: QEMU 1.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 09:40:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Qunfang Zhang 2013-01-05 09:37:01 UTC
Description of problem:
Enable xbzrle capability before migration and then migrate guest to a compressed file.  There will be a problem when resume/load the guest with -incoming "exec:gzip -c -d /tmp/STATEFILE.gz".

#/usr/libexec/qemu-kvm .... -incoming "exec:gzip -c -d /tmp/STATEFILE.gz"
Warning: option deprecated, use lost_tick_policy property of kvm-pit instead.
QEMU 1.2.0 monitor - type 'help' for more information
(qemu) qemu: warning: error while loading state section id 2
load of migration failed


Version-Release number of selected component (if applicable):
kernel-3.6.0-0.29.el7.x86_64
qemu-kvm-1.2.0-21.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Boot a guest

2. Enable xbzrle 
(qemu) migrate_set_capability xbzrle on    
(qemu) migrate_set_cache_size 2G

3. Migrate guest to file.
(qemu) migrate -d "exec:gzip -c > /tmp/STATEFILE.gz"

4. 
(qemu) info migrate
capabilities: xbzrle: on 
Migration status: completed
total time: 16334 milliseconds
transferred ram: 471991 kbytes
remaining ram: 0 kbytes
total ram: 2113920 kbytes
duplicate: 412154 pages
normal: 117885 pages
normal bytes: 471540 kbytes
cache size: 1073741824 bytes
xbzrle transferred: 48 kbytes
xbzrle pages: 323 pages
xbzrle cache miss: 117391
xbzrle overflow : 494
(qemu) 
(qemu) info status 
VM status: paused (postmigrate)

5. Quit the command line.

6. Resume the guest by booting with the same command line but append -incoming "exec:gzip -c -d /tmp/STATEFILE.gz"


Actual results:
#/usr/libexec/qemu-kvm .... -incoming "exec:gzip -c -d /tmp/STATEFILE.gz"
Warning: option deprecated, use lost_tick_policy property of kvm-pit instead.
QEMU 1.2.0 monitor - type 'help' for more information
(qemu) qemu: warning: error while loading state section id 2
load of migration failed


Expected results:
Should be one of the following two options:
(1) If migrate guest to file with 'exec' protocol, then will not use xbzrle even it is enabled.
(2) Add new parameter for resuming the guest from a compressed file with xbzrle.


Additional info:

Comment 4 Miroslav Rezanina 2014-02-13 07:01:50 UTC
Changing to MODIFIED to fullfill errata process

Comment 6 Qunfang Zhang 2014-02-19 09:32:48 UTC
Verified pass on qemu-kvm-1.5.3-48.el7.x86_64. 

1. Boot up a guest on host. 

/usr/libexec/qemu-kvm -cpu SandyBridge -M pc -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -name rhel6.4-64 -uuid 9a0e67ec-f286-d8e7-0548-0c1c9ec93009 -nodefconfig -nodefaults -monitor stdio -rtc base=utc,clock=host,driftfix=slew -no-kvm-pit-reinjection -no-shutdown -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x7 -drive file=/mnt/RHEL-Server-7.0-64-virtio.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -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 -netdev tap,id=hostnet0,vhost=on -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:d5:51:8a,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=channel1,path=/tmp/helloworld1,server,nowait -device virtserialport,chardev=channel1,name=port1,bus=virtio-serial0.0,id=port1 -chardev socket,id=channel2,path=/tmp/helloworld2,server,nowait -device virtserialport,chardev=channel2,name=port2,bus=virtio-serial0.0,id=port2 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=3,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -vnc :10 -vga std -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 -qmp tcp:0:5555,server,nowait -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0

2. Enable xbzrle and migrate guest to compressed file. 

(qemu) migrate_set_capability xbzrle on    
(qemu) migrate_set_cache_size 2G
(qemu) migrate -d "exec:gzip -c > /tmp/STATEFILE.gz"

3. Quit the command line after migration finished.  

(qemu) info migrate
capabilities: xbzrle: on x-rdma-pin-all: off auto-converge: off zero-blocks: off 
Migration status: completed
total time: 11072 milliseconds
downtime: 56 milliseconds
setup: 4 milliseconds
transferred ram: 300219 kbytes
throughput: 268.57 mbps
remaining ram: 0 kbytes
total ram: 2114264 kbytes
duplicate: 457838 pages
skipped: 0 pages
normal: 73904 pages
normal bytes: 295616 kbytes
cache size: 2147483648 bytes
xbzrle transferred: 0 kbytes
xbzrle pages: 26 pages
xbzrle cache miss: 3162
xbzrle overflow : 0
(qemu) info status 
VM status: paused (postmigrate)

4. Resume the guest by booting with the same command line but append -incoming "exec:gzip -c -d /tmp/STATEFILE.gz"

5. (qemu) info status 
VM status: paused (inmigrate)
(qemu) 
(qemu) [Thread 0x7fffebc39700 (LWP 11375) exited]
info status 
VM status: running

Finally, guest works well on the host and goes back to the point when saving to the compressed file. 

So this issue is fixed.

Comment 8 Ludek Smid 2014-06-13 09:40:30 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.