From bddcec3745b0220d4a7eda700950812a94398668 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 9 Apr 2015 18:47:50 +0200 Subject: block: Add BlockDriverState.inherits_from Currently, the block layer assumes that any block node can have only one parent, and if it has a parent, that it inherits some options/flags from this parent. This is not true any more: With references used in block device creation, a single node can be used by multiple parents, or it can be created separately and not inherit flags from any parent. To handle reopens correctly, a node must know from which parent it inherited options. This patch adds the information to BlockDriverState. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max Reitz --- include/block/block_int.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/block') diff --git a/include/block/block_int.h b/include/block/block_int.h index 4ae58606a6..2732ccdaae 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -437,6 +437,10 @@ struct BlockDriverState { /* long-running background operation */ BlockJob *job; + /* The node that this node inherited default options from (and a reopen on + * which can affect this node by changing these defaults). This is always a + * parent node of this node. */ + BlockDriverState *inherits_from; QLIST_HEAD(, BdrvChild) children; QDict *options; -- cgit v1.2.3