]> xenbits.xensource.com Git - libvirt.git/commit
conf: Fix libvirtd crash matching hostdev XML
authorLuyao Huang <lhuang@redhat.com>
Mon, 15 Dec 2014 03:09:39 +0000 (11:09 +0800)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 15 Dec 2014 12:09:07 +0000 (07:09 -0500)
commit5fc1c51743643a02c0306d6c17fe86e9013ce342
tree70bd1b27eff20060448629bc896be0f3f687f014
parentac1ce2155083d11cd5ce1f4f6bd2e7bbe4ae918d
conf: Fix libvirtd crash matching hostdev XML

https://bugzilla.redhat.com/show_bug.cgi?id=1174053

Introduced by commit id '17bddc46f' - fix a libvirtd crash when
matching a network iscsi hostdev with a host iscsi hostdev.

When we use attach-device to coldplug a network iscsi hostdev,
libvirt will check if there is already a device in XML. But if
the 'b' is a host iscsi hostdev and 'a' is a network iscsi hostdev,
then libvirtd will crash in virDomainHostdevMatchSubsysSCSIiSCSI
because 'b' doesn't have a hostname.

Add a check in virDomainHostdevMatchSubsys, if the a's protocol
and b's protocol is not the same.

Following is the backtrace:

0  0x00007f850d6bc307 in virDomainHostdevMatchSubsysSCSIiSCSI at conf/domain_conf.c:10889
1  virDomainHostdevMatchSubsys at conf/domain_conf.c:10911
2  virDomainHostdevMatch at conf/domain_conf.c:10973
3  virDomainHostdevFind at conf/domain_conf.c:10998
4  0x00007f84f6a10560 in qemuDomainAttachDeviceConfig at qemu/qemu_driver.c:7223
5  qemuDomainAttachDeviceFlags at qemu/qemu_driver.c:7554

Signed-off-by: Luyao Huang <lhuang@redhat.com>
src/conf/domain_conf.c