[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 16/29] block: Introduce parents list
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 16/29] block: Introduce parents list |
Date: |
Fri, 16 Oct 2015 17:06:01 +0200 |
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
block.c | 3 +++
include/block/block_int.h | 2 ++
2 files changed, 5 insertions(+)
diff --git a/block.c b/block.c
index a2d6238..980437f 100644
--- a/block.c
+++ b/block.c
@@ -1090,6 +1090,7 @@ static BdrvChild *bdrv_attach_child(BlockDriverState
*parent_bs,
};
QLIST_INSERT_HEAD(&parent_bs->children, child, next);
+ QLIST_INSERT_HEAD(&child_bs->parents, child, next_parent);
return child;
}
@@ -1097,6 +1098,7 @@ static BdrvChild *bdrv_attach_child(BlockDriverState
*parent_bs,
void bdrv_detach_child(BdrvChild *child)
{
QLIST_REMOVE(child, next);
+ QLIST_REMOVE(child, next_parent);
g_free(child);
}
@@ -2038,6 +2040,7 @@ static void bdrv_move_reference_fields(BlockDriverState
*bs_dest,
/* keep the same entry in bdrv_states */
bs_dest->device_list = bs_src->device_list;
bs_dest->blk = bs_src->blk;
+ bs_dest->parents = bs_src->parents;
memcpy(bs_dest->op_blockers, bs_src->op_blockers,
sizeof(bs_dest->op_blockers));
diff --git a/include/block/block_int.h b/include/block/block_int.h
index cfcae52..52ea7c0 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -339,6 +339,7 @@ struct BdrvChild {
BlockDriverState *bs;
const BdrvChildRole *role;
QLIST_ENTRY(BdrvChild) next;
+ QLIST_ENTRY(BdrvChild) next_parent;
};
/*
@@ -445,6 +446,7 @@ struct BlockDriverState {
* parent node of this node. */
BlockDriverState *inherits_from;
QLIST_HEAD(, BdrvChild) children;
+ QLIST_HEAD(, BdrvChild) parents;
QDict *options;
BlockdevDetectZeroesOptions detect_zeroes;
--
1.8.3.1
- [Qemu-devel] [PULL 02/29] throttle: test that snapshots move the throttling configuration, (continued)
- [Qemu-devel] [PULL 02/29] throttle: test that snapshots move the throttling configuration, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 03/29] qmp-commands.hx: Update the supported 'transaction' operations, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 05/29] block: Introduce BDS.file_child, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 06/29] vmdk: Use BdrvChild instead of BDS for references to extents, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 04/29] block: qemu-iotests - fix vmdk test 059.out, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 07/29] blkverify: Convert s->test_file to BdrvChild, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 10/29] block: Remove bdrv_open_image(), Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 13/29] block: Split bdrv_move_feature_fields(), Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 08/29] quorum: Convert to BdrvChild, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 14/29] block/io: Make bdrv_requests_pending() public, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 16/29] block: Introduce parents list,
Kevin Wolf <=
- [Qemu-devel] [PULL 18/29] blockjob: Store device name at job creation, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 11/29] block: Convert bs->backing_hd to BdrvChild, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 15/29] block-backend: Add blk_set_bs(), Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 17/29] block: Implement bdrv_append() without bdrv_swap(), Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 12/29] block: Manage backing file references in bdrv_set_backing_hd(), Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 21/29] block: Allow bdrv_unref_child(bs, NULL), Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 20/29] block: Remove bdrv_swap(), Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 22/29] blkverify: Fix BDS leak in .bdrv_open error path, Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 19/29] block: Add and use bdrv_replace_in_backing_chain(), Kevin Wolf, 2015/10/16
- [Qemu-devel] [PULL 23/29] util - add automated ID generation utility, Kevin Wolf, 2015/10/16