qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: zhanghailiang <zhang.zhanghailiang@huawei.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, kwolf@redhat.com,
	mreitz@redhat.com, xiecl.fnst@cn.fujitsu.com,
	zhangchen.fnst@cn.fujitsu.com, xuquan8@huawei.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: Mon, 27 Feb 2017 17:10:52 +0000	[thread overview]
Message-ID: <20170227171052.GI10201@stefanha-x1.localdomain> (raw)
In-Reply-To: <1484884080-28836-3-git-send-email-zhang.zhanghailiang@huawei.com>

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

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.

Stefan

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

  reply	other threads:[~2017-02-27 17:11 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 [this message]
2017-03-01  3:53     ` Hailiang Zhang
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=20170227171052.GI10201@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wency@cn.fujitsu.com \
    --cc=xiecl.fnst@cn.fujitsu.com \
    --cc=xuquan8@huawei.com \
    --cc=zhang.zhanghailiang@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 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).