]> Git Repo - qemu.git/commitdiff
block: Add bdrv_next_monitor_owned()
authorMax Reitz <[email protected]>
Wed, 16 Mar 2016 18:54:41 +0000 (19:54 +0100)
committerKevin Wolf <[email protected]>
Thu, 17 Mar 2016 14:47:56 +0000 (15:47 +0100)
Add a function for iterating over all monitor-owned BlockDriverStates so
the generic block layer can do so.

Signed-off-by: Max Reitz <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
blockdev.c
include/block/block.h
stubs/Makefile.objs
stubs/bdrv-next-monitor-owned.c [new file with mode: 0644]

index b6d24449e36e5ed16090ec24bcf334a90234aaec..a5df7e7590526e452ed23e8accd30dbd5714e3c3 100644 (file)
@@ -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)
 {
index ea5be0f46c4fc5f9140802023e6160d7c82080d4..09272c3e7734aeeb3cff9274ad50077626cb151d 100644 (file)
@@ -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);
index 9d9f1d037bd5c79843ffdea460e64697255152cf..b6d1e650db934a685ebdacfe03ea19a9d0768c97 100644 (file)
@@ -1,4 +1,5 @@
 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
diff --git a/stubs/bdrv-next-monitor-owned.c b/stubs/bdrv-next-monitor-owned.c
new file mode 100644 (file)
index 0000000..2acf6c3
--- /dev/null
@@ -0,0 +1,8 @@
+#include "qemu/osdep.h"
+#include "qemu-common.h"
+#include "block/block.h"
+
+BlockDriverState *bdrv_next_monitor_owned(BlockDriverState *bs)
+{
+    return NULL;
+}
This page took 0.048363 seconds and 4 git commands to generate.