From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sz5ui-0002Hy-P4 for qemu-devel@nongnu.org; Wed, 08 Aug 2012 09:03:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sz5uc-0006Fp-PT for qemu-devel@nongnu.org; Wed, 08 Aug 2012 09:03:04 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:46706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sz5uc-0006F3-HM for qemu-devel@nongnu.org; Wed, 08 Aug 2012 09:02:58 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 8 Aug 2012 14:02:56 +0100 Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q78D2mcO8454166 for ; Wed, 8 Aug 2012 13:02:48 GMT Received: from d06av09.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q78D2rUP017461 for ; Wed, 8 Aug 2012 07:02:54 -0600 Date: Wed, 8 Aug 2012 14:02:52 +0100 From: Stefan Hajnoczi Message-ID: <20120808130252.GA6532@stefanha-thinkpad.localdomain> References: <1344355108-14786-1-git-send-email-coreyb@linux.vnet.ibm.com> <1344355108-14786-7-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: <1344355108-14786-7-git-send-email-coreyb@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v7 6/6] block: Enable qemu_open/close to work with fd sets List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corey Bryant Cc: kwolf@redhat.com, aliguori@us.ibm.com, libvir-list@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, eblake@redhat.com On Tue, Aug 07, 2012 at 11:58:28AM -0400, Corey Bryant wrote: > @@ -2566,6 +2567,92 @@ FdsetInfoList *qmp_query_fdsets(Error **errp) > return fdset_list; > } > > +int monitor_fdset_get_fd(int64_t fdset_id, int flags) > +{ > + mon_fdset_t *mon_fdset; > + mon_fdset_fd_t *mon_fdset_fd; > + int mon_fd_flags; > + > + QLIST_FOREACH(mon_fdset, &mon_fdsets, next) { > + if (mon_fdset->id != fdset_id) { > + continue; > + } > + QLIST_FOREACH(mon_fdset_fd, &mon_fdset->fds, next) { > + if (mon_fdset_fd->removed) { > + continue; > + } This makes me wonder about immediately closing in remove-fd and drop the removed field. This way, code using mon_fdset->fds does not need to worry about removed=true fds.