Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 790744 - Delete snapshot parent will crash libvirtd
Delete snapshot parent will crash libvirtd
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
x86_64 Linux
high Severity high
: rc
: ---
Assigned To: Eric Blake
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-15 05:09 EST by Alex Jia
Modified: 2012-06-20 02:48 EDT (History)
7 users (show)

See Also:
Fixed In Version: libvirt-0.9.10-2.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 02:48:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 15:31:38 EDT

  None (edit)
Description Alex Jia 2012-02-15 05:09:11 EST
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:
Comment 1 Alex Jia 2012-02-15 05:16:42 EST
Eric has committed a patch for the issues:
https://www.redhat.com/archives/libvir-list/2012-February/msg00662.html
Comment 5 zhpeng 2012-02-22 02:22:21 EST
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.
Comment 7 errata-xmlrpc 2012-06-20 02:48:22 EDT
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

Note You need to log in before you can comment on or make changes to this bug.