From: Gerd Hoffmann <kraxel@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>,
qemu-devel@nongnu.org, Cole Robinson <crobinso@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] hmp: info spice: Show string channel name
Date: Fri, 27 Feb 2015 08:35:37 +0100 [thread overview]
Message-ID: <1425022537.20883.9.camel@nilsson.home.kraxel.org> (raw)
In-Reply-To: <54EF8696.4000706@redhat.com>
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
next prev parent reply other threads:[~2015-02-27 7:35 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 [this message]
2015-02-27 14:56 ` Cole Robinson
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=1425022537.20883.9.camel@nilsson.home.kraxel.org \
--to=kraxel@redhat.com \
--cc=armbru@redhat.com \
--cc=crobinso@redhat.com \
--cc=eblake@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 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).