[PATCH for-5.0 18/31] block: Switch child_format users to child_of_bds

Max Reitz posted 31 patches 6 years, 2 months ago
Maintainers: Kevin Wolf <kwolf@redhat.com>, John Snow <jsnow@redhat.com>, Alberto Garcia <berto@igalia.com>, Jeff Cody <codyprime@gmail.com>, Stefan Weil <sw@weilnetz.de>, "Denis V. Lunev" <den@openvz.org>, Xie Changlong <xiechanglong.d@gmail.com>, Wen Congyang <wencongyang2@huawei.com>, Fam Zheng <fam@euphon.net>, Paolo Bonzini <pbonzini@redhat.com>, Ari Sundholm <ari@tuxera.com>, Stefan Hajnoczi <stefanha@redhat.com>, Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>, Max Reitz <mreitz@redhat.com>
There is a newer version of this series
[PATCH for-5.0 18/31] block: Switch child_format users to child_of_bds
Posted by Max Reitz 6 years, 2 months ago
Both users (quorum and blkverify) use child_format for
not-really-filtered children, so the appropriate BdrvChildRole in both
cases is DATA | FORMAT.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/blkverify.c | 5 +++--
 block/quorum.c    | 9 ++++++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/block/blkverify.c b/block/blkverify.c
index ba4f6d7b7c..4f4d079b12 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -134,8 +134,9 @@ 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 | BDRV_CHILD_FORMAT,
+                                   false, &local_err);
     if (local_err) {
         ret = -EINVAL;
         error_propagate(errp, local_err);
diff --git a/block/quorum.c b/block/quorum.c
index a6b2d73668..29f7a14e7c 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -997,8 +997,10 @@ 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 |
+                                               BDRV_CHILD_FORMAT,
+                                               false, &local_err);
         if (local_err) {
             ret = -EINVAL;
             goto close_exit;
@@ -1074,7 +1076,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 | BDRV_CHILD_FORMAT, errp);
     if (child == NULL) {
         s->next_child_index--;
         goto out;
-- 
2.23.0