From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59215) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SyoQu-00022y-Cj for qemu-devel@nongnu.org; Tue, 07 Aug 2012 14:23:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SyoQt-0002e3-GX for qemu-devel@nongnu.org; Tue, 07 Aug 2012 14:23:08 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:46925) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SyoQt-0002dt-9e for qemu-devel@nongnu.org; Tue, 07 Aug 2012 14:23:07 -0400 Received: by wibhm2 with SMTP id hm2so2318817wib.10 for ; Tue, 07 Aug 2012 11:23:06 -0700 (PDT) Date: Tue, 7 Aug 2012 18:32:07 +0100 From: Stefan Hajnoczi Message-ID: <20120807173207.GA11051@stefanha-thinkpad.localdomain> References: <1344014889-12390-1-git-send-email-coreyb@linux.vnet.ibm.com> <1344014889-12390-4-git-send-email-coreyb@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1344014889-12390-4-git-send-email-coreyb@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v6 3/6] monitor: Clean up fd sets on monitor disconnect List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corey Bryant Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, libvir-list@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, eblake@redhat.com 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@redhat.com, > kwolf@redhat.com, dberrange@redhat.com) > > v6: > -No changes > > Signed-off-by: Corey Bryant > --- > 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