aboutsummaryrefslogtreecommitdiff
path: root/include/block
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2015-04-09 18:47:50 +0200
committerKevin Wolf <kwolf@redhat.com>2015-06-12 17:04:59 +0200
commitbddcec3745b0220d4a7eda700950812a94398668 (patch)
treef4e0ba8a6adeac54ff4dc160ce6f4e7904690a33 /include/block
parent6e93e7c41fdfdee3068770cae79380e1d986b76a (diff)
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 <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/block_int.h4
1 files changed, 4 insertions, 0 deletions
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;