RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1080471 - libvirtd crashes if VM crashes or is destroyed while hot-attaching disks
Summary: libvirtd crashes if VM crashes or is destroyed while hot-attaching disks
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.2
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 1080884 (view as bug list)
Depends On: 1076719
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-25 13:52 UTC by Jan Kurik
Modified: 2014-04-16 09:51 UTC (History)
13 users (show)

Fixed In Version: libvirt-0.10.2-29.el6_5.7
Doc Type: Bug Fix
Doc Text:
Prior to this update, there was a typographical error in a condition that checks whether QEMU successfully attached a new disk to a guest. Due to the error, the libvirtd daemon terminated unexpectedly if the monitor command was unsuccesful; for instance, in case of a virtual machine failure or when attaching a guest disk drive was interrupted. In this update, the error has been corrected, and libvirtd no longer crashes in the described circumstances.
Clone Of:
Environment:
Last Closed: 2014-04-07 07:26:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
vm log (15.60 KB, text/plain)
2014-03-26 09:58 UTC, chhu
no flags Details
libvirtd log (1.15 MB, text/plain)
2014-03-26 09:59 UTC, chhu
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0375 0 normal SHIPPED_LIVE libvirt bug fix update 2014-04-07 11:24:29 UTC

Description Jan Kurik 2014-03-25 13:52:46 UTC
This bug has been copied from bug #1076719 and has been proposed
to be backported to 6.5 z-stream (EUS).

Comment 6 chhu 2014-03-26 03:48:15 UTC
Try to verify with packages:
libvirt-0.10.2-29.el6_5.6.x86_64
qemu-kvm-rhev-0.12.1.2-2.415.el6_5.6.x86_64


Test steps:
1. Create a guest with glusterfs volume
# virsh create r6-qcow2-gluster.xml 
Domain r6-qcow2 created from r6-qcow2-gluster.xml

# virsh dumpxml r6-qcow2| grep disk -A 5
    <disk type='network' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source protocol='gluster' name='gluster-vol1/rhel6-qcow2-disk.img'>
        <host name='10.66.84.12' port='24007'/>
      </source>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>

2. Try to attach a gluster volume which is not available, the vm exit and get error:"error: Unable to write to monitor: Broken pipe" , no libvirtd crash.

# more disk-gluster-vol.xml 
<disk type='network' device='disk'>
<driver name='qemu' type='qcow2'/>
<source protocol='gluster' name='gluster-vol1/test.img'>
<host name='10.66.106.22' port='24007'/>
</source>
<target dev='vdb' bus='virtio'/>
</disk>

# virsh attach-device r6-qcow2 disk-gluster-vol.xml 
error: Failed to attach device from disk-gluster-vol.xml
error: Unable to write to monitor: Broken pipe

# virsh list --all
 Id    Name                           State
----------------------------------------------------

# service libvirtd status
libvirtd (pid  1292) is running...

3. Redo step1 to create the guest with gluestfs volume.
# virsh create r6-qcow2-gluster.xml 
Domain r6-qcow2 created from r6-qcow2-gluster.xml

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 7     r6-qcow2                       running

4. Try to attach a gluster volume which is not available, press Ctrl+C to interupt the "virsh attach-device". The vm exit, no livirtd crash.

# virsh attach-device r6-qcow2 disk-gluster-vol.xml 
^C

# virsh list --all
 Id    Name                           State
---------------------------------------------------

# service libvirtd status
libvirtd (pid  1292) is running...

Expected Results:
In step2, the vm is not exit, and get error similar to:
error: internal error: unable to execute QEMU command '__com.redhat_drive_add': could not open disk image gluster://10.66.106.22/gluster-vol1/test.img: Could not open 'gluster://10.66.106.22/gluster-vol1/test.img': Transport endpoint is not connected

In step4, the vm is not exit, and can be destroy by user later.

Actual Results:
In step2, the vm is exit and get error:
error: Unable to write to monitor: Broken pipe

In step4, the vm is exit.

Comment 7 Jiri Denemark 2014-03-26 09:57:25 UTC
*** Bug 1080884 has been marked as a duplicate of this bug. ***

Comment 8 chhu 2014-03-26 09:58:01 UTC
Created attachment 878925 [details]
vm log

Comment 9 chhu 2014-03-26 09:59:44 UTC
Created attachment 878928 [details]
libvirtd log

Comment 10 Jiri Denemark 2014-03-26 10:04:47 UTC
It turns out patch happily applied the reproducer from the commit message in addition to the patch itself. We need to respin the build with a new patch modified in a way that prevents the reproducer from being applied. To verify this additional issue, check that there's no "kill(mon->vm->pid, 9);" line in src/qemu/qemu_monitor.c after %prep phase.

Comment 13 chhu 2014-03-27 03:46:20 UTC
Verified with packages:
libvirt-0.10.2-29.el6_5.7.x86_64
qemu-kvm-rhev-0.12.1.2-2.415.el6_5.6.x86_64

Test steps:
1. Create a guest with gluster volume
# virsh create r6-qcow2-gluster.xml
Domain r6-qcow2 created from r6-qcow2-gluster.xml

# virsh dumpxml r6-qcow2| grep disk -A 5
    <disk type='network' device='disk'>
      <driver name='qemu' type='qcow2' cache='none'/>
      <source protocol='gluster' name='gluster-vol1/rhel6-qcow2-disk.img'>
        <host name='10.66.84.12' port='24007'/>
      </source>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>

2. Try to attach a gluster volume which is not available, got the qemu error.
VM is still running, no libvirtd crash.

# more disk-gluster-vol.xml
<disk type='network' device='disk'>
<driver name='qemu' type='qcow2'/>
<source protocol='gluster' name='gluster-vol1/test.img'>
<host name='10.66.106.22' port='24007'/>
</source>
<target dev='vdb' bus='virtio'/>
</disk>

# virsh attach-device r6-qcow2 disk-gluster-vol.xml
error: Failed to attach device from disk-gluster-vol.xml
error: internal error unable to execute QEMU command '__com.redhat_drive_add': Device 'drive-virtio-disk1' could not be initialized

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 2     r6-qcow2                       running

# service libvirtd status
libvirtd (pid  10490) is running...

3. Try to attach a gluster volume which is not available, press Ctrl+C to interupt the "virsh attach-device" process. VM is still running, then destroy the vm successfully, no libvirtd crash.

# virsh attach-device r6-qcow2 disk-gluster-vol.xml
^C
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 2     r6-qcow2                       running

# virsh destroy r6-qcow2
Domain r6-qcow2 destroyed

# virsh list --all
 Id    Name                           State
----------------------------------------------------

# service libvirtd status
libvirtd (pid  10490) is running...

4. Attach/detach another available gluster volume successfully.

# more disk-gluster-vol.xml
<disk type='network' device='disk'>
<driver name='qemu' type='raw'/>
<source protocol='gluster' name='gluster-vol1/exist.img'>
<host name='10.66.84.12' port='24007'/>
</source>
<target dev='vdb' bus='virtio'/>
</disk>

# virsh attach-device r6-qcow2 disk-gluster-vol.xml
Device attached successfully

# virsh detach-device r6-qcow2 disk-gluster-vol.xml
Device detached successfully

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 2     r6-qcow2                       running

# service libvirtd status
libvirtd (pid  10490) is running...

Test results:
current command work well.

Comment 15 errata-xmlrpc 2014-04-07 07:26:07 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/RHBA-2014-0375.html


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