From: Corey Bryant <coreyb@linux.vnet.ibm.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: kwolf@redhat.com, aliguori@us.ibm.com, eblake@redhat.com,
qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH 1/3] qmp/hmp: Add QMP getfd command that returns fd
Date: Wed, 06 Jun 2012 15:42:15 -0400 [thread overview]
Message-ID: <4FCFB297.60203@linux.vnet.ibm.com> (raw)
In-Reply-To: <20120606145034.19f141b7@doriath.home>
On 06/06/2012 01:50 PM, Luiz Capitulino wrote:
> On Wed, 06 Jun 2012 10:04:23 -0400
> Corey Bryant<coreyb@linux.vnet.ibm.com> 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
next prev parent reply other threads:[~2012-06-06 19:43 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-04 13:10 [Qemu-devel] [PATCH 0/3] file descriptor passing using getfd over QMP Corey Bryant
2012-06-04 13:10 ` [Qemu-devel] [PATCH 1/3] qmp/hmp: Add QMP getfd command that returns fd Corey Bryant
2012-06-04 14:45 ` Kevin Wolf
2012-06-04 15:57 ` Corey Bryant
2012-06-05 18:30 ` Luiz Capitulino
2012-06-06 14:04 ` Corey Bryant
2012-06-06 17:50 ` Luiz Capitulino
2012-06-06 19:42 ` Corey Bryant [this message]
2012-06-08 10:46 ` Daniel P. Berrange
2012-06-08 13:17 ` Corey Bryant
2012-06-04 13:10 ` [Qemu-devel] [PATCH 2/3] block: Add support to "open" /dev/fd/X filenames Corey Bryant
2012-06-04 14:32 ` Eric Blake
2012-06-04 15:51 ` Corey Bryant
2012-06-04 16:03 ` Eric Blake
2012-06-04 16:28 ` Corey Bryant
2012-06-04 16:36 ` Eric Blake
2012-06-04 16:40 ` Corey Bryant
2012-06-04 14:54 ` Kevin Wolf
2012-06-04 16:07 ` Corey Bryant
2012-06-04 13:10 ` [Qemu-devel] [PATCH 3/3] Sample server that opens image files for QEMU Corey Bryant
2012-06-04 15:01 ` Kevin Wolf
2012-06-04 16:15 ` Corey Bryant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FCFB297.60203@linux.vnet.ibm.com \
--to=coreyb@linux.vnet.ibm.com \
--cc=aliguori@us.ibm.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).