Commit 2e891722 authored by Alberto Garcia's avatar Alberto Garcia Committed by Kevin Wolf
Browse files

block: Remove flags parameter from bdrv_reopen_queue()



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: default avatarAlberto Garcia <berto@igalia.com>
Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent 3c4e9647
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -3060,8 +3060,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);
}
@@ -3135,7 +3136,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);

+2 −4
Original line number Diff line number Diff line
@@ -371,19 +371,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) {
+1 −2
Original line number Diff line number Diff line
@@ -299,8 +299,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);
+1 −1
Original line number Diff line number Diff line
@@ -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);