Bug 807147

Summary: virsh snapshot-create --disk-only failed
Product: Red Hat Enterprise Linux 6 Reporter: Huang Wenlong <whuang>
Component: libvirtAssignee: Eric Blake <eblake>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 6.4CC: acathrow, cwei, dallan, dyasny, eblake, mzhan, rwu, zhpeng
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.9.10-9.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 06:50:56 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:

Description Huang Wenlong 2012-03-27 07:44:33 UTC
Description of problem:
 virsh snapshot-create q --disk-only
error: internal error unable to execute QEMU command 'transaction': Invalid JSON syntax


Version-Release number of selected component (if applicable):
libvirt-0.9.10-8.el6.x86_64
qemu-kvm-0.12.1.2-2.265.el6rhev.x86_64


How reproducible:
100%
Steps to Reproduce:
1.# virsh snapshot-create q --disk-only
error: internal error unable to execute QEMU command 'transaction': Invalid JSON syntax


2. ...
   <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/mig-qcow2.img'/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
...

Additional info:

Comment 2 Huang Wenlong 2012-03-27 08:04:02 UTC
libvirt-0.9.10-7.el6.x86_64 can reproduce this bug 
but libvirt-0.9.10-6.el6.x86_64 can not so it is a regression .

Comment 3 Peter Krempa 2012-03-27 12:01:27 UTC
Caused by commit d42a2ffc07ab9bb569819f0a15b42f1017b5f330. Our JSON string generator generates an invalid string if the argument is NULL. 

Patch proposed upstream:
http://www.redhat.com/archives/libvir-list/2012-March/msg01199.html

Comment 5 Huang Wenlong 2012-03-29 05:47:03 UTC
Verify this bug :

libvirt-0.9.10-9.el6.x86_64
qemu-kvm-0.12.1.2-2.265.el6rhev.x86_64


# virsh snapshot-create f16 --disk-only 
Domain snapshot 1332999912 created

after snapshot guest xml 

 <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source file='/var/lib/libvirt/images/f16qcow2.1332999912'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>

Comment 7 errata-xmlrpc 2012-06-20 06:50:56 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-0748.html