[libvirt] [Qemu-devel] [PATCH v6 3/6] monitor: Clean up fd sets on monitor disconnect

Stefan Hajnoczi stefanha at gmail.com
Tue Aug 7 17:32:07 UTC 2012


On Fri, Aug 03, 2012 at 01:28:06PM -0400, Corey Bryant wrote:
> Each fd set has a boolean that keeps track of whether or not the
> fd set is in use by a monitor connection.  When a monitor
> disconnects, all fds that are members of an fd set with refcount
> of zero are closed.  This prevents any fd leakage associated with
> a client disconnect prior to using a passed fd.
> 
> v5:
>  -This patch is new in v5.
>  -This support addresses concerns from v4 regarding fd leakage
>   if the client disconnects unexpectedly. (eblake at redhat.com,
>   kwolf at redhat.com, dberrange at redhat.com)
> 
> v6:
>  -No changes
> 
> Signed-off-by: Corey Bryant <coreyb at linux.vnet.ibm.com>
> ---
>  monitor.c |   15 +++++++++++++++
>  1 file changed, 15 insertions(+)

The lifecycle of fdsets and fds isn't clear to me.  It seems like just a
refcount in fdset should handle this without extra fields like in_use.

Stefan




More information about the libvir-list mailing list