[PATCH 01/11] nodedev: Fix crash in libvirtd on vHBA creation path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Providing XML such as:

<device>
  <name>vhba</name>
  <capability type='scsi_host'>
    <capability type='fc_host'>
    </capability>
  </capability>
</device>

would crash libvirt because the '<parent>' isn't a required field, but
for vHBA creation it's expected (day 1 issue - see commit id '81d0ffbc').
The nodedev.rng added in commit id '2c22a68c' has this as an optional field.
NB: On normal udev discovery if a parent field wasn't found, it would be
set to "computer" by udevSetParent, so this is a somewhat unique path.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/conf/node_device_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 1cd0baf..bf5b22f 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -118,7 +118,7 @@ virNodeDeviceObjPtr virNodeDeviceFindByName(virNodeDeviceObjListPtr devs,
 
     for (i = 0; i < devs->count; i++) {
         virNodeDeviceObjLock(devs->objs[i]);
-        if (STREQ(devs->objs[i]->def->name, name))
+        if (STREQ_NULLABLE(devs->objs[i]->def->name, name))
             return devs->objs[i];
         virNodeDeviceObjUnlock(devs->objs[i]);
     }
-- 
2.7.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux