[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 12/15] block: Remove flags parameter from bdrv_re
From: |
Alberto Garcia |
Subject: |
[Qemu-devel] [PATCH v3 12/15] block: Remove flags parameter from bdrv_reopen_queue() |
Date: |
Fri, 19 Oct 2018 15:24:43 +0300 |
Now that all callers are passing all flag changes as QDict options,
the flags parameter is no longer necessary, so we can get rid of it.
Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
block.c | 5 +++--
block/replication.c | 6 ++----
include/block/block.h | 3 +--
qemu-io-cmds.c | 2 +-
4 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/block.c b/block.c
index edb880a66b..c142773358 100644
--- a/block.c
+++ b/block.c
@@ -3005,8 +3005,9 @@ static BlockReopenQueue
*bdrv_reopen_queue_child(BlockReopenQueue *bs_queue,
BlockReopenQueue *bdrv_reopen_queue(BlockReopenQueue *bs_queue,
BlockDriverState *bs,
- QDict *options, int flags)
+ QDict *options)
{
+ int flags = bdrv_get_flags(bs);
return bdrv_reopen_queue_child(bs_queue, bs, options, flags,
NULL, NULL, 0);
}
@@ -3080,7 +3081,7 @@ int bdrv_reopen_set_read_only(BlockDriverState *bs, bool
read_only,
qdict_put_bool(opts, BDRV_OPT_READ_ONLY, read_only);
bdrv_subtree_drained_begin(bs);
- queue = bdrv_reopen_queue(NULL, bs, opts, bdrv_get_flags(bs));
+ queue = bdrv_reopen_queue(NULL, bs, opts);
ret = bdrv_reopen_multiple(bdrv_get_aio_context(bs), queue, errp);
bdrv_subtree_drained_end(bs);
diff --git a/block/replication.c b/block/replication.c
index 481a225924..fdbfe47fa4 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -393,19 +393,17 @@ static void reopen_backing_file(BlockDriverState *bs,
bool writable,
bdrv_subtree_drained_begin(s->secondary_disk->bs);
if (s->orig_hidden_read_only) {
- int flags = bdrv_get_flags(s->hidden_disk->bs);
QDict *opts = qdict_new();
qdict_put_bool(opts, BDRV_OPT_READ_ONLY, !writable);
reopen_queue = bdrv_reopen_queue(reopen_queue, s->hidden_disk->bs,
- opts, flags);
+ opts);
}
if (s->orig_secondary_read_only) {
- int flags = bdrv_get_flags(s->secondary_disk->bs);
QDict *opts = qdict_new();
qdict_put_bool(opts, BDRV_OPT_READ_ONLY, !writable);
reopen_queue = bdrv_reopen_queue(reopen_queue, s->secondary_disk->bs,
- opts, flags);
+ opts);
}
if (reopen_queue) {
diff --git a/include/block/block.h b/include/block/block.h
index 3649136689..38d5c1adf4 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -297,8 +297,7 @@ BlockDriverState *bdrv_open(const char *filename, const
char *reference,
BlockDriverState *bdrv_new_open_driver(BlockDriver *drv, const char *node_name,
int flags, Error **errp);
BlockReopenQueue *bdrv_reopen_queue(BlockReopenQueue *bs_queue,
- BlockDriverState *bs,
- QDict *options, int flags);
+ BlockDriverState *bs, QDict *options);
int bdrv_reopen_multiple(AioContext *ctx, BlockReopenQueue *bs_queue, Error
**errp);
int bdrv_reopen_set_read_only(BlockDriverState *bs, bool read_only,
Error **errp);
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index b49a816cc8..e272e5c80b 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -2075,7 +2075,7 @@ static int reopen_f(BlockBackend *blk, int argc, char
**argv)
}
bdrv_subtree_drained_begin(bs);
- brq = bdrv_reopen_queue(NULL, bs, opts, flags);
+ brq = bdrv_reopen_queue(NULL, bs, opts);
bdrv_reopen_multiple(bdrv_get_aio_context(bs), brq, &local_err);
bdrv_subtree_drained_end(bs);
--
2.11.0
- [Qemu-devel] [PATCH v3 00/15] Don't pass flags to bdrv_reopen_queue(), Alberto Garcia, 2018/10/19
- [Qemu-devel] [PATCH v3 11/15] block: Clean up reopen_backing_file() in block/replication.c, Alberto Garcia, 2018/10/19
- [Qemu-devel] [PATCH v3 15/15] block: Assert that flags are up-to-date in bdrv_reopen_prepare(), Alberto Garcia, 2018/10/19
- [Qemu-devel] [PATCH v3 04/15] block: Use bdrv_reopen_set_read_only() in bdrv_commit(), Alberto Garcia, 2018/10/19
- [Qemu-devel] [PATCH v3 02/15] block: Use bdrv_reopen_set_read_only() in bdrv_backing_update_filename(), Alberto Garcia, 2018/10/19
- [Qemu-devel] [PATCH v3 07/15] block: Use bdrv_reopen_set_read_only() in external_snapshot_commit(), Alberto Garcia, 2018/10/19
- [Qemu-devel] [PATCH v3 08/15] block: Use bdrv_reopen_set_read_only() in the mirror driver, Alberto Garcia, 2018/10/19
- [Qemu-devel] [PATCH v3 01/15] block: Add bdrv_reopen_set_read_only(), Alberto Garcia, 2018/10/19
- [Qemu-devel] [PATCH v3 10/15] qemu-io: Put flag changes in the options QDict in reopen_f(), Alberto Garcia, 2018/10/19
- [Qemu-devel] [PATCH v3 13/15] block: Stop passing flags to bdrv_reopen_queue_child(), Alberto Garcia, 2018/10/19
- [Qemu-devel] [PATCH v3 12/15] block: Remove flags parameter from bdrv_reopen_queue(),
Alberto Garcia <=
- [Qemu-devel] [PATCH v3 09/15] block: Drop bdrv_reopen(), Alberto Garcia, 2018/10/19
- [Qemu-devel] [PATCH v3 03/15] block: Use bdrv_reopen_set_read_only() in commit_start/complete(), Alberto Garcia, 2018/10/19
- [Qemu-devel] [PATCH v3 14/15] block: Remove assertions from update_flags_from_options(), Alberto Garcia, 2018/10/19
- [Qemu-devel] [PATCH v3 06/15] block: Use bdrv_reopen_set_read_only() in qmp_change_backing_file(), Alberto Garcia, 2018/10/19
- [Qemu-devel] [PATCH v3 05/15] block: Use bdrv_reopen_set_read_only() in stream_start/complete(), Alberto Garcia, 2018/10/19