From: Hailiang Zhang <zhang.zhanghailiang@huawei.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: xuquan8@huawei.com, qemu-devel@nongnu.org, qemu-block@nongnu.org,
kwolf@redhat.com, mreitz@redhat.com, xiecl.fnst@cn.fujitsu.com,
zhangchen.fnst@cn.fujitsu.com, Eric Blake <eblake@redhat.com>,
Wen Congyang <wency@cn.fujitsu.com>
Subject: Re: [Qemu-devel] [PATCH v3 2/6] replication: add shared-disk and shared-disk-id options
Date: Wed, 1 Mar 2017 11:53:14 +0800 [thread overview]
Message-ID: <58B645AA.3030301@huawei.com> (raw)
In-Reply-To: <20170227171052.GI10201@stefanha-x1.localdomain>
On 2017/2/28 1:10, Stefan Hajnoczi wrote:
> On Fri, Jan 20, 2017 at 11:47:56AM +0800, zhanghailiang wrote:
>> @@ -119,12 +136,31 @@ static int replication_open(BlockDriverState *bs, QDict *options,
>> "The option mode's value should be primary or secondary");
>> goto fail;
>> }
>> + s->is_shared_disk = qemu_opt_get_bool(opts, REPLICATION_SHARED_DISK,
>> + false);
>> + if (s->is_shared_disk && (s->mode == REPLICATION_MODE_PRIMARY)) {
>> + shared_disk_id = qemu_opt_get(opts, REPLICATION_SHARED_DISK_ID);
>> + if (!shared_disk_id) {
>> + error_setg(&local_err, "Missing shared disk blk option");
>> + goto fail;
>> + }
>> + s->shared_disk_id = g_strdup(shared_disk_id);
>> + blk = blk_by_name(s->shared_disk_id);
>> + if (!blk) {
>> + error_setg(&local_err, "There is no %s block", s->shared_disk_id);
>> + goto fail;
>> + }
>> + /* We can't access root member of BlockBackend directly */
>> + tmp_bs = blk_bs(blk);
>> + s->primary_disk = QLIST_FIRST(&tmp_bs->parents);
>
> Why is this necessary?
>
> We already have the BlockBackend for the primary disk. I'm not sure why
> the BdrvChild is needed.
>
Er, the helper backup_job_create() needs the BlockDriverState for the primary disk,
besides, we want to make it same with 'secondary_disk' in struct BDRVReplicationState.
Thanks.
Hailiang
> Stefan
>
next prev parent reply other threads:[~2017-03-01 3:53 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-20 3:47 [Qemu-devel] [PATCH v3 0/6] COLO block replication supports shared disk case zhanghailiang
2017-01-20 3:47 ` [Qemu-devel] [PATCH v3 1/6] docs/block-replication: Add description for shared-disk case zhanghailiang
2017-02-27 16:46 ` Stefan Hajnoczi
2017-03-01 3:09 ` Hailiang Zhang
2017-03-01 10:22 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-01-20 3:47 ` [Qemu-devel] [PATCH v3 2/6] replication: add shared-disk and shared-disk-id options zhanghailiang
2017-02-27 17:10 ` Stefan Hajnoczi
2017-03-01 3:53 ` Hailiang Zhang [this message]
2017-03-01 10:21 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-01-20 3:47 ` [Qemu-devel] [PATCH v3 3/6] replication: Split out backup_do_checkpoint() from secondary_do_checkpoint() zhanghailiang
2017-01-20 3:47 ` [Qemu-devel] [PATCH v3 4/6] replication: fix code logic with the new shared_disk option zhanghailiang
2017-01-20 3:47 ` [Qemu-devel] [PATCH v3 5/6] replication: Implement block replication for shared disk case zhanghailiang
2017-02-27 17:37 ` Stefan Hajnoczi
2017-03-07 14:30 ` Hailiang Zhang
2017-03-10 4:17 ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2017-01-20 3:48 ` [Qemu-devel] [PATCH v3 6/6] nbd/replication: implement .bdrv_get_info() for nbd and replication driver zhanghailiang
2017-02-23 12:46 ` [Qemu-devel] [PATCH v3 0/6] COLO block replication supports shared disk case Hailiang Zhang
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=58B645AA.3030301@huawei.com \
--to=zhang.zhanghailiang@huawei.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=wency@cn.fujitsu.com \
--cc=xiecl.fnst@cn.fujitsu.com \
--cc=xuquan8@huawei.com \
--cc=zhangchen.fnst@cn.fujitsu.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.