[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-5.0 23/31] block: Make filter drivers use child_of_bds
From: |
Max Reitz |
Subject: |
[PATCH for-5.0 23/31] block: Make filter drivers use child_of_bds |
Date: |
Wed, 27 Nov 2019 14:16:16 +0100 |
Note that some filters have secondary children, namely blkverify (the
image to be verified) and blklogwrites (the log). This patch does not
touch those children.
Signed-off-by: Max Reitz <address@hidden>
---
block/blkdebug.c | 4 +++-
block/blklogwrites.c | 3 ++-
block/blkverify.c | 5 ++++-
block/copy-on-read.c | 5 +++--
block/replication.c | 3 ++-
block/throttle.c | 5 +++--
6 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/block/blkdebug.c b/block/blkdebug.c
index 8dd8ed6055..b31fa40b0e 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -497,7 +497,9 @@ static int blkdebug_open(BlockDriverState *bs, QDict
*options, int flags,
/* Open the image file */
bs->file = bdrv_open_child(qemu_opt_get(opts, "x-image"), options, "image",
- bs, &child_file, 0, false, &local_err);
+ bs, &child_of_bds,
+ BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY,
+ false, &local_err);
if (local_err) {
ret = -EINVAL;
error_propagate(errp, local_err);
diff --git a/block/blklogwrites.c b/block/blklogwrites.c
index 4faf912ef1..78b0c49460 100644
--- a/block/blklogwrites.c
+++ b/block/blklogwrites.c
@@ -157,7 +157,8 @@ static int blk_log_writes_open(BlockDriverState *bs, QDict
*options, int flags,
}
/* Open the file */
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_of_bds,
+ BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY, false,
&local_err);
if (local_err) {
ret = -EINVAL;
diff --git a/block/blkverify.c b/block/blkverify.c
index 4f4d079b12..7df4cb8007 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -125,7 +125,10 @@ static int blkverify_open(BlockDriverState *bs, QDict
*options, int flags,
/* Open the raw file */
bs->file = bdrv_open_child(qemu_opt_get(opts, "x-raw"), options, "raw",
- bs, &child_file, 0, false, &local_err);
+ bs, &child_of_bds,
+ BDRV_CHILD_FILTERED | BDRV_CHILD_PROTOCOL |
+ BDRV_CHILD_PRIMARY,
+ false, &local_err);
if (local_err) {
ret = -EINVAL;
error_propagate(errp, local_err);
diff --git a/block/copy-on-read.c b/block/copy-on-read.c
index a2d92ac394..c857ea0da7 100644
--- a/block/copy-on-read.c
+++ b/block/copy-on-read.c
@@ -28,8 +28,9 @@
static int cor_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false,
- errp);
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_of_bds,
+ BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY,
+ false, errp);
if (!bs->file) {
return -EINVAL;
}
diff --git a/block/replication.c b/block/replication.c
index 9ca5c9368e..ec512ae1c3 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -90,7 +90,8 @@ static int replication_open(BlockDriverState *bs, QDict
*options,
const char *mode;
const char *top_id;
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_of_bds,
+ BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY,
false, errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/throttle.c b/block/throttle.c
index 2dea913be7..47b0a3522d 100644
--- a/block/throttle.c
+++ b/block/throttle.c
@@ -81,8 +81,9 @@ static int throttle_open(BlockDriverState *bs, QDict *options,
char *group;
int ret;
- bs->file = bdrv_open_child(NULL, options, "file", bs,
- &child_file, 0, false, errp);
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_of_bds,
+ BDRV_CHILD_FILTERED | BDRV_CHILD_PRIMARY,
+ false, errp);
if (!bs->file) {
return -EINVAL;
}
--
2.23.0
- [PATCH for-5.0 11/31] block: Add child_of_bds, (continued)
- [PATCH for-5.0 11/31] block: Add child_of_bds, Max Reitz, 2019/11/27
- [PATCH for-5.0 10/31] block: Unify bdrv_child_cb_detach(), Max Reitz, 2019/11/27
- [PATCH for-5.0 15/31] block: Split bdrv_default_perms_for_storage(), Max Reitz, 2019/11/27
- [PATCH for-5.0 13/31] block: Pull out bdrv_default_perms_for_backing(), Max Reitz, 2019/11/27
- [PATCH for-5.0 14/31] block: Pull out bdrv_default_perms_for_storage(), Max Reitz, 2019/11/27
- [PATCH for-5.0 16/31] block: Add bdrv_default_perms(), Max Reitz, 2019/11/27
- [PATCH for-5.0 17/31] raw-format: Split raw_read_options(), Max Reitz, 2019/11/27
- [PATCH for-5.0 19/31] block: Drop child_format, Max Reitz, 2019/11/27
- [PATCH for-5.0 20/31] block: Make backing files child_of_bds children, Max Reitz, 2019/11/27
- [PATCH for-5.0 21/31] block: Drop child_backing, Max Reitz, 2019/11/27
- [PATCH for-5.0 23/31] block: Make filter drivers use child_of_bds,
Max Reitz <=
- [PATCH for-5.0 22/31] block: Make format drivers use child_of_bds, Max Reitz, 2019/11/27
- [PATCH for-5.0 24/31] block: Use child_of_bds in remaining places, Max Reitz, 2019/11/27
- [PATCH for-5.0 25/31] tests: Use child_of_bds instead of child_file, Max Reitz, 2019/11/27
- [PATCH for-5.0 27/31] block: Make bdrv_filter_default_perms() static, Max Reitz, 2019/11/27
- [PATCH for-5.0 26/31] block: Use bdrv_default_perms(), Max Reitz, 2019/11/27
- [PATCH for-5.0 28/31] block: Drop bdrv_format_default_perms(), Max Reitz, 2019/11/27
- [PATCH for-5.0 31/31] block: Drop @child_class from bdrv_child_perm(), Max Reitz, 2019/11/27
- [PATCH for-5.0 30/31] block: Pass BdrvChildRole in remaining cases, Max Reitz, 2019/11/27
- [PATCH for-5.0 29/31] block: Drop child_file, Max Reitz, 2019/11/27
- [PATCH for-5.0 18/31] block: Switch child_format users to child_of_bds, Max Reitz, 2019/11/27