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 <mhart...@linux.ibm.com>
---
 src/node_device/node_device_udev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/node_device/node_device_udev.c 
b/src/node_device/node_device_udev.c
index 54f372cd4a9f..4dd2e9004fd7 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1802,6 +1802,8 @@ nodeStateInitializeEnumerate(void *opaque)
 
  error:
     virObjectLock(priv);
+    ignore_value(virEventRemoveHandle(priv->watch));
+    priv->watch = -1;
     priv->threadQuit = true;
     virObjectUnlock(priv);
 }
-- 
2.17.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to