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(a)linux.ibm.com>
---
src/node_device/node_device_udev.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 7b4ff80f8f..344b39e97a 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -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;
--
2.47.0