From: Cole Robinson <crobinso@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>, Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] hmp: info spice: Show string channel name
Date: Fri, 27 Feb 2015 09:56:18 -0500 [thread overview]
Message-ID: <54F08592.1020204@redhat.com> (raw)
In-Reply-To: <1425022537.20883.9.camel@nilsson.home.kraxel.org>
On 02/27/2015 02:35 AM, Gerd Hoffmann wrote:
> On Do, 2015-02-26 at 13:48 -0700, Eric Blake wrote:
>> On 02/26/2015 12:02 PM, Cole Robinson wrote:
>>> Useful for debugging.
>>>
>>> https://bugzilla.redhat.com/show_bug.cgi?id=822418
>>> Signed-off-by: Cole Robinson <crobinso@redhat.com>
>>> ---
>>> hmp.c | 13 +++++++++++++
>>> 1 file changed, 13 insertions(+)
>>>
>>> diff --git a/hmp.c b/hmp.c
>>> index 735097c..93fd5cd 100644
>>> --- a/hmp.c
>>> +++ b/hmp.c
>>> @@ -545,6 +545,11 @@ void hmp_info_spice(Monitor *mon, const QDict *qdict)
>>> {
>>> SpiceChannelList *chan;
>>> SpiceInfo *info;
>>> + const char *channel_name;
>>> + /* String representations of SPICE_CHANNEL_* enum */
>>> + const char * const channel_names[] = {"main", "display", "input", "cursor",
>>> + "playback", "record", "tunnel", "smartcard", "usbredir", "port",
>>> + "webdav"};
>>>
>>
>> Hmm. I wonder if we should have a QAPI enum for this, instead of
>> open-coding it here. But as this is already a strict improvement,
>
> These numbers are defined by spice not qemu, so a qapi enum isn't going
> to fly here.
>
> Nevertheless it would be great to declare the array using c99 syntax ...
>
> [ SPICE_CHANNEL_foo ] = "foo",
>
> ... to make clear how we are mapping spice enums (or #defines?) to
> strings here.
>
> cheers,
> Gerd
>
>
>
Good idea, I'll send a v2
Thanks,
Cole
prev parent reply other threads:[~2015-02-27 14:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-26 19:02 [Qemu-devel] [PATCH] hmp: info spice: Show string channel name Cole Robinson
2015-02-26 20:48 ` Eric Blake
2015-02-27 7:35 ` Gerd Hoffmann
2015-02-27 14:56 ` Cole Robinson [this message]
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=54F08592.1020204@redhat.com \
--to=crobinso@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=kraxel@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.