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

Re: [Xen-devel] [PATCH v10 21/31] libxc/save: support COLO save



On Mon, Feb 22, 2016 at 10:52:25AM +0800, Wen Congyang wrote:
[...]
>  /*
>   * Suspend the domain and send dirty memory.
>   * This is the last iteration of the live migration and the
> @@ -558,6 +610,16 @@ static int suspend_and_send_dirty(struct xc_sr_context 
> *ctx)
>  
>      bitmap_or(dirty_bitmap, ctx->save.deferred_pages, ctx->save.p2m_size);
>  
> +    if ( !ctx->save.live && ctx->save.checkpointed == MIG_STREAM_COLO )
> +    {
> +        rc = merge_secondary_dirty_bitmap(ctx);
> +        if ( rc )
> +        {
> +            PERROR("Failed to get secondary vm's dirty pages");
> +            goto out;
> +        }
> +    }
> +
>      rc = send_dirty_pages(ctx, stats.dirty_count + 
> ctx->save.nr_deferred_pages);
>      if ( rc )
>          goto out;
> @@ -791,13 +853,42 @@ static int save(struct xc_sr_context *ctx, uint16_t 
> guest_type)
>              if ( rc )
>                  goto err;
>  
> -            rc = ctx->save.callbacks->postcopy(ctx->save.callbacks->data);
> -            if ( rc <= 0 )
> -                goto err;
> +            if ( ctx->save.checkpointed == MIG_STREAM_COLO )
> +            {
> +                rc = 
> ctx->save.callbacks->checkpoint(ctx->save.callbacks->data);
> +                if ( !rc )
> +                {
> +                    rc = -1;
> +                    goto err;
> +                }
> +            }
>  
> -            rc = ctx->save.callbacks->checkpoint(ctx->save.callbacks->data);
> -            if ( rc <= 0 )
> +            rc = ctx->save.callbacks->postcopy(ctx->save.callbacks->data);
> +            if ( !rc )

This original code for checking postcopy return value is if ( rc <= 0 ).

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.