[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.5 v4 3/4] vhost-user-test: fix crash with
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] [PATCH for-2.5 v4 3/4] vhost-user-test: fix crash with glib < 2.36 |
Date: |
Tue, 01 Dec 2015 13:15:20 +0000 |
User-agent: |
mu4e 0.9.15; emacs 24.5.50.4 |
address@hidden writes:
> From: Marc-André Lureau <address@hidden>
>
> The prepare callback needs to be implemented with glib < 2.36,
> quoting glib documentation:
> "Since 2.36 this may be NULL, in which case the effect is as if the
> function always returns FALSE with a timeout of -1."
>
> Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
> ---
> tests/vhost-user-test.c | 19 +++++++++++++++----
> 1 file changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
> index 29205ed..29de739 100644
> --- a/tests/vhost-user-test.c
> +++ b/tests/vhost-user-test.c
> @@ -506,11 +506,22 @@ test_migrate_source_check(GSource *source)
> return FALSE;
> }
>
> +#if !GLIB_CHECK_VERSION(2,36,0)
> +/* this callback is unnecessary with glib >2.36, the default
> + * prepare for the source does the same */
> +static gboolean
> +test_migrate_source_prepare(GSource *source, gint *timeout)
> +{
> + *timeout = -1;
> + return FALSE;
> +}
> +#endif
> +
> GSourceFuncs test_migrate_source_funcs = {
> - NULL,
> - test_migrate_source_check,
> - NULL,
> - NULL
> +#if !GLIB_CHECK_VERSION(2,36,0)
> + .prepare = test_migrate_source_prepare,
> +#endif
> + .check = test_migrate_source_check,
> };
>
> static void test_migrate(void)
--
Alex Bennée
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH for-2.5 v4 3/4] vhost-user-test: fix crash with glib < 2.36,
Alex Bennée <=