From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Scwid-00070h-JH for qemu-devel@nongnu.org; Fri, 08 Jun 2012 06:47:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ScwiX-00083H-1b for qemu-devel@nongnu.org; Fri, 08 Jun 2012 06:47:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScwiW-00082y-Pp for qemu-devel@nongnu.org; Fri, 08 Jun 2012 06:46:56 -0400 Date: Fri, 8 Jun 2012 11:46:48 +0100 From: "Daniel P. Berrange" Message-ID: <20120608104648.GC2289@redhat.com> References: <1338815410-24890-1-git-send-email-coreyb@linux.vnet.ibm.com> <1338815410-24890-2-git-send-email-coreyb@linux.vnet.ibm.com> <20120605153058.01083bfd@doriath.home> <4FCF6367.8020409@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4FCF6367.8020409@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH 1/3] qmp/hmp: Add QMP getfd command that returns fd Reply-To: "Daniel P. Berrange" 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, qemu-devel@nongnu.org, Luiz Capitulino , eblake@redhat.com On Wed, Jun 06, 2012 at 10:04:23AM -0400, Corey Bryant wrote: > > > On 06/05/2012 02:30 PM, Luiz Capitulino wrote: > >On Mon, 4 Jun 2012 09:10:08 -0400 > >Corey Bryant wrote: > > > >>This patch adds QMP support for the getfd command using the QAPI framework. > >>Like the HMP getfd command, it is used to pass a file descriptor via > >>SCM_RIGHTS. However, the QMP getfd command also returns the received file > >>descriptor, which is a difference in behavior from the HMP getfd command, > >>which returns nothing. > > > >I have a few comments regarding the qapi conversion below, but something > >important to discuss is that returning an int the way you're doing it is > >certainly incompatible. > > Thanks for your feedback. > > > > >Today, we return a dict on success: > > > > { "return": {} } > > > >But this patch changes it to: > > > > { "return": 42 } > > > >There are two ways to do this without breaking compatibility: > > > > 1. Add a new command (say get-file-descriptor) > > What do you think about using getfd2 for the command name? I'm > thinking getfd2 may be more obvious that it corresponds to closefd. > That assumes we'll use the same array internally to store fds and > closefd can be used to close the fd opened by > get-file-descriptor/getfd2. How about calling it 'passfd' instead ? I have always thought the name 'getfd' to be a little wierd really, since we're not getting an FD from QEMU, we're passing it one that we have. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|