aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2020-05-13 13:05:15 +0200
committerKevin Wolf <kwolf@redhat.com>2020-05-18 19:05:25 +0200
commit258b776515cc812a26783ffab98b31aa8eb008d4 (patch)
tree3df593bc8ca2c86359f344d8cbec11de7c672d98 /block
parent3284bcf430a1d42885c184de73df52fcfd86d589 (diff)
block: Add BdrvChildRole to BdrvChild
For now, it is always set to 0. Later patches in this series will ensure that all callers pass an appropriate combination of flags. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200513110544.176672-6-mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/backup-top.c3
-rw-r--r--block/blkdebug.c2
-rw-r--r--block/blklogwrites.c6
-rw-r--r--block/blkreplay.c2
-rw-r--r--block/blkverify.c4
-rw-r--r--block/block-backend.c4
-rw-r--r--block/bochs.c2
-rw-r--r--block/cloop.c2
-rw-r--r--block/copy-on-read.c2
-rw-r--r--block/crypto.c2
-rw-r--r--block/dmg.c2
-rw-r--r--block/filter-compress.c2
-rw-r--r--block/parallels.c2
-rw-r--r--block/qcow.c2
-rw-r--r--block/qcow2.c6
-rw-r--r--block/qed.c2
-rw-r--r--block/quorum.c4
-rw-r--r--block/raw-format.c2
-rw-r--r--block/replication.c2
-rw-r--r--block/throttle.c2
-rw-r--r--block/vdi.c2
-rw-r--r--block/vhdx.c2
-rw-r--r--block/vmdk.c4
-rw-r--r--block/vpc.c2
-rw-r--r--block/vvfat.c2
25 files changed, 34 insertions, 33 deletions
diff --git a/block/backup-top.c b/block/backup-top.c
index 282845a410..f891dd7838 100644
--- a/block/backup-top.c
+++ b/block/backup-top.c
@@ -214,7 +214,8 @@ BlockDriverState *bdrv_backup_top_append(BlockDriverState *source,
source->supported_zero_flags);
bdrv_ref(target);
- state->target = bdrv_attach_child(top, target, "target", &child_file, errp);
+ state->target = bdrv_attach_child(top, target, "target", &child_file, 0,
+ errp);
if (!state->target) {
bdrv_unref(target);
bdrv_unref(top);
diff --git a/block/blkdebug.c b/block/blkdebug.c
index f369d54ee4..c91e78d5c8 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -497,7 +497,7 @@ 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, false, &local_err);
+ bs, &child_file, 0, false, &local_err);
if (local_err) {
ret = -EINVAL;
error_propagate(errp, local_err);
diff --git a/block/blklogwrites.c b/block/blklogwrites.c
index f3b3259d8d..739db6dcf6 100644
--- a/block/blklogwrites.c
+++ b/block/blklogwrites.c
@@ -157,7 +157,7 @@ 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, false,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0, false,
&local_err);
if (local_err) {
ret = -EINVAL;
@@ -166,8 +166,8 @@ static int blk_log_writes_open(BlockDriverState *bs, QDict *options, int flags,
}
/* Open the log file */
- s->log_file = bdrv_open_child(NULL, options, "log", bs, &child_file, false,
- &local_err);
+ s->log_file = bdrv_open_child(NULL, options, "log", bs, &child_file, 0,
+ false, &local_err);
if (local_err) {
ret = -EINVAL;
error_propagate(errp, local_err);
diff --git a/block/blkreplay.c b/block/blkreplay.c
index 131c9e8477..9b2814fc58 100644
--- a/block/blkreplay.c
+++ b/block/blkreplay.c
@@ -28,7 +28,7 @@ static int blkreplay_open(BlockDriverState *bs, QDict *options, int flags,
/* Open the image file */
bs->file = bdrv_open_child(NULL, options, "image",
- bs, &child_file, false, &local_err);
+ bs, &child_file, 0, false, &local_err);
if (local_err) {
ret = -EINVAL;
error_propagate(errp, local_err);
diff --git a/block/blkverify.c b/block/blkverify.c
index ba6b1853ae..ba4f6d7b7c 100644
--- a/block/blkverify.c
+++ b/block/blkverify.c
@@ -125,7 +125,7 @@ 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, false, &local_err);
+ bs, &child_file, 0, false, &local_err);
if (local_err) {
ret = -EINVAL;
error_propagate(errp, local_err);
@@ -134,7 +134,7 @@ 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, false,
+ "test", bs, &child_format, 0, false,
&local_err);
if (local_err) {
ret = -EINVAL;
diff --git a/block/block-backend.c b/block/block-backend.c
index c0af79147a..efc7acb3d8 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -423,7 +423,7 @@ BlockBackend *blk_new_open(const char *filename, const char *reference,
return NULL;
}
- blk->root = bdrv_root_attach_child(bs, "root", &child_root, blk->ctx,
+ blk->root = bdrv_root_attach_child(bs, "root", &child_root, 0, blk->ctx,
perm, BLK_PERM_ALL, blk, errp);
if (!blk->root) {
blk_unref(blk);
@@ -834,7 +834,7 @@ int blk_insert_bs(BlockBackend *blk, BlockDriverState *bs, Error **errp)
{
ThrottleGroupMember *tgm = &blk->public.throttle_group_member;
bdrv_ref(bs);
- blk->root = bdrv_root_attach_child(bs, "root", &child_root, blk->ctx,
+ blk->root = bdrv_root_attach_child(bs, "root", &child_root, 0, blk->ctx,
blk->perm, blk->shared_perm, blk, errp);
if (blk->root == NULL) {
return -EPERM;
diff --git a/block/bochs.c b/block/bochs.c
index e7bbeaa1c4..b013e73063 100644
--- a/block/bochs.c
+++ b/block/bochs.c
@@ -110,7 +110,7 @@ static int bochs_open(BlockDriverState *bs, QDict *options, int flags,
return ret;
}
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false, errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/cloop.c b/block/cloop.c
index f90f1a4b4c..3ed9fa63cc 100644
--- a/block/cloop.c
+++ b/block/cloop.c
@@ -71,7 +71,7 @@ static int cloop_open(BlockDriverState *bs, QDict *options, int flags,
return ret;
}
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false, errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/copy-on-read.c b/block/copy-on-read.c
index 7504ca6ffc..a2c4e6dc58 100644
--- a/block/copy-on-read.c
+++ b/block/copy-on-read.c
@@ -28,7 +28,7 @@
static int cor_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, false,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0, false,
errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/crypto.c b/block/crypto.c
index bdb2b27475..8b516bfee2 100644
--- a/block/crypto.c
+++ b/block/crypto.c
@@ -218,7 +218,7 @@ static int block_crypto_open_generic(QCryptoBlockFormat format,
unsigned int cflags = 0;
QDict *cryptoopts = NULL;
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false, errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/dmg.c b/block/dmg.c
index ef3c6e771d..af8188638c 100644
--- a/block/dmg.c
+++ b/block/dmg.c
@@ -439,7 +439,7 @@ static int dmg_open(BlockDriverState *bs, QDict *options, int flags,
return ret;
}
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false, errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/filter-compress.c b/block/filter-compress.c
index 82c315b298..4dc5f9fb8c 100644
--- a/block/filter-compress.c
+++ b/block/filter-compress.c
@@ -30,7 +30,7 @@
static int compress_open(BlockDriverState *bs, QDict *options, int flags,
Error **errp)
{
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, false,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0, false,
errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/parallels.c b/block/parallels.c
index bd5f6ffa09..9855ac1162 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -739,7 +739,7 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
Error *local_err = NULL;
char *buf;
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false, errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/qcow.c b/block/qcow.c
index 6a72dea049..13583f0339 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -130,7 +130,7 @@ static int qcow_open(BlockDriverState *bs, QDict *options, int flags,
qdict_extract_subqdict(options, &encryptopts, "encrypt.");
encryptfmt = qdict_get_try_str(encryptopts, "format");
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false, errp);
if (!bs->file) {
ret = -EINVAL;
diff --git a/block/qcow2.c b/block/qcow2.c
index 76bec61ee9..86335d9403 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1591,7 +1591,7 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
/* Open external data file */
s->data_file = bdrv_open_child(NULL, options, "data-file", bs, &child_file,
- true, &local_err);
+ 0, true, &local_err);
if (local_err) {
error_propagate(errp, local_err);
ret = -EINVAL;
@@ -1601,7 +1601,7 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options,
if (s->incompatible_features & QCOW2_INCOMPAT_DATA_FILE) {
if (!s->data_file && s->image_data_file) {
s->data_file = bdrv_open_child(s->image_data_file, options,
- "data-file", bs, &child_file,
+ "data-file", bs, &child_file, 0,
false, errp);
if (!s->data_file) {
ret = -EINVAL;
@@ -1863,7 +1863,7 @@ static int qcow2_open(BlockDriverState *bs, QDict *options, int flags,
.ret = -EINPROGRESS
};
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false, errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/qed.c b/block/qed.c
index 337eb6dbb6..1ad2aba810 100644
--- a/block/qed.c
+++ b/block/qed.c
@@ -547,7 +547,7 @@ static int bdrv_qed_open(BlockDriverState *bs, QDict *options, int flags,
.ret = -EINPROGRESS
};
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false, errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/quorum.c b/block/quorum.c
index a0824c300d..024de76e6f 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -977,7 +977,7 @@ 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, false, &local_err);
+ &child_format, 0, false, &local_err);
if (local_err) {
ret = -EINVAL;
goto close_exit;
@@ -1053,7 +1053,7 @@ 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, errp);
+ child = bdrv_attach_child(bs, child_bs, indexstr, &child_format, 0, errp);
if (child == NULL) {
s->next_child_index--;
goto out;
diff --git a/block/raw-format.c b/block/raw-format.c
index 00e13bb41e..4b8d4ce8be 100644
--- a/block/raw-format.c
+++ b/block/raw-format.c
@@ -428,7 +428,7 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,
BDRVRawState *s = bs->opaque;
int ret;
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false, errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/replication.c b/block/replication.c
index af428c5b66..052c7ef601 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -90,7 +90,7 @@ 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,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false, errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/throttle.c b/block/throttle.c
index 71f4bb0ad1..2dea913be7 100644
--- a/block/throttle.c
+++ b/block/throttle.c
@@ -82,7 +82,7 @@ static int throttle_open(BlockDriverState *bs, QDict *options,
int ret;
bs->file = bdrv_open_child(NULL, options, "file", bs,
- &child_file, false, errp);
+ &child_file, 0, false, errp);
if (!bs->file) {
return -EINVAL;
}
diff --git a/block/vdi.c b/block/vdi.c
index 0ef733ae19..653acb5fc1 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -378,7 +378,7 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags,
Error *local_err = NULL;
QemuUUID uuid_link, uuid_parent;
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false, errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/vhdx.c b/block/vhdx.c
index e692cf80cc..dde156c97b 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -996,7 +996,7 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags,
uint64_t signature;
Error *local_err = NULL;
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false, errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/vmdk.c b/block/vmdk.c
index 56e85689f3..c2cb741e2d 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1152,7 +1152,7 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
assert(ret < 32);
extent_file = bdrv_open_child(extent_path, options, extent_opt_prefix,
- bs, &child_file, false, &local_err);
+ bs, &child_file, 0, false, &local_err);
g_free(extent_path);
if (local_err) {
error_propagate(errp, local_err);
@@ -1257,7 +1257,7 @@ static int vmdk_open(BlockDriverState *bs, QDict *options, int flags,
uint32_t magic;
Error *local_err = NULL;
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false, errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/vpc.c b/block/vpc.c
index 46a2d48659..b2a86074a5 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -228,7 +228,7 @@ static int vpc_open(BlockDriverState *bs, QDict *options, int flags,
int ret;
int64_t bs_size;
- bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file,
+ bs->file = bdrv_open_child(NULL, options, "file", bs, &child_file, 0,
false, errp);
if (!bs->file) {
return -EINVAL;
diff --git a/block/vvfat.c b/block/vvfat.c
index f845d9b485..cd8ae50a2c 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -3183,7 +3183,7 @@ static int enable_write_target(BlockDriverState *bs, Error **errp)
options = qdict_new();
qdict_put_str(options, "write-target.driver", "qcow");
s->qcow = bdrv_open_child(s->qcow_filename, options, "write-target", bs,
- &child_vvfat_qcow, false, errp);
+ &child_vvfat_qcow, 0, false, errp);
qobject_unref(options);
if (!s->qcow) {
ret = -EINVAL;