All of lore.kernel.org
 help / color / mirror / Atom feed
From: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
To: Stefan Hajnoczi <stefanha@gmail.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: Tue, 8 Mar 2016 11:08:05 +0800	[thread overview]
Message-ID: <56DE4215.9000104@cn.fujitsu.com> (raw)
In-Reply-To: <20160304161327.GE9130@stefanha-x1.localdomain>

On 03/05/2016 12:13 AM, Stefan Hajnoczi wrote:
> 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);
>

Hi Stefan

Thanks for your comments.

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

Will try that.

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

Surely


Thanks
	-Xie
>

  reply	other threads:[~2016-03-08  3:06 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   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-03-08  3:08     ` Changlong Xie [this message]
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=56DE4215.9000104@cn.fujitsu.com \
    --to=xiecl.fnst@cn.fujitsu.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@gmail.com \
    --cc=stefanha@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.