From: "Michael S. Tsirkin" <mst@redhat.com>
To: marcandre.lureau@redhat.com
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-2.5 3/3] vhost-user-test: fix crash with glib < 2.36
Date: Mon, 30 Nov 2015 12:58:26 +0200 [thread overview]
Message-ID: <20151130125657-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <1448635280-941-4-git-send-email-marcandre.lureau@redhat.com>
On Fri, Nov 27, 2015 at 03:41:20PM +0100, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> The prepare callback needs to be implemented with glib < 2.36.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
But nothing prevents us from implementing it for all versions.
> ---
> tests/vhost-user-test.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
> index 29205ed..4ab48e4 100644
> --- a/tests/vhost-user-test.c
> +++ b/tests/vhost-user-test.c
> @@ -506,8 +506,19 @@ test_migrate_source_check(GSource *source)
> return FALSE;
> }
>
> +#if !GLIB_CHECK_VERSION(2,36,0)
> +static gboolean
> +test_migrate_source_prepare(GSource *source, gint *timeout)
> +{
> + *timeout = -1;
> + return FALSE;
> +}
> +#endif
> +
> GSourceFuncs test_migrate_source_funcs = {
> - NULL,
> +#if !GLIB_CHECK_VERSION(2,36,0)
> + test_migrate_source_prepare,
> +#endif
> test_migrate_source_check,
So now for version 2.36 check will be used instead of prepare.
That's clearly wrong.
I'll switch this to named initializers to avoid the mess.
> NULL,
> NULL
> --
> 2.5.0
next prev parent reply other threads:[~2015-11-30 10:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-27 14:41 [Qemu-devel] [PATCH for-2.5 0/3] vhost-user-test fixes marcandre.lureau
2015-11-27 14:41 ` [Qemu-devel] [PATCH for-2.5 1/3] vhost-user-test: fix chardriver race marcandre.lureau
2015-11-27 14:41 ` [Qemu-devel] [PATCH for-2.5 2/3] vhost-user-test: use unix port for migration marcandre.lureau
2015-11-27 14:41 ` [Qemu-devel] [PATCH for-2.5 3/3] vhost-user-test: fix crash with glib < 2.36 marcandre.lureau
2015-11-30 10:58 ` Michael S. Tsirkin [this message]
2015-11-30 11:00 ` Marc-André Lureau
2015-11-30 11:09 ` Marc-André Lureau
2015-11-30 13:09 ` Michael S. Tsirkin
2015-11-30 13:12 ` Marc-André Lureau
2015-11-30 13:18 ` Michael S. Tsirkin
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=20151130125657-mutt-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=marcandre.lureau@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).