]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
node_device_udev: add error reporting to udevProcessCCWGroup
authorBoris Fiuczynski <fiuczy@linux.ibm.com>
Thu, 6 Feb 2025 16:27:52 +0000 (17:27 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 7 Feb 2025 14:07:23 +0000 (15:07 +0100)
Add reporting an internal error when the string to type conversion of
devtype fails as this indicates a serious problem since devtype was used
to get into this method during the udev event handling.

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

index 7b4ff80f8fb49b1292f5a4c1d7d17fe4ffdc0cc2..344b39e97afd51fe8cad2fdfadf76b6260f9df68 100644 (file)
@@ -1415,8 +1415,12 @@ udevProcessCCWGroup(struct udev_device *device,
 
     udevGenerateDeviceName(device, def, NULL);
 
-    if ((tmp = virNodeDevCCWGroupCapTypeFromString(devtype)) < 0)
+    if ((tmp = virNodeDevCCWGroupCapTypeFromString(devtype)) < 0) {
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("failed to find a supported CCW group capability type '%1$s'"),
+                       devtype);
         return -1;
+    }
 
     data->ccwgroup_dev.type = tmp;