[PATCH 8/9] virt-admin: Register async IO event polling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In order to be able to react to upcoming daemon events (disconnect, keepalive,
...), we need to register asynchronous polling so that our event loop can
detect events on a file descriptor.
---
 src/libvirt-admin.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/libvirt-admin.c b/src/libvirt-admin.c
index 252fdbe..3d74d5f 100644
--- a/src/libvirt-admin.c
+++ b/src/libvirt-admin.c
@@ -160,6 +160,12 @@ remoteAdminConnectOpen(virAdmConnectPtr conn, unsigned int flags)
 
     args.flags = flags;
 
+    if (virNetClientRegisterAsyncIO(priv->client) < 0) {
+        VIR_DEBUG("Failed to add event watch, disabling events and support for"
+                  " keepalive messages");
+        virResetLastError();
+    }
+
     virObjectRef(conn->closeCallback);
     virNetClientSetCloseCallback(priv->client, remoteAdminClientCloseFunc,
                                  conn->closeCallback,
-- 
2.4.3

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]