]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Ensure client streams are closed when marking a client for close
authorDaniel P. Berrange <berrange@redhat.com>
Sun, 14 Aug 2011 22:44:45 +0000 (15:44 -0700)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 16 Aug 2011 21:38:11 +0000 (14:38 -0700)
commitf682c2530869b6f7c290537a68808e536c6a72c7
treeb465bbebc34e4bb89f7c907126ea827125ca8aba
parent3cf37700cd44c748fd72a3cd5e392e948f0bb4b1
Ensure client streams are closed when marking a client for close

Every active stream results in a reference being held on the
virNetServerClientPtr object. This meant that if a client quit
with any streams active, although all I/O was stopped the
virNetServerClientPtr object would leak. This causes libvirtd
to leak any file handles associated with open streams when a
client quit

To fix this, when we call virNetServerClientClose there is a
callback invoked which lets the daemon release the streams
and thus the extra references

* daemon/remote.c: Add a hook to close all streams
* daemon/stream.c, daemon/stream.h: Add API for releasing
  all streams
* src/rpc/virnetserverclient.c, src/rpc/virnetserverclient.h:
  Allow registration of a hook to trigger when closing client
daemon/remote.c
daemon/stream.c
daemon/stream.h
src/rpc/virnetserverclient.c
src/rpc/virnetserverclient.h