render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
2cf05b
From 7c60078d7a6442dc8cb5a711876d28f70d892bff Mon Sep 17 00:00:00 2001
2cf05b
Message-Id: <7c60078d7a6442dc8cb5a711876d28f70d892bff@dist-git>
2cf05b
From: Boris Fiuczynski <fiuczy@linux.ibm.com>
2cf05b
Date: Mon, 23 May 2022 17:56:21 +0200
2cf05b
Subject: [PATCH] nodedev: prevent internal error on dev_busid parse
2cf05b
2cf05b
As "none" is a legal value represented in the sysfs attribute dev_busid
2cf05b
this patch prevents libvirt from incorrectly reporting an internal error.
2cf05b
2cf05b
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2cf05b
Suggested-by: Michal Privoznik <mprivozn@redhat.com>
2cf05b
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2cf05b
(cherry picked from commit e37c39747be0792d03c450e56ddb3c78d08cbf3e)
2cf05b
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2165011
2cf05b
Signed-off-by: Thomas Huth <thuth@redhat.com>
2cf05b
---
2cf05b
 src/node_device/node_device_udev.c | 2 +-
2cf05b
 1 file changed, 1 insertion(+), 1 deletion(-)
2cf05b
2cf05b
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
2cf05b
index 611a2592ca..b76e3de681 100644
2cf05b
--- a/src/node_device/node_device_udev.c
2cf05b
+++ b/src/node_device/node_device_udev.c
2cf05b
@@ -1144,7 +1144,7 @@ udevProcessCSS(struct udev_device *device,
2cf05b
     /* process optional channel devices information */
2cf05b
     udevGetStringSysfsAttr(device, "dev_busid", &dev_busid);
2cf05b
 
2cf05b
-    if (dev_busid != NULL)
2cf05b
+    if (dev_busid != NULL && STRNEQ(dev_busid, "none"))
2cf05b
         def->caps->data.ccw_dev.channel_dev_addr = virCCWDeviceAddressFromString(dev_busid);
2cf05b
 
2cf05b
     if (virNodeDeviceGetCSSDynamicCaps(def->sysfs_path, &def->caps->data.ccw_dev) < 0)
2cf05b
-- 
2cf05b
2.39.1
2cf05b