• D
    Ensure client streams are closed when marking a client for close · f682c253
    Daniel P. Berrange 提交于
    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
    f682c253
stream.c 21.0 KB