summaryrefslogtreecommitdiffstats
path: root/include/block
diff options
context:
space:
mode:
authorJeff Cody2014-06-25 21:40:09 +0200
committerStefan Hajnoczi2014-07-01 10:47:01 +0200
commit5a6684d2b957f9ec75d7ed7b14332293abec1d6c (patch)
treea48d938dc87ab82353945528d368d2d700da339e /include/block
parentblock: add QAPI command to allow live backing file change (diff)
downloadqemu-5a6684d2b957f9ec75d7ed7b14332293abec1d6c.tar.gz
qemu-5a6684d2b957f9ec75d7ed7b14332293abec1d6c.tar.xz
qemu-5a6684d2b957f9ec75d7ed7b14332293abec1d6c.zip
block: add helper function to determine if a BDS is in a chain
This is a small helper function, to determine if 'base' is in the chain of BlockDriverState 'top'. It returns true if it is in the chain, and false otherwise. If either argument is NULL, it will also return false. Reviewed-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/block.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/block/block.h b/include/block/block.h
index 7e92f549fb..29c9e50ddb 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -403,6 +403,7 @@ BlockDeviceInfoList *bdrv_named_nodes_list(void);
BlockDriverState *bdrv_lookup_bs(const char *device,
const char *node_name,
Error **errp);
+bool bdrv_chain_contains(BlockDriverState *top, BlockDriverState *base);
BlockDriverState *bdrv_next(BlockDriverState *bs);
void bdrv_iterate(void (*it)(void *opaque, BlockDriverState *bs),
void *opaque);