]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
udev: nodeStateInitializeEnumerate: remove watch handle in case of an error
authorMarc Hartmayer <mhartmay@linux.ibm.com>
Wed, 20 Feb 2019 10:05:45 +0000 (11:05 +0100)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 20 Feb 2019 19:07:42 +0000 (14:07 -0500)
If the udev thread is stopped, it must be ensured that the watch
handle is also removed from the main loop.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/node_device/node_device_udev.c

index 54f372cd4a9f4d3e9c7d4a1ffff33031ab341b4a..4dd2e9004fd78d0e938524a092dd8d1edd6b5ec1 100644 (file)
@@ -1802,6 +1802,8 @@ nodeStateInitializeEnumerate(void *opaque)
 
  error:
     virObjectLock(priv);
+    ignore_value(virEventRemoveHandle(priv->watch));
+    priv->watch = -1;
     priv->threadQuit = true;
     virObjectUnlock(priv);
 }