From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Scz46-0004O0-3l for qemu-devel@nongnu.org; Fri, 08 Jun 2012 09:17:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Scz44-0006Wn-9X for qemu-devel@nongnu.org; Fri, 08 Jun 2012 09:17:21 -0400 Received: from e9.ny.us.ibm.com ([32.97.182.139]:52075) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Scz44-0006WM-5c for qemu-devel@nongnu.org; Fri, 08 Jun 2012 09:17:20 -0400 Received: from /spool/local by e9.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 8 Jun 2012 09:17:16 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 14C1038C801C for ; Fri, 8 Jun 2012 09:17:15 -0400 (EDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q58DHE3U159680 for ; Fri, 8 Jun 2012 09:17:14 -0400 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q58DHCEV026081 for ; Fri, 8 Jun 2012 07:17:13 -0600 Message-ID: <4FD1FB55.1030906@linux.vnet.ibm.com> Date: Fri, 08 Jun 2012 09:17:09 -0400 From: Corey Bryant MIME-Version: 1.0 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> <20120608104648.GC2289@redhat.com> In-Reply-To: <20120608104648.GC2289@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] qmp/hmp: Add QMP getfd command that returns fd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, qemu-devel@nongnu.org, Luiz Capitulino , eblake@redhat.com On 06/08/2012 06:46 AM, Daniel P. Berrange wrote: > 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. I agree, thanks for the suggestion. I know Luiz suggested detailed command names, and I think this will be ok and self documents itself fairly well with the compact 'passfd'. I have v2 patches that are just about ready, so I'll update them to use 'passfd'. -- Regards, Corey