Commit 262b4e8f authored by Max Reitz's avatar Max Reitz Committed by Kevin Wolf
Browse files

block: Add bdrv_next_monitor_owned()



Add a function for iterating over all monitor-owned BlockDriverStates so
the generic block layer can do so.

Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent fe1a9cbc
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -723,6 +723,13 @@ void blockdev_close_all_bdrv_states(void)
    }
}

/* Iterates over the list of monitor-owned BlockDriverStates */
BlockDriverState *bdrv_next_monitor_owned(BlockDriverState *bs)
{
    return bs ? QTAILQ_NEXT(bs, monitor_list)
              : QTAILQ_FIRST(&monitor_bdrv_states);
}

static void qemu_opt_rename(QemuOpts *opts, const char *from, const char *to,
                            Error **errp)
{
+1 −0
Original line number Diff line number Diff line
@@ -412,6 +412,7 @@ BlockDriverState *bdrv_lookup_bs(const char *device,
bool bdrv_chain_contains(BlockDriverState *top, BlockDriverState *base);
BlockDriverState *bdrv_next_node(BlockDriverState *bs);
BlockDriverState *bdrv_next(BlockDriverState *bs);
BlockDriverState *bdrv_next_monitor_owned(BlockDriverState *bs);
int bdrv_is_encrypted(BlockDriverState *bs);
int bdrv_key_required(BlockDriverState *bs);
int bdrv_set_key(BlockDriverState *bs, const char *key);
+1 −0
Original line number Diff line number Diff line
stub-obj-y += arch-query-cpu-def.o
stub-obj-y += bdrv-next-monitor-owned.o
stub-obj-y += blk-commit-all.o
stub-obj-y += blockdev-close-all-bdrv-states.o
stub-obj-y += clock-warp.o
+8 −0
Original line number Diff line number Diff line
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "block/block.h"

BlockDriverState *bdrv_next_monitor_owned(BlockDriverState *bs)
{
    return NULL;
}