]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
nodedev: prevent internal error on dev_busid parse
authorBoris Fiuczynski <fiuczy@linux.ibm.com>
Mon, 23 May 2022 15:56:21 +0000 (17:56 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 24 May 2022 06:55:45 +0000 (08:55 +0200)
As "none" is a legal value represented in the sysfs attribute dev_busid
this patch prevents libvirt from incorrectly reporting an internal error.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Suggested-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/node_device/node_device_udev.c

index 656130e98a48677457bfb9173b230125b23fb782..44ec22cf75e7dfe034351589d4996bb9b896845f 100644 (file)
@@ -1140,7 +1140,7 @@ udevProcessCSS(struct udev_device *device,
     /* process optional channel devices information */
     udevGetStringSysfsAttr(device, "dev_busid", &dev_busid);
 
-    if (dev_busid != NULL)
+    if (dev_busid != NULL && STRNEQ(dev_busid, "none"))
         def->caps->data.ccw_dev.channel_dev_addr = virCCWDeviceAddressFromString(dev_busid);
 
     if (virNodeDeviceGetCSSDynamicCaps(def->sysfs_path, &def->caps->data.ccw_dev) < 0)