From: Gerd Hoffmann <kraxel@redhat.com>
To: spice-devel@freedesktop.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] spice_info: add mouse_mode
Date: Mon, 26 Mar 2012 15:46:27 +0200 [thread overview]
Message-ID: <4F707333.7070804@redhat.com> (raw)
In-Reply-To: <20120326133049.GD32389@garlic>
On 03/26/12 15:30, Alon Levy wrote:
> On Mon, Mar 26, 2012 at 03:06:22PM +0200, Gerd Hoffmann wrote:
>>> +#if SPICE_SERVER_VERSION >= 0x000a03 /* 0.10.3 */
>>> + info->has_mouse_mode = true;
>>> + info->mouse_mode = g_strdup(spice_server_is_server_mouse(spice_server) ?
>>> + "server" : "client");
>>
>> #else
>> info->mouse_mode = "unknown";
>> #endif
>
> Why?
has_mouse_mode looks superfluous and makes the code a bit more
complicated than needed.
> I don't set has_mouse_mode in this case, which defaults to 0 ==
> false because of the malloc0, and then I check has_mouse_mode in the hmp
> command, and the qmp just won't send the field because has == false.
Ah, ok, didn't see qmp does something different, then I'd suggest to
just leave mouse_mode zero-initialized (aka NULL) when mouse mode info
isn't available.
cheers,
Gerd
next prev parent reply other threads:[~2012-03-26 13:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-26 12:47 [Qemu-devel] [PATCH qemu+spice] expose server mouse status Alon Levy
2012-03-26 12:47 ` [Qemu-devel] [PATCH] server: export spice_server_is_server_mouse predicate Alon Levy
2012-03-26 12:47 ` [Qemu-devel] [PATCH] spice_info: add mouse_mode Alon Levy
2012-03-26 13:06 ` Gerd Hoffmann
2012-03-26 13:30 ` Alon Levy
2012-03-26 13:46 ` Gerd Hoffmann [this message]
2012-03-26 13:36 ` Alon Levy
2012-03-26 14:15 ` [Qemu-devel] [PATCH v2] " Alon Levy
2012-03-29 9:08 ` Gerd Hoffmann
2012-03-29 20:16 ` Alon Levy
2012-03-29 20:19 ` Anthony Liguori
2012-03-29 20:54 ` Alon Levy
2012-03-29 21:23 ` [Qemu-devel] [PATCH v3] " Alon Levy
2012-03-30 8:12 ` Gerd Hoffmann
2012-03-30 19:25 ` Alon Levy
2012-04-01 12:06 ` Alon Levy
2012-03-26 12:58 ` [Qemu-devel] [Spice-devel] [PATCH qemu+spice] expose server mouse status Arnon Gilboa
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=4F707333.7070804@redhat.com \
--to=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=spice-devel@freedesktop.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).