diff options
author | Jeff Cody <jcody@redhat.com> | 2012-09-27 13:29:12 -0400 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2012-09-28 18:22:44 +0200 |
commit | 6ebdcee2d8e9e4b41ffe4e49039927550848b926 (patch) | |
tree | d2ad525e92390b4ce29433f52dfdc8d64ae3e261 /block.h | |
parent | 8d6d89cb63c57569864ecdeb84d3a1c2ebd031cc (diff) |
block: add support functions for live commit, to find and delete images.
Add bdrv_find_overlay(), and bdrv_drop_intermediate().
bdrv_find_overlay(): given 'bs' and the active (topmost) BDS of an image chain,
find the image that is the immediate top of 'bs'
bdrv_drop_intermediate():
Given 3 BDS (active, top, base), drop images above
base up to and including top, and set base to be the
backing file of top's overlay node.
E.g., this converts:
bottom <- base <- intermediate <- top <- active
to
bottom <- base <- active
Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.h')
-rw-r--r-- | block.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -203,6 +203,10 @@ int bdrv_commit_all(void); int bdrv_change_backing_file(BlockDriverState *bs, const char *backing_file, const char *backing_fmt); void bdrv_register(BlockDriver *bdrv); +int bdrv_drop_intermediate(BlockDriverState *active, BlockDriverState *top, + BlockDriverState *base); +BlockDriverState *bdrv_find_overlay(BlockDriverState *active, + BlockDriverState *bs); typedef struct BdrvCheckResult { |