Skip to content

Commit

Permalink
block: Switch child_format users to child_of_bds
Browse files Browse the repository at this point in the history
Both users (quorum and blkverify) use child_format for
not-really-filtered children, so the appropriate BdrvChildRole in both
cases is DATA.  (Note that this will cause bdrv_inherited_options() to
force-allow format probing.)

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200513110544.176672-22-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
XanClic authored and kevmw committed May 18, 2020
1 parent 500e243 commit 36ee58d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions block/blkverify.c
Expand Up @@ -134,8 +134,8 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags,

/* Open the test file */
s->test_file = bdrv_open_child(qemu_opt_get(opts, "x-image"), options,
"test", bs, &child_format, 0, false,
&local_err);
"test", bs, &child_of_bds, BDRV_CHILD_DATA,
false, &local_err);
if (local_err) {
ret = -EINVAL;
error_propagate(errp, local_err);
Expand Down
6 changes: 4 additions & 2 deletions block/quorum.c
Expand Up @@ -977,7 +977,8 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
assert(ret < 32);

s->children[i] = bdrv_open_child(NULL, options, indexstr, bs,
&child_format, 0, false, &local_err);
&child_of_bds, BDRV_CHILD_DATA, false,
&local_err);
if (local_err) {
ret = -EINVAL;
goto close_exit;
Expand Down Expand Up @@ -1053,7 +1054,8 @@ static void quorum_add_child(BlockDriverState *bs, BlockDriverState *child_bs,
/* We can safely add the child now */
bdrv_ref(child_bs);

child = bdrv_attach_child(bs, child_bs, indexstr, &child_format, 0, errp);
child = bdrv_attach_child(bs, child_bs, indexstr, &child_of_bds,
BDRV_CHILD_DATA, errp);
if (child == NULL) {
s->next_child_index--;
goto out;
Expand Down

0 comments on commit 36ee58d

Please sign in to comment.