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

Re: [Xen-devel] [PATCH v10 18/31] libxc/restore: support COLO restore



On Mon, Feb 22, 2016 at 10:52:22AM +0800, Wen Congyang wrote:
[...]
> - * With Remus, we buffer the records sent by the primary at checkpoint,
> + * With Remus/COLO, we buffer the records sent by the primary at checkpoint,
>   * in case the primary will fail, we can recover from the last
>   * checkpoint state.
>   * This should be enough for most of the cases because primary only send
> diff --git a/tools/libxc/xc_sr_restore.c b/tools/libxc/xc_sr_restore.c
> index aef9bca..2ae8154 100644
> --- a/tools/libxc/xc_sr_restore.c
> +++ b/tools/libxc/xc_sr_restore.c
> @@ -460,6 +460,49 @@ static int handle_checkpoint(struct xc_sr_context *ctx)
>      else
>          ctx->restore.buffer_all_records = true;
>  
> +    if ( ctx->restore.checkpointed == MIG_STREAM_COLO )
> +    {
> +#define HANDLE_CALLBACK_RETURN_VALUE(ret)                   \
> +    do {                                                    \
> +        if ( ret == 1 )                                     \
> +            rc = 0; /* Success */                           \
> +        else                                                \
> +        {                                                   \
> +            if ( ret == 2 )                                 \
> +                rc = BROKEN_CHANNEL;                        \
> +            else                                            \
> +                rc = -1; /* Some unspecified error */       \
> +            goto err;                                       \
> +        }                                                   \
> +    } while (0)
> +
> +        /* COLO */
> +
> +        /* We need to resume guest */
> +        rc = ctx->restore.ops.stream_complete(ctx);
> +        if ( rc )
> +            goto err;
> +
> +        /* TODO: call restore_results */
> +
> +        /* Resume secondary vm */
> +        ret = ctx->restore.callbacks->postcopy(ctx->restore.callbacks->data);
> +        HANDLE_CALLBACK_RETURN_VALUE(ret);
> +
> +        /* Wait for a new checkpoint */
> +        ret = ctx->restore.callbacks->wait_checkpoint(
> +                                                
> ctx->restore.callbacks->data);
> +        HANDLE_CALLBACK_RETURN_VALUE(ret);
> +
> +        /* suspend secondary vm */
> +        ret = ctx->restore.callbacks->suspend(ctx->restore.callbacks->data);
> +        HANDLE_CALLBACK_RETURN_VALUE(ret);
> +
> +#undef HANDLE_CALLBACK_RETURN_VALUE
> +
> +        /* TODO: send dirty pfn list to primary */

You replace the TODOs with actual code in the next two patches.

You can rearrange them a bit so that you don't need to add TODOs at all.


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®.