[Libvir] PATCH: Force close of virConnectPtr if client quits abnormally

Daniel P. Berrange berrange at redhat.com
Wed Jul 11 23:39:48 UTC 2007


If a remote client quits abnormally (or if the server forcably drops a
client for misbehaviing), it is possible that the virConnectPtr object
is not closed. This leads to a build up of active connections in the
server. The attached patch simply calls virConnectClose when killing off
a client connection if there is a non-NULL client->conn object.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
-------------- next part --------------
diff -u -p -r1.52 qemud.c
--- qemud/qemud.c	26 Jun 2007 23:48:47 -0000	1.52
+++ qemud/qemud.c	11 Jul 2007 23:37:10 -0000
@@ -1023,6 +1036,9 @@ static void qemudDispatchClientFailure(s
 
     virEventRemoveHandleImpl(client->fd);
 
+    if (client->conn)
+        virConnectClose(client->conn);
+
     if (client->tls && client->session) gnutls_deinit (client->session);
     close(client->fd);
     free(client);


More information about the libvir-list mailing list