[Spice-devel] [PATCH 01/15] display: replace some dubious asserts

Jonathon Jongsma jjongsma at redhat.com
Thu Dec 3 11:58:38 PST 2015


On Thu, 2015-12-03 at 16:26 +0000, Frediano Ziglio wrote:
> From: Marc-André Lureau <marcandre.lureau at gmail.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau at gmail.com>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
> uri ???

Uri, any further thoughts?


> ---
>  server/display-channel.c | 7 +++++--
>  server/red_worker.c      | 4 +---
>  2 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/server/display-channel.c b/server/display-channel.c
> index 7017b2a..722ee86 100644
> --- a/server/display-channel.c
> +++ b/server/display-channel.c
> @@ -1189,11 +1189,14 @@ int
> display_channel_wait_for_migrate_data(DisplayChannel *display)
>      RedChannel *channel = &display->common.base;
>      RedChannelClient *rcc;
>  
> +    if (!red_channel_waits_for_migrate_data(&display->common.base)) {
> +        return FALSE;
> +    }
> +
>      spice_debug(NULL);
> -    spice_assert(channel->clients_num == 1);
> +    spice_warn_if_fail(channel->clients_num == 1);
>  
>      rcc = SPICE_CONTAINEROF(ring_get_head(&channel->clients),
> RedChannelClient, channel_link);
> -    spice_assert(red_channel_client_waits_for_migrate_data(rcc));
>  
>      for (;;) {
>          red_channel_client_receive(rcc);
> diff --git a/server/red_worker.c b/server/red_worker.c
> index 13a3ec2..1204bb1 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -990,9 +990,7 @@ static void handle_dev_start(void *opaque, void *payload)
>      }
>      if (worker->display_channel) {
>          worker->display_channel->common.during_target_migrate = FALSE;
> -        if (red_channel_waits_for_migrate_data(&worker->display_channel
> ->common.base)) {
> -            display_channel_wait_for_migrate_data(worker->display_channel);
> -        }
> +        display_channel_wait_for_migrate_data(worker->display_channel);
>      }
>      worker->running = TRUE;
>      guest_set_client_capabilities(worker);


More information about the Spice-devel mailing list