qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <famz@redhat.com>,
	qemu block <qemu-block@nongnu.org>,
	Jiang Yunhong <yunhong.jiang@intel.com>,
	Dong Eddie <eddie.dong@intel.com>,
	qemu devel <qemu-devel@nongnu.org>,
	"Michael R. Hines" <mrhines@linux.vnet.ibm.com>,
	Max Reitz <mreitz@redhat.com>, Gonglei <arei.gonglei@huawei.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	zhanghailiang <zhang.zhanghailiang@huawei.com>
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH v15 7/9] Introduce new APIs to do replication operation
Date: Fri, 4 Mar 2016 16:13:27 +0000	[thread overview]
Message-ID: <20160304161327.GE9130@stefanha-x1.localdomain> (raw)
In-Reply-To: <1454645888-28826-8-git-send-email-xiecl.fnst@cn.fujitsu.com>

[-- Attachment #1: Type: text/plain, Size: 1972 bytes --]

On Fri, Feb 05, 2016 at 12:18:06PM +0800, Changlong Xie wrote:
> diff --git a/replication.h b/replication.h
> new file mode 100644
> index 0000000..faea649
> --- /dev/null
> +++ b/replication.h
> @@ -0,0 +1,53 @@
> +/*
> + * Replication filter
> + *
> + * Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD.
> + * Copyright (c) 2016 Intel Corporation
> + * Copyright (c) 2016 FUJITSU LIMITED
> + *
> + * Author:
> + *   Wen Congyang <wency@cn.fujitsu.com>
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +
> +#ifndef REPLICATION_H
> +#define REPLICATION_H
> +
> +#include "sysemu/sysemu.h"
> +
> +typedef struct ReplicationOps ReplicationOps;
> +typedef struct ReplicationState ReplicationState;
> +typedef void (*Start)(ReplicationState *rs, ReplicationMode mode, Error **errp);
> +typedef void (*Stop)(ReplicationState *rs, bool failover, Error **errp);
> +typedef void (*Checkpoint)(ReplicationState *rs, Error **errp);
> +typedef void (*GetError)(ReplicationState *rs, Error **errp);

These typedefs are likely to collide with system headers.  Please prefix
the name.

That said, I don't think Start, Stop, Checkpoint, GetError are
necessary.  Just declare the prototypes in struct ReplicationOps.  No
user passes single function pointers, they always pass ReplicationOps.
Therefore it's not necessary to declare types for these functions at
all.

> +
> +struct ReplicationState {
> +    void *opaque;
> +    ReplicationOps *ops;
> +    QLIST_ENTRY(ReplicationState) node;
> +};
> +
> +struct ReplicationOps{
> +    Start start;
> +    Checkpoint checkpoint;
> +    GetError get_error;
> +    Stop stop;
> +};

Please add doc comments that explain the semantics of these functions.
For examples, see include/qom/object.h.  This documentation should allow
someone implementing a new replication listener to understand the
constraints and the purpose of these functions.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  parent reply	other threads:[~2016-03-04 16:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05  4:17 [Qemu-devel] [PATCH v15 0/9] Block replication for continuous checkpoints Changlong Xie
2016-02-05  4:18 ` [Qemu-devel] [PATCH v15 1/9] unblock backup operations in backing file Changlong Xie
2016-02-05  4:18 ` [Qemu-devel] [PATCH v15 2/9] Store parent BDS in BdrvChild Changlong Xie
2016-02-05  4:18 ` [Qemu-devel] [PATCH v15 3/9] Backup: clear all bitmap when doing block checkpoint Changlong Xie
2016-02-05  4:18 ` [Qemu-devel] [PATCH v15 4/9] Link backup into block core Changlong Xie
2016-02-05  4:18 ` [Qemu-devel] [PATCH v15 5/9] docs: block replication's description Changlong Xie
2016-02-05  4:18 ` [Qemu-devel] [PATCH v15 6/9] auto complete active commit Changlong Xie
2016-02-05  4:18 ` [Qemu-devel] [PATCH v15 7/9] Introduce new APIs to do replication operation Changlong Xie
2016-02-15  0:57   ` Hailiang Zhang
2016-02-15  1:13     ` Wen Congyang
2016-02-19  8:41       ` Hailiang Zhang
2016-02-19  8:55         ` Wen Congyang
2016-02-15  2:25     ` Changlong Xie
2016-03-04 16:13   ` Stefan Hajnoczi [this message]
2016-03-08  3:08     ` [Qemu-devel] [Qemu-block] " Changlong Xie
2016-02-05  4:18 ` [Qemu-devel] [PATCH v15 8/9] Implement new driver for block replication Changlong Xie
2016-03-04 17:39   ` Stefan Hajnoczi
2016-03-08  3:30     ` Changlong Xie
2016-03-09  3:29     ` Changlong Xie
2016-03-04 17:53   ` Stefan Hajnoczi
2016-03-08  3:31     ` Changlong Xie
2016-03-09 10:35     ` Changlong Xie
2016-02-05  4:18 ` [Qemu-devel] [PATCH v15 9/9] support replication driver in blockdev-add Changlong Xie
2016-02-15  7:02 ` [Qemu-devel] [PATCH v15 0/9] Block replication for continuous checkpoints Changlong Xie
2016-02-17  9:32 ` Hailiang Zhang
2016-02-23  9:10 ` Changlong Xie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160304161327.GE9130@stefanha-x1.localdomain \
    --to=stefanha@gmail.com \
    --cc=arei.gonglei@huawei.com \
    --cc=dgilbert@redhat.com \
    --cc=eddie.dong@intel.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=mrhines@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=xiecl.fnst@cn.fujitsu.com \
    --cc=yunhong.jiang@intel.com \
    --cc=zhang.zhanghailiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).