Bug 1003526

Summary: Disk Hotplug will lead libvirtd crash
Product: Red Hat Enterprise Linux 7 Reporter: Shanzhi Yu <shyu>
Component: libvirtAssignee: Ján Tomko <jtomko>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: acathrow, chhu, cwei, dyuan, jtomko, lsu, mzhan, ydu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.1.1-4.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 09:20:37 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:
Embargoed:
Attachments:
Description Flags
gdb backtrace none

Description Shanzhi Yu 2013-09-02 09:17:59 UTC
Description of problem:

Disk Hotplug will lead libvirtd crash

Version-Release number of selected component (if applicable):

libvirt-1.1.1-3.el7.x86_64
qemu-kvm-1.5.2-3.el7.x86_64

How reproducible:

100%

Steps to Reproduce:
1. start an guest
# virsh start demo
2. create an image and make ext3 fs on it
# qemu-img create /var/lib/libvirt/images/test.img 1G 
# mkfs.ext3 /var/lib/libvirt/images/test.img
3. attach disk to guest
# virsh attach-disk demo /var/lib/libvirt/images/test.img vdb --mode readonly --sourcetype file

Actual results:

error: Failed to attach disk
error: End of file while reading data: Input/output error
error: One or more references were leaked after disconnect from the hypervisor
error: Failed to reconnect to the hypervisor

Expected results:

succeed

Additional info:

attach fc/nfs/iscsi disk will also lead libvirtd crash

Comment 1 Shanzhi Yu 2013-09-02 09:20:31 UTC
Created attachment 792777 [details]
gdb backtrace

Comment 3 Shanzhi Yu 2013-09-02 09:32:13 UTC
(In reply to Shanzhi Yu from comment #0)
> Description of problem:
> 
> Disk Hotplug will lead libvirtd crash
> 
> Version-Release number of selected component (if applicable):
> 
> libvirt-1.1.1-3.el7.x86_64
> qemu-kvm-1.5.2-3.el7.x86_64
> 
> How reproducible:
> 
> 100%
> 
> Steps to Reproduce:
> 1. start an guest
> # virsh start demo
> 2. create an image and make ext3 fs on it
> # qemu-img create /var/lib/libvirt/images/test.img 1G 
> # mkfs.ext3 /var/lib/libvirt/images/test.img
> 3. attach disk to guest
> # virsh attach-disk demo /var/lib/libvirt/images/test.img vdb --mode
> readonly --sourcetype file
> 
> Actual results:
> 
> error: Failed to attach disk
> error: End of file while reading data: Input/output error
> error: One or more references were leaked after disconnect from the
> hypervisor
> error: Failed to reconnect to the hypervisor
> 
> Expected results:
> 
> succeed
> 
> Additional info:
> 
> attach fc/nfs/iscsi disk will also lead libvirtd crash

"virsh attach-disk demo /var/lib/libvirt/images/test.img vdb" can lead libvirtd crash, other options is not necessary

Comment 5 Ján Tomko 2013-09-02 10:09:10 UTC
Fixed upstream by:
commit bb97db2fb4315b7a7eb4403570d54c93992117de
Author:     Guido Günther <agx>
AuthorDate: 2013-08-10 09:19:30 +0200
Commit:     Guido Günther <agx>
CommitDate: 2013-08-12 19:31:18 +0200

    Don't crash in qemuBuildDeviceAddressStr

Downstream patch posted:
http://post-office.corp.redhat.com/archives/rhvirt-patches/2013-September/msg00003.html

Comment 6 chhu 2013-09-09 05:34:57 UTC
Reproduced with libvirt-1.1.1-3.el7.x86_64, qemu-kvm-1.5.2-3.el7.x86_64.

Verified with the packages:
libvirt-1.1.1-4.el7.x86_64
qemu-kvm-1.5.3-2.el7.x86_64

Test steps:
1. start an guest
# virsh define rh7-qcow2.xml 
Domain rh7-qcow2 defined from rh7-qcow2.xml

2. create an image and make ext3 fs on it
# qemu-img create /var/lib/libvirt/images/test.img 1G 
# mkfs.ext3 /var/lib/libvirt/images/test.img

3. attach disk to guest
# virsh attach-disk rh7-qcow2 /var/lib/libvirt/images/test.img vdb --mode readonly --sourcetype file
Disk attached successfully

Test results:
current command work well, move to verified.

Comment 7 Ludek Smid 2014-06-13 09:20:37 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.