1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 06:50:22 +03:00

node_device_udev: add error reporting to udevProcessCCWGroup

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>
This commit is contained in:
Boris Fiuczynski 2025-02-06 17:27:52 +01:00 committed by Michal Privoznik
parent 5830e564bb
commit af732d27cc

View 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;