[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/73] block: Add bdrv_next_node
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 01/73] block: Add bdrv_next_node |
Date: |
Wed, 10 Dec 2014 11:33:27 +0100 |
From: Fam Zheng <address@hidden>
Similar to bdrv_next, this traverses through graph_bdrv_states. Will be
useful to enumerate all the named nodes.
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block.c | 8 ++++++++
include/block/block.h | 1 +
2 files changed, 9 insertions(+)
diff --git a/block.c b/block.c
index a612594..e8a0342 100644
--- a/block.c
+++ b/block.c
@@ -3801,6 +3801,14 @@ bool bdrv_chain_contains(BlockDriverState *top,
BlockDriverState *base)
return top != NULL;
}
+BlockDriverState *bdrv_next_node(BlockDriverState *bs)
+{
+ if (!bs) {
+ return QTAILQ_FIRST(&graph_bdrv_states);
+ }
+ return QTAILQ_NEXT(bs, node_list);
+}
+
BlockDriverState *bdrv_next(BlockDriverState *bs)
{
if (!bs) {
diff --git a/include/block/block.h b/include/block/block.h
index 5450610..c3a68d8 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -374,6 +374,7 @@ BlockDriverState *bdrv_lookup_bs(const char *device,
const char *node_name,
Error **errp);
bool bdrv_chain_contains(BlockDriverState *top, BlockDriverState *base);
+BlockDriverState *bdrv_next_node(BlockDriverState *bs);
BlockDriverState *bdrv_next(BlockDriverState *bs);
int bdrv_is_encrypted(BlockDriverState *bs);
int bdrv_key_required(BlockDriverState *bs);
--
1.8.3.1
- [Qemu-devel] [PULL 00/73] Merging block-next for 2.3, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 01/73] block: Add bdrv_next_node,
Kevin Wolf <=
- [Qemu-devel] [PULL 06/73] chardev: Add -qmp-pretty, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 07/73] iotests: _filter_qmp for pretty JSON output, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 09/73] blockdev: acquire AioContext in blockdev-snapshot-delete-internal-sync, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 02/73] block: Add bdrv_get_node_name, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 11/73] blockdev: acquire AioContext in eject, change, and block_passwd, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 03/73] block: Include "node-name" if present in query-blockstats, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 15/73] block/hmp: Allow info = NULL in print_block_info(), Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 13/73] block/qapi: Add cache information to query-block, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 10/73] blockdev: check for BLOCK_OP_TYPE_INTERNAL_SNAPSHOT_DELETE, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 14/73] block/hmp: Factor out print_block_info(), Kevin Wolf, 2014/12/10