From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMadq-0003sK-Lh for qemu-devel@nongnu.org; Fri, 12 Oct 2012 04:30:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMadi-0007wW-Pe for qemu-devel@nongnu.org; Fri, 12 Oct 2012 04:30:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMadi-0007vy-HJ for qemu-devel@nongnu.org; Fri, 12 Oct 2012 04:30:38 -0400 Message-ID: <5077D50A.8000002@redhat.com> Date: Fri, 12 Oct 2012 10:30:02 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1349878805-16352-1-git-send-email-coreyb@linux.vnet.ibm.com> <1349878805-16352-3-git-send-email-coreyb@linux.vnet.ibm.com> <5076AC91.4000109@redhat.com> <5076DFF5.90001@linux.vnet.ibm.com> In-Reply-To: <5076DFF5.90001@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/3] monitor: Enable adding an inherited fd to an fd set List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Corey Bryant Cc: libvir-list@redhat.com, qemu-devel@nongnu.org Am 11.10.2012 17:04, schrieb Corey Bryant: > > > On 10/11/2012 07:25 AM, Kevin Wolf wrote: >> Am 10.10.2012 16:20, schrieb Corey Bryant: >>> qmp_add_fd() gets an fd that was received over a socket with >>> SCM_RIGHTS and adds it to an fd set. This patch adds support >>> that will enable adding an fd that was inherited on the >>> command line to an fd set. >>> >>> This patch also prevents removal of an fd from an fd set during >>> initialization. This allows the fd to remain in the fd set after >>> probing of the image file. >> >> "This patch also..." usually means that it should be split in two >> patches. Though in this case I'd vote for immediately dropping the >> second patch again: This makes the probing work with file descriptors >> using a hack for a certain situation (namely qemu startup) and leaves >> other cases (like hotplug) broken. > > I don't think hotplug is broken. In that case the fd will only be > removed from the fd set if the following is true: > > (mon_fdset_fd->removed || (QLIST_EMPTY(&mon_fdset->dup_fds) && > mon_refcount == 0)) > > We can ignore the removed part for now. What's important here is that > if there are no dup_fd references and there is at least one monitor > connected, an fd will *not* be removed. Ah yes, that's the part I missed. Then your approach of special-casing the command line is probably okay, though I'd still want to change the probing mechanism to avoid the reopen. Seems I need to find a better excuse to make someone do it. Meh. ;-) Kevin