Red Hat Bugzilla – Bug 790744
Delete snapshot parent will crash libvirtd
Last modified: 2012-06-20 02:48:22 EDT
Description of problem: Delete snapshot parent with many children will crash libvirtd. Version-Release number of selected component (if applicable): libvirt-0.9.10-1.el6.x86_64 How reproducible: always Steps to Reproduce: 1. qemu-img create -f qcow2 /var/lib/libvirt/images/foo.qcow2 10M 2. virsh edit guest configuration and let guest disk source point to the image file 3. # virsh snapshot-create-as foo snap Domain snapshot snap created # virsh snapshot-list foo Name Creation Time State ------------------------------------------------------------ snap 2012-02-15 17:51:18 +0800 running # virsh snapshot-create foo Domain snapshot 1329299507 created # virsh snapshot-create foo Domain snapshot 1329299512 created # virsh snapshot-list foo --parent Name Creation Time State Parent ------------------------------------------------------------ 1329299507 2012-02-15 17:51:47 +0800 running snap 1329299512 2012-02-15 17:51:52 +0800 running 1329299507 snap 2012-02-15 17:51:18 +0800 running 4. # virsh snapshot-delete --children foo snap error: Failed to delete snapshot snap error: End of file while reading data: Input/output error Actual results: libvirtd crash Expected results: fix it. Additional info:
Eric has committed a patch for the issues: https://www.redhat.com/archives/libvir-list/2012-February/msg00662.html
In POST: http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-February/msg00778.html
Test with libvirt-0.9.10-2.el6.x86_64 virsh # list Id Name State ---------------------------------- 1 kvm1 running # virsh dumpxml kvm1 .. <disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/var/lib/libvirt/images/foo.img.qcow2'/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </disk> .. virsh # snapshot-create-as kvm1 snap Domain snapshot snap created virsh # snapshot-create kvm1 Domain snapshot 1329895045 created virsh # snapshot-create kvm1 Domain snapshot 1329895048 created virsh # snapshot-create kvm1 Domain snapshot 1329895053 created virsh # snapshot-create kvm1 Domain snapshot 1329895056 created virsh # snapshot-create kvm1 Domain snapshot 1329895061 created virsh # snapshot-list kvm1 --parent Name Creation Time State Parent ------------------------------------------------------------ 1329895045 2012-02-22 15:17:25 +0800 running snap 1329895048 2012-02-22 15:17:28 +0800 running 1329895045 1329895053 2012-02-22 15:17:33 +0800 running 1329895048 1329895056 2012-02-22 15:17:36 +0800 running 1329895053 1329895061 2012-02-22 15:17:41 +0800 running 1329895056 snap 2012-02-22 15:17:09 +0800 running virsh # snapshot-delete --children kvm1 snap Domain snapshot snap deleted virsh # snapshot-list kvm1 --parent Name Creation Time State Parent ------------------------------------------------------------ [root@zhpeng ~]# service libvirtd status libvirtd (pid 5271) is running... So, it passed.
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