From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMJnm-000149-2t for qemu-devel@nongnu.org; Thu, 11 Oct 2012 10:31:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMJnj-0006gJ-Lf for qemu-devel@nongnu.org; Thu, 11 Oct 2012 10:31:54 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:43586) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMJnj-0006ZH-F6 for qemu-devel@nongnu.org; Thu, 11 Oct 2012 10:31:51 -0400 Received: from /spool/local by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 11 Oct 2012 08:31:26 -0600 Received: from d03relay05.boulder.ibm.com (d03relay05.boulder.ibm.com [9.17.195.107]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 4476F19D803C for ; Thu, 11 Oct 2012 08:30:56 -0600 (MDT) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q9BEUdH2246860 for ; Thu, 11 Oct 2012 08:30:43 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q9BEUACJ014328 for ; Thu, 11 Oct 2012 08:30:11 -0600 Message-ID: <5076D7EF.6040402@linux.vnet.ibm.com> Date: Thu, 11 Oct 2012 10:30:07 -0400 From: Corey Bryant 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> <5075F042.4070505@redhat.com> In-Reply-To: <5075F042.4070505@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed 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: Eric Blake Cc: kwolf@redhat.com, libvir-list@redhat.com, qemu-devel@nongnu.org On 10/10/2012 06:01 PM, Eric Blake wrote: > On 10/10/2012 08:20 AM, Corey Bryant wrote: >> 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. > > You're mixing code motion and semantic change in one patch (keyword > "also" in your commit message; should the semantic change be moved to a > separate patch (possibly squashed into 1/3)? > It should probably be another patch. I'll look into this for v3. >> >> Signed-off-by: Corey Bryant >> --- > >> >> - if (has_fdset_id) { >> - QLIST_FOREACH(mon_fdset, &mon_fdsets, next) { >> - if (mon_fdset->id == fdset_id) { >> - break; >> - } >> - } >> - } > > Since you maintain mon_fdsets in sorted id order, should you optimize > this loop to abort the QLIST_FOREACH early if fdset_id is less than > mon_fdset->id? [I only noticed this because of code motion, so it is a > pre-existing condition and therefore a separate patch, or another thing > to squash into 1/3] > Sure that makes sense to optimize this. -- Regards, Corey Bryant