[PATCH v2 20/33] block: Switch child_format users to child_of_bds

Max Reitz posted 33 patches 6 years ago
There is a newer version of this series
[PATCH v2 20/33] block: Switch child_format users to child_of_bds
Posted by Max Reitz 6 years ago
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>
---
 block/blkverify.c | 4 ++--
 block/quorum.c    | 7 ++++---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/block/blkverify.c b/block/blkverify.c
index ba4f6d7b7c..1684b7aa2e 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -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);
diff --git a/block/quorum.c b/block/quorum.c
index 62fe37856d..1189ea209b 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -992,8 +992,8 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
         assert(ret < 32);
 
         s->children[i].child = 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;
@@ -1069,7 +1069,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;
-- 
2.24.1


Re: [PATCH v2 20/33] block: Switch child_format users to child_of_bds
Posted by Eric Blake 6 years ago
On 2/4/20 11:08 AM, Max Reitz wrote:
> 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>
> ---
>   block/blkverify.c | 4 ++--
>   block/quorum.c    | 7 ++++---
>   2 files changed, 6 insertions(+), 5 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org