From: Gerd Hoffmann <kraxel@redhat.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [RfC PATCH] spice: qmp windup: connection events & info command.
Date: Thu, 25 Nov 2010 12:42:52 +0100 [thread overview]
Message-ID: <4CEE4BBC.5050204@redhat.com> (raw)
In-Reply-To: <20101112135834.63129825@doriath>
Hi,
> The first thing we have to check with Daniel is whether or not we're
> providing the info they would need/expect,
Daniel?
> apart from that I have the
> following general comments:
>
> 1. It's missing documentation in QMP/qmp-events.txt and qmp-commands.hx
> (yeah, docs are far from code, hope to fix soon)
Ok.
> 2. Can you please split this in two patches? One adding the events and
> the other adding the query command
Doesn't make that much sense IMHO as the both provide quite simliar
informations (i.e. "info spice" gives you a list of connections with
pretty much the same info provided by the events).
>> +/*
>> + * generic print handler for hmp 'info $what'
>> + * simply pretty-print the josn representation
>> + */
>> +#if defined(CONFIG_SPICE) /* because 'info spice' is the only user */
>> +static void do_info_generic_print(Monitor *mon, const QObject *data)
>> +{
>> + QString *json = qobject_to_json_pretty(data);
>> + monitor_printf(mon, "%s\n", qstring_get_str(json));
>> + QDECREF(json);
>> +}
>> +#endif
>
> We definitely need a generic print handler, but I don't that stringifying
> JSON makes a minimal good user interface.
Well, this is the pretty json version which prints stuff multi-line and
with intention. Certainly not perfect but reasonable readable with
minimum effort. We can replace it with something else when it shows up.
>> +static QList *channel_list_get(void)
>> +{
>> + ChannelList *item;
>> + QList *list;
>> + QDict *dict;
>> +
>> + list = qlist_new();
>> + QTAILQ_FOREACH(item,&channel_list, link) {
>> + dict = qdict_new();
>> + add_addr_info(dict,&item->info->paddr, item->info->plen);
>> + add_channel_info(dict, item->info);
>> + qlist_append_obj(list, QOBJECT(dict));
>
> You can use qlist_append() and drop the QOBJECT() usage.
>
Ok.
cheers,
Gerd
next prev parent reply other threads:[~2010-11-25 11:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-11 12:49 [Qemu-devel] [RfC PATCH] spice: qmp windup: connection events & info command Gerd Hoffmann
2010-11-12 15:58 ` [Qemu-devel] " Luiz Capitulino
2010-11-25 11:42 ` Gerd Hoffmann [this message]
2010-11-25 13:57 ` Luiz Capitulino
[not found] ` <20101129100320.GA2528@redhat.com>
2010-11-29 11:02 ` Gerd Hoffmann
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=4CEE4BBC.5050204@redhat.com \
--to=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.