From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 2/8] replication: clarify permissions
Date: Fri, 17 Mar 2017 14:15:40 +0100 [thread overview]
Message-ID: <1489756546-27142-3-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1489756546-27142-1-git-send-email-kwolf@redhat.com>
From: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
Even if hidden_disk, secondary_disk are backing files, they all need
write permissions in replication scenario. Otherwise we will encouter
below exceptions on secondary side during adding nbd server:
{'execute': 'nbd-server-add', 'arguments': {'device': 'colo-disk', 'writable': true } }
{"error": {"class": "GenericError", "desc": "Conflicts with use by hidden-qcow2-driver as 'backing', which does not allow 'write' on sec-qcow2-driver-for-nbd"}}
CC: Zhang Hailiang <zhang.zhanghailiang@huawei.com>
CC: Zhang Chen <zhangchen.fnst@cn.fujitsu.com>
CC: Wen Congyang <wencongyang2@huawei.com>
Signed-off-by: Changlong Xie <xiecl.fnst@cn.fujitsu.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/replication.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/block/replication.c b/block/replication.c
index 22f170f..bf3c395 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -155,6 +155,18 @@ static void replication_close(BlockDriverState *bs)
replication_remove(s->rs);
}
+static void replication_child_perm(BlockDriverState *bs, BdrvChild *c,
+ const BdrvChildRole *role,
+ uint64_t perm, uint64_t shared,
+ uint64_t *nperm, uint64_t *nshared)
+{
+ *nperm = *nshared = BLK_PERM_CONSISTENT_READ \
+ | BLK_PERM_WRITE \
+ | BLK_PERM_WRITE_UNCHANGED;
+
+ return;
+}
+
static int64_t replication_getlength(BlockDriverState *bs)
{
return bdrv_getlength(bs->file->bs);
@@ -660,7 +672,7 @@ BlockDriver bdrv_replication = {
.bdrv_open = replication_open,
.bdrv_close = replication_close,
- .bdrv_child_perm = bdrv_filter_default_perms,
+ .bdrv_child_perm = replication_child_perm,
.bdrv_getlength = replication_getlength,
.bdrv_co_readv = replication_co_readv,
--
1.8.3.1
next prev parent reply other threads:[~2017-03-17 13:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-17 13:15 [Qemu-devel] [PULL 0/8] Block layer fixes for 2.9.0-rc1 Kevin Wolf
2017-03-17 13:15 ` [Qemu-devel] [PULL 1/8] file-posix: clean up max_segments buffer termination Kevin Wolf
2017-03-17 13:15 ` Kevin Wolf [this message]
2017-04-18 1:23 ` [Qemu-devel] [PULL 2/8] replication: clarify permissions Eric Blake
2017-04-18 1:36 ` Hailiang Zhang
2017-04-18 2:52 ` Xie Changlong
2017-03-17 13:15 ` [Qemu-devel] [PULL 3/8] file-posix: Don't leak fd in hdev_get_max_segments Kevin Wolf
2017-03-17 13:15 ` [Qemu-devel] [PULL 4/8] block: Always call bdrv_child_check_perm first Kevin Wolf
2017-03-17 13:15 ` [Qemu-devel] [PULL 5/8] blockdev: fix bitmap clear undo Kevin Wolf
2017-03-17 13:15 ` [Qemu-devel] [PULL 6/8] block: Propagate error in bdrv_open_backing_file Kevin Wolf
2017-03-17 13:15 ` [Qemu-devel] [PULL 7/8] thread-pool: add missing qemu_bh_cancel in completion function Kevin Wolf
2017-03-17 13:15 ` [Qemu-devel] [PULL 8/8] block: quiesce AioContext when detaching from it Kevin Wolf
2017-03-17 14:03 ` [Qemu-devel] [PULL 0/8] Block layer fixes for 2.9.0-rc1 Peter Maydell
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=1489756546-27142-3-git-send-email-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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.