All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: [PULL 12/20] block: improve bdrv_child_get_parent_desc()
Date: Wed,  2 Jun 2021 15:45:21 +0200	[thread overview]
Message-ID: <20210602134529.231756-13-kwolf@redhat.com> (raw)
In-Reply-To: <20210602134529.231756-1-kwolf@redhat.com>

From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

We have different types of parents: block nodes, block backends and
jobs. So, it makes sense to specify type together with name.

Next, this handler us used to compose an error message about permission
conflict. And permission conflict occurs in a specific place of block
graph. We shouldn't report name of parent device (as it refers another
place in block graph), but exactly and only the name of the node. So,
use bdrv_get_node_name() directly.

iotest 283 output is updated.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-Id: <20210601075218.79249-4-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c                    | 2 +-
 tests/qemu-iotests/283.out | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/block.c b/block.c
index c0fd363605..94cb7b6637 100644
--- a/block.c
+++ b/block.c
@@ -1149,7 +1149,7 @@ int bdrv_parse_cache_mode(const char *mode, int *flags, bool *writethrough)
 static char *bdrv_child_get_parent_desc(BdrvChild *c)
 {
     BlockDriverState *parent = c->opaque;
-    return g_strdup(bdrv_get_device_or_node_name(parent));
+    return g_strdup_printf("node '%s'", bdrv_get_node_name(parent));
 }
 
 static void bdrv_child_cb_drained_begin(BdrvChild *child)
diff --git a/tests/qemu-iotests/283.out b/tests/qemu-iotests/283.out
index 97e62a4c94..c9397bfc44 100644
--- a/tests/qemu-iotests/283.out
+++ b/tests/qemu-iotests/283.out
@@ -5,7 +5,7 @@
 {"execute": "blockdev-add", "arguments": {"driver": "blkdebug", "image": "base", "node-name": "other", "take-child-perms": ["write"]}}
 {"return": {}}
 {"execute": "blockdev-backup", "arguments": {"device": "source", "sync": "full", "target": "target"}}
-{"error": {"class": "GenericError", "desc": "Cannot append backup-top filter: Conflicts with use by source as 'image', which does not allow 'write' on base"}}
+{"error": {"class": "GenericError", "desc": "Cannot append backup-top filter: Conflicts with use by node 'source' as 'image', which does not allow 'write' on base"}}
 
 === backup-top should be gone after job-finalize ===
 
-- 
2.30.2



  parent reply	other threads:[~2021-06-02 13:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02 13:45 [PULL 00/20] Block layer patches Kevin Wolf
2021-06-02 13:45 ` [PULL 01/20] block/quorum: Provide .bdrv_co_flush instead of .bdrv_co_flush_to_disk Kevin Wolf
2021-06-02 13:45 ` [PULL 02/20] qemu-io-cmds: assert that we don't have .perm requested in no-blk case Kevin Wolf
2021-06-02 13:45 ` [PULL 03/20] block/vvfat: child_vvfat_qcow: add .get_parent_aio_context, fix crash Kevin Wolf
2021-06-02 13:45 ` [PULL 04/20] block/vvfat: fix vvfat_child_perm crash Kevin Wolf
2021-06-02 13:45 ` [PULL 05/20] block: consistently use bdrv_is_read_only() Kevin Wolf
2021-06-02 13:45 ` [PULL 06/20] block: drop BlockDriverState::read_only Kevin Wolf
2021-06-02 13:45 ` [PULL 07/20] block: drop BlockBackendRootState::read_only Kevin Wolf
2021-06-02 13:45 ` [PULL 08/20] block/file-posix: Fix problem with fallocate(PUNCH_HOLE) on GPFS Kevin Wolf
2021-06-02 13:45 ` [PULL 09/20] block/file-posix: Try other fallbacks after invalid FALLOC_FL_ZERO_RANGE Kevin Wolf
2021-06-02 13:45 ` [PULL 10/20] block: document child argument of bdrv_attach_child_common() Kevin Wolf
2021-06-02 13:45 ` [PULL 11/20] block-backend: improve blk_root_get_parent_desc() Kevin Wolf
2021-06-02 13:45 ` Kevin Wolf [this message]
2021-06-02 13:45 ` [PULL 13/20] block/vvfat: inherit child_vvfat_qcow from child_of_bds Kevin Wolf
2021-06-02 13:45 ` [PULL 14/20] block: simplify bdrv_child_user_desc() Kevin Wolf
2021-06-02 13:45 ` [PULL 15/20] block: improve permission conflict error message Kevin Wolf
2021-06-02 13:45 ` [PULL 16/20] block-backend: add drained_poll Kevin Wolf
2021-06-02 13:45 ` [PULL 17/20] nbd/server: Use drained block ops to quiesce the server Kevin Wolf
2021-06-02 13:45 ` [PULL 18/20] block-copy: fix block_copy_task_entry() progress update Kevin Wolf
2021-06-02 13:45 ` [PULL 19/20] block-copy: refactor copy_range handling Kevin Wolf
2021-06-02 13:45 ` [PULL 20/20] docs/secure-coding-practices: Describe how to use 'null-co' block driver Kevin Wolf
2021-06-03  8:59 ` [PULL 00/20] Block layer patches 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=20210602134529.231756-13-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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.