From 9a4f4c31563b96a075f3deae83e72c726e0c84f8 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 16 Jun 2015 14:19:22 +0200 Subject: block: Convert bs->file to BdrvChild This patch removes the temporary duplication between bs->file and bs->file_child by converting everything to BdrvChild. Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Fam Zheng Reviewed-by: Stefan Hajnoczi --- include/block/block.h | 8 +++++++- include/block/block_int.h | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/block/block.h b/include/block/block.h index 2dd6630..c5d9620 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -585,7 +585,13 @@ typedef enum { BLKDBG_EVENT_MAX, } BlkDebugEvent; -#define BLKDBG_EVENT(bs, evt) bdrv_debug_event(bs, evt) +#define BLKDBG_EVENT(child, evt) \ + do { \ + if (child) { \ + bdrv_debug_event(child->bs, evt); \ + } \ + } while (0) + void bdrv_debug_event(BlockDriverState *bs, BlkDebugEvent event); int bdrv_debug_breakpoint(BlockDriverState *bs, const char *event, diff --git a/include/block/block_int.h b/include/block/block_int.h index d0dd93e..98936c9 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -380,8 +380,7 @@ struct BlockDriverState { BlockDriverState *backing_hd; BdrvChild *backing_child; - BlockDriverState *file; - BdrvChild *file_child; + BdrvChild *file; NotifierList close_notifiers; -- cgit v1.1