aboutsummaryrefslogtreecommitdiff
path: root/include/block
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2015-06-17 14:55:21 +0200
committerKevin Wolf <kwolf@redhat.com>2015-10-16 15:34:29 +0200
commit760e006384ecd5b8b8b1b91b5c85ff8fdcb3a21f (patch)
tree506ef3c27944a2f97069327493f875a2def3d90a /include/block
parentb26e90f56ad3a494ee6337d2075f4dc55b62b3c6 (diff)
block: Convert bs->backing_hd to BdrvChild
This is the final step in converting all of the BlockDriverState pointers that block drivers use to BdrvChild. After this patch, bs->children contains the full list of child nodes that are referenced by a given BDS, and these children are only referenced through BdrvChild, so that updating the pointer in there is enough for changing edges in the graph. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/block_int.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 98936c9b16..90971c05bf 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -378,8 +378,7 @@ struct BlockDriverState {
QDict *full_open_options;
char exact_filename[PATH_MAX];
- BlockDriverState *backing_hd;
- BdrvChild *backing_child;
+ BdrvChild *backing;
BdrvChild *file;
NotifierList close_notifiers;
@@ -458,6 +457,11 @@ struct BlockDriverState {
NotifierWithReturn write_threshold_notifier;
};
+static inline BlockDriverState *backing_bs(BlockDriverState *bs)
+{
+ return bs->backing ? bs->backing->bs : NULL;
+}
+
/* Essential block drivers which must always be statically linked into qemu, and
* which therefore can be accessed without using bdrv_find_format() */
@@ -496,7 +500,7 @@ void bdrv_add_before_write_notifier(BlockDriverState *bs,
*
* May be called from .bdrv_detach_aio_context() to detach children from the
* current #AioContext. This is only needed by block drivers that manage their
- * own children. Both ->file and ->backing_hd are automatically handled and
+ * own children. Both ->file and ->backing are automatically handled and
* block drivers should not call this function on them explicitly.
*/
void bdrv_detach_aio_context(BlockDriverState *bs);
@@ -506,7 +510,7 @@ void bdrv_detach_aio_context(BlockDriverState *bs);
*
* May be called from .bdrv_attach_aio_context() to attach children to the new
* #AioContext. This is only needed by block drivers that manage their own
- * children. Both ->file and ->backing_hd are automatically handled and block
+ * children. Both ->file and ->backing are automatically handled and block
* drivers should not call this function on them explicitly.
*/
void bdrv_attach_aio_context(BlockDriverState *bs,