[Spice-devel] [PATCH v3 04/22] server, proto: tell the client to connect to the migration target before migraton starts

Uri Lublin uril at redhat.com
Tue Sep 27 15:15:37 PDT 2011


On 09/25/2011 03:36 PM, Yonit Halperin wrote:
> (1) send SPICE_MSG_MAIN_MIGRATE_BEGIN upon spice_server_migrate_connect
> (2) wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR), or a timeout, in order
>      to complete client_migrate_info monitor command
>
> Signed-off-by: Yonit Halperin<yhalperi at redhat.com>
> ---
>   common/messages.h |    2 +
>   server/reds.c     |  148 +++++++++++++++++++++++++++++++++++++++-------------
>   spice.proto       |    5 +-
>   3 files changed, 115 insertions(+), 40 deletions(-)
>
> diff --git a/server/reds.c b/server/reds.c
> index 99d52f9..845b0ee 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -1891,6 +1900,23 @@ static int sync_write(RedsStream *stream, const void *in_buf, size_t n)
>       return TRUE;
>   }
>
> +static void reds_channel_set_caps(Channel *channel, int cap, int active)
> +{
> +    int nbefore, n;
> +
> +    nbefore = channel->num_caps;
> +    n = cap / 32;
> +    channel->num_caps = MAX(channel->num_caps, n + 1);
> +    channel->caps = spice_renew(uint32_t, channel->caps, channel->num_caps);
> +    memset(channel->caps + nbefore, 0,
> +           (channel->num_caps - nbefore) * sizeof(uint32_t));
> +    if (active) {
> +        channel->caps[n] |= (1<<  cap);

I think this should be
            channel->caps[n] |= (1<<  (cap - (n * 32)));

> +    } else {
> +        channel->caps[n]&= ~(1<<  cap);

and same here

> +    }
> +}
> +



Since currently n is always 0, it's just a nitpick at this point.


More information about the Spice-devel mailing list