From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScM8H-0004pN-ND for qemu-devel@nongnu.org; Wed, 06 Jun 2012 15:43:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ScM8C-0003vd-V4 for qemu-devel@nongnu.org; Wed, 06 Jun 2012 15:43:05 -0400 Received: from e5.ny.us.ibm.com ([32.97.182.145]:59990) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScM8C-0003v2-Qq for qemu-devel@nongnu.org; Wed, 06 Jun 2012 15:43:00 -0400 Received: from /spool/local by e5.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Jun 2012 15:42:56 -0400 Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id 0F34A6E806A for ; Wed, 6 Jun 2012 15:42:18 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q56JgH9L152510 for ; Wed, 6 Jun 2012 15:42:17 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q56JgHST004334 for ; Wed, 6 Jun 2012 16:42:17 -0300 Message-ID: <4FCFB297.60203@linux.vnet.ibm.com> Date: Wed, 06 Jun 2012 15:42:15 -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> <20120606145034.19f141b7@doriath.home> In-Reply-To: <20120606145034.19f141b7@doriath.home> Content-Type: text/plain; charset=ISO-8859-1; 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: Luiz Capitulino Cc: kwolf@redhat.com, aliguori@us.ibm.com, eblake@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com On 06/06/2012 01:50 PM, Luiz Capitulino wrote: > On Wed, 06 Jun 2012 10:04:23 -0400 > Corey Bryant wrote: > >>> 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. > > We're going for more descriptive names in QMP. I don't have strong objections > against get-fd2 if there's consensus that 'fd' is better than 'file-descriptor', > although 'fd2' is a bit confusing. I really don't have a strong opinion either so I'll do whatever the consensus wants. Does anyone else have an opinion? > >> 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. > > You mean using the same array for getfd and get-file-descriptor? Yes, the > descriptor list is global. > Yes, that's what I meant. >> I assume this approach would still return an int: { "return": 42 } > > The new command? Yes. > Ok >>> 2. Return a type instead, like: >>> >>> { "return": { "file-descriptor": 42 } } >>> >>> I think I prefer item 1, as we could also take the opportunity to fix the >>> argument type and improve its name. Besides, we don't have a schema to do 2. >> >> Is it fdname that you think could be improved? fdname seems pretty >> straight forward to me. > > What I'm trying to avoid is having too short names when that's not necessary. > I think I'd just use 'name' or 'file-descriptor-name' for the verbose option, > but I don't have strong objections against 'fdname'. > Unless anyone objects I'll plan on going with more descriptive names, since that is the desired direction for QMP. So we'll have get-file-descriptor for the new command name and file-descriptor-name for the argument name. -- Regards, Corey