block: Add BlockDriverState.inherits_from
authorKevin Wolf <kwolf@redhat.com>
Thu, 9 Apr 2015 16:47:50 +0000 (18:47 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 12 Jun 2015 15:04:59 +0000 (17:04 +0200)
commitbddcec3745b0220d4a7eda700950812a94398668
treef4e0ba8a6adeac54ff4dc160ce6f4e7904690a33
parent6e93e7c41fdfdee3068770cae79380e1d986b76a
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>
block.c
include/block/block_int.h