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

Richard W.M. Jones rjones at redhat.com
Thu Jul 12 08:28:06 UTC 2007


Daniel P. Berrange wrote:
> 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.
> 
> 
> ------------------------------------------------------------------------
> 
> 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);

Yup.

Rich.

-- 
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20070712/c04fdf5b/attachment-0001.bin>


More information about the libvir-list mailing list