]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Add an explicit virNetClientClose method
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 19 Jul 2011 13:13:32 +0000 (14:13 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 19 Jul 2011 15:20:34 +0000 (11:20 -0400)
commite06c8ede42fcdc4e29b58e49a4b3f93b2a2c5740
treed21c558acae247d5559792bd5e6da198a1f28ff1
parent7ea2ef4ce82be9574b4e1fb2a90f2f2c8dc84172
Add an explicit virNetClientClose method

Since the I/O callback registered against virNetSocket will
hold a reference on the virNetClient, we can't rely on the
virNetClientFree to be able to close the network connection.
The last reference will only go away when the event callback
fires (likely due to EOF from the server).

This is sub-optimal and can potentially cause a leak of the
virNetClient object if the server were to not explicitly
close the socket itself

* src/remote/remote_driver.c: Explicitly close the client
  object when disconnecting
* src/rpc/virnetclient.c, src/rpc/virnetclient.h: Add a
  virNetClientClose method
src/remote/remote_driver.c
src/rpc/virnetclient.c
src/rpc/virnetclient.h