qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v17 6/8] Introduce new APIs to do replication op


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v17 6/8] Introduce new APIs to do replication operation
Date: Wed, 13 Apr 2016 13:47:57 +0100
User-agent: Mutt/1.5.24 (2015-08-30)

On Mon, Apr 11, 2016 at 04:22:57PM +0800, Changlong Xie wrote:
> +/*
> + * The caller of the function MUST make sure vm stopped
> + */
> +void replication_start_all(ReplicationMode mode, Error **errp)
> +{
> +    ReplicationState *rs, *next;
> +
> +    QLIST_FOREACH_SAFE(rs, &replication_states, node, next) {
> +        if (rs->ops && rs->ops->start) {
> +            rs->ops->start(rs, mode, errp);
> +        }
> +        if (errp && *errp) {
> +            return;
> +        }

This function returns immediately on error if the caller provided errp.
It continues if the caller did not provide errp.

I'm not sure if you wanted this difference in behavior.

The following always returns immediately on error, even when the caller
did not provide errp:

void replication_start_all(ReplicationMode mode, Error **errp)
{
    ReplicationState *rs, *next;
    Error *local_err = NULL;

    QLIST_FOREACH_SAFE(rs, &replication_states, node, next) {
        if (rs->ops && rs->ops->start) {
            rs->ops->start(rs, mode, &local_err);
        }
        if (local_err) {
            error_propagate(errp, local_err);
            return;
        }
> +/**
> + * SECTION:replication.h
> + * @title:Base Replication System
> + * @short_description: interfaces for handle replication
> + *
> + * The Replication Model provides a framework for handle Replication

s/handle/handling/

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]