Re: [PATCH 13/18] display: replace some dubious asserts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Acked-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>

On Wed, 2015-11-25 at 11:51 -0500, Frediano Ziglio wrote:
> Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxx>
> Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> ---
>  server/display-channel.c | 7 +++++--
>  server/red_worker.c      | 4 +---
>  2 files changed, 6 insertions(+), 5 deletions(-)
> 
> 
> Changes:
> - move checks from worker to display;
> - remove the assert, it's now redundant.
> 
> 
> diff --git a/server/display-channel.c b/server/display-channel.c
> index 1be3334..3044ead 100644
> --- a/server/display-channel.c
> +++ b/server/display-channel.c
> @@ -860,11 +860,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 678b581..e14318e 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -4047,9 +4047,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);
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]