Bug 676982

Summary: RFE: no qmp command for live snapshot
Product: Red Hat Enterprise Linux 6 Reporter: Shirley Zhou <szhou>
Component: qemu-kvmAssignee: Jes Sorensen <Jes.Sorensen>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: jdenemar, jyang, mkenneth, mshao, qzhang, tburke, virt-maint
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.173.el6 Doc Type: Enhancement
Doc Text:
No technote needed as this feature was pulled from 6.2
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 15:44:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 580946, 693510    

Description Shirley Zhou 2011-02-12 08:26:27 UTC
Description of problem:
There should be qmp command for live snapshot. we have qemu monitor command (qemu) snapshot_blkdev [device] [new-image-file] [format].

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.144.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.start guest with qmp
-qmp tcp:0:4444,server

2.query all qmp commands
{"execute":"query-commands"}


  
Actual results:
no related live snapshot commands

Expected results:
There should be qmp command for live snapshot.

Additional info:

Comment 2 Jes Sorensen 2011-02-14 14:21:23 UTC
Jiri,

Do you need this for libvirt? In which case, what is the timeframe
for it?

Thanks,
Jes

Comment 4 Jes Sorensen 2011-04-19 08:56:07 UTC
Patch posted for upstream QEMU. Please review it to make sure it does
what you need.

Comment 10 Qunfang Zhang 2011-08-01 02:43:31 UTC
Verified on qemu-kvm-0.12.1.2-2.175.el6, have "blockdev-snapshot-sync" command already and the command works well.

Steps:
1. Boot a guest
 /usr/libexec/qemu-kvm -m 2G -smp 2 -cpu cpu64-rhel6,+x2apic -usbdevice tablet -drive file=/home/RHEL-Server-6.1-64-virtio.qcow2,format=qcow2,if=none,id=drive-ide0-0-0,werror=stop,rerror=stop,cache=none -device virtio-blk-pci,drive=drive-ide0-0-0,id=ide0-0-0 -netdev tap,id=hostnet0,script=/etc/qemu-ifup -device e1000,netdev=hostnet0,mac=00:10:2a:25:1a:58,bus=pci.0,addr=0x6 -boot c -uuid 8d4fefcc-2f16-4de3-9005-fb1d651c732f -rtc-td-hack -no-kvm-pit-reinjection -monitor stdio -qmp tcp:0:4444,server,nowait -name rhel6.1 -vnc :10 -device virtio-balloon-pci,bus=pci.0,id=balloon0

2. Using dd to create a file inside base image.

3. {"execute":"blockdev-snapshot-sync","arguments":{"device":"drive-ide0-0-0","snapshot-file":"/home/sn-1","format":"qcow2"}}
{"return": {}}

4. {"execute":"query-block"}
{"return": [{"device": "drive-ide0-0-0", "locked": false, "removable": false, "inserted": {"ro": false, "drv": "qcow2", "backing_file": "/home/RHEL-Server-6.1-64-virtio.qcow2", "encrypted": false, "file": "/home/sn-1"}, "type": "hd"}, {"device": "ide1-cd0", "locked": false, "removable": true, "type": "cdrom"}, {"device": "floppy0", "locked": false, "removable": true, "type": "floppy"}, {"device": "sd0", "locked": false, "removable": true, "type": "floppy"}]}

5.Check the file created in base image, it exists. Create another file "file_sn1".

6. (qemu)commmit drive-ide0-0-0 or
{ "execute": "human-monitor-command","arguments": { "command-line": "commit drive-ide0-0-0"}}

7. shutdown guest and boot base image again, the file "file_sn1" exists.

8. Re-test with IDE block again, the result is the same as virtio.

So, this bug is verified pass.

Comment 12 Jes Sorensen 2011-11-18 15:38:13 UTC
    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:
No technote needed as this feature was pulled from 6.2

Comment 13 errata-xmlrpc 2011-12-06 15:44:25 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-2011-1531.html