From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfA6Q-0000ZE-GY for qemu-devel@nongnu.org; Thu, 14 Jun 2012 09:28:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfA6O-000361-A3 for qemu-devel@nongnu.org; Thu, 14 Jun 2012 09:28:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfA6O-00035C-1p for qemu-devel@nongnu.org; Thu, 14 Jun 2012 09:28:44 -0400 Date: Thu, 14 Jun 2012 10:28:51 -0300 From: Luiz Capitulino Message-ID: <20120614102851.1d64b684@doriath.home> In-Reply-To: <4FD90F2F.5070401@linux.vnet.ibm.com> References: <1339170179-2554-1-git-send-email-coreyb@linux.vnet.ibm.com> <1339170179-2554-3-git-send-email-coreyb@linux.vnet.ibm.com> <20120613164649.04b13706@doriath.home> <4FD8F734.7030301@linux.vnet.ibm.com> <4FD8FC61.1080204@redhat.com> <4FD90F2F.5070401@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/4] qapi: Add passfd QMP command 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, Eric Blake On Wed, 13 Jun 2012 18:07:43 -0400 Corey Bryant wrote: > > > On 06/13/2012 04:47 PM, Eric Blake wrote: > > On 06/13/2012 02:25 PM, Corey Bryant wrote: > > > >>> Also, getfd automatically closes a fd if an existing fdname is passed > >>> again. > >>> I don't think this is a good behavior, I think pass-fd should fail > >>> instead > >>> (note that we can't fix getfd though). > >>> > >> > >> I agree. It makes sense to fail rather than blindly closing the > >> existing fd. It can be closed explicitly with closefd if the user wants > >> it closed. > > > > Hmm - what happens if I do 'pass-fd name', learn that qemu is using fd > > 42, then do 'getfd name'? I silently wipe out fd 42 and replace it with > > the new fd passed in by getfd. Which means my use of /dev/fd/42 will > > now be broken. > > > > Obviously that means that 'getfd' should NOT be used by any application > > using 'pass-fd', and that libvirt should NOT be reusing names (I think > > the latter is already true). But I agree that for back-compat we can't > > get rid of the current (evil) semantics of a duplicated 'getfd'. > > Yes, users need to be careful and understand how the commands work. I > don't think it's a hard rule that 'getfd' can't be used by an > application that uses 'pass-fd'. If it were, we could put the fds on > separate lists: > > struct Monitor { > ... > QLIST_HEAD(,mon_fd_t) fds; > + QLIST_HEAD(,mon_fd_t) pass_fds; > }; We'd a different closefd command if we do this. > But I don't think this is necessary, so I'll plan on documenting them well. Agreed, I don't think this is necessary.