diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 0944b41d76392ed120fcc6559919e7631d7a3f3b..a0e425d515cd8b3adc9f38e69b11ab544e737bb6 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1611,10 +1611,20 @@ udevEventHandleCallback(int watch ATTRIBUTE_UNUSED, udev_fd = udev_monitor_get_fd(udev_monitor); if (fd != udev_fd) { + udevPrivate *priv = driver->privateData; + virReportError(VIR_ERR_INTERNAL_ERROR, _("File descriptor returned by udev %d does not " "match node device file descriptor %d"), fd, udev_fd); + + /* this is a non-recoverable error, let's remove the handle, so that we + * don't get in here again because of some spurious behaviour and report + * the same error multiple times + */ + virEventRemoveHandle(priv->watch); + priv->watch = -1; + goto cleanup; }