Bug 1162974

Summary: external disk snapshot with fault glusterfs snapshot xml crash libvirtd
Product: Red Hat Enterprise Linux 7 Reporter: Wayne Sun <gsun>
Component: libvirtAssignee: Ján Tomko <jtomko>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: dyuan, jtomko, lhuang, mzhan, rbalakri, shyu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-1.2.8-7.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 07:47:27 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:
Attachments:
Description Flags
libvirtd back trace file none

Description Wayne Sun 2014-11-12 05:47:53 UTC
Created attachment 956560 [details]
libvirtd back trace file

Description of problem:
when do external disk snapshot with fault gluster network snapshot xml, libvirtd crashed.
The fault xml is generated accidentally, with the right one it could succeed. 

Version-Release number of selected component (if applicable):
libvirt-1.2.8-6.el7.x86_64
glusterfs-3.5.2-1.el7.x86_64
qemu-kvm-rhev-2.1.2-6.el7.x86_64
kernel-3.10.0-123.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. prepare a domain with gluster network disk
# virsh dumpxml virt-tests-vm1
...
    <disk type='network' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source protocol='gluster' name='gluster-vol1/rhel7.img'>
        <host name='xx.xx.xx.xx'/>
      </source>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </disk>
...

# virsh list
 Id    Name                           State
----------------------------------------------------
 4     virt-tests-vm1                 running

2. prepare a fault snapshot xml
# cat /tmp/gluster_snap.xml 
<domainsnapshot>
<name>snapshot_test</name>
<description>Snapshot Test</description>
<disks>
<disk name='vda' snapshot='external' type='network'>
<source protocol='gluster' name='gluster-vol1/gluster.qcow2.snap'/>
</disk>
</disks>
</domainsnapshot>

Note:
The <source> element closed without <host/> given

3. do external disk snapshot with the xml
# virsh snapshot-create virt-tests-vm1 /tmp/gluster_snap.xml --disk-only
2014-11-12 05:25:19.353+0000: 14192: info : libvirt version: 1.2.8, package: 6.el7 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2014-11-04-08:28:35, x86-020.build.eng.bos.redhat.com)
2014-11-12 05:25:19.353+0000: 14192: warning : virKeepAliveTimerInternal:143 : No response from client 0x7f9784181dd0 after 6 keepalive messages in 35 seconds
error: internal error: received hangup / error event on socket
2014-11-12 05:25:19.354+0000: 14194: warning : virKeepAliveTimerInternal:143 : No response from client 0x7f9784181dd0 after 6 keepalive messages in 35 seconds
error: Failed to reconnect to the hypervisor


Actual results:
libvirtd crashed

Expected results:
no crash

Additional info:
backtrace in attachment

Comment 2 Ján Tomko 2014-11-12 08:40:00 UTC
Upstream patch:
https://www.redhat.com/archives/libvir-list/2014-November/msg00357.html

Comment 3 Ján Tomko 2014-11-12 08:48:39 UTC
Now pushed:
commit b66288faaba68e22a2876029872ddadf1794bda8
Author:     Ján Tomko <jtomko@redhat.com>
CommitDate: 2014-11-12 09:36:31 +0100

    Do not crash on gluster snapshots with no host name
    
    virStorageFileBackendGlusterInit did not check nhosts.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1162974

git describe: v1.2.10-78-gb66288f

Comment 6 Shanzhi Yu 2014-11-26 06:31:57 UTC
Verify this bug with libvirt-1.2.8-9.el7.x86_64, step as comment 0. libvirtd will not crash again and an error show when try to start guest

# virsh snapshot-create rh7 snap.xml  --disk-only
error: internal error: Expected exactly 1 host for the gluster volume

So, change this bug to verify status

Comment 8 errata-xmlrpc 2015-03-05 07:47:27 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.

https://rhn.redhat.com/errata/RHSA-2015-0323.html