block: Add bdrv_get_block_status_above
authorFam Zheng <famz@redhat.com>
Mon, 8 Jun 2015 05:56:07 +0000 (13:56 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 2 Jul 2015 09:03:50 +0000 (10:03 +0100)
commitba3f0e2545c365ebe1dbddb0e53058710d41881e
tree39315c57080955d17bb4be1ec3053faec12a842c
parente0cf11f31c24cfb17f44ed46c254d84c78e7f6e9
block: Add bdrv_get_block_status_above

Like bdrv_is_allocated_above, this function follows the backing chain until seeing
BDRV_BLOCK_ALLOCATED.  Base is not included.

Reimplement bdrv_is_allocated on top.

[Initialized bdrv_co_get_block_status_above() ret to 0 to silence
mingw64 compiler warning about the unitialized variable.  assert(bs !=
base) prevents that case but I suppose the program could be compiled
with -DNDEBUG.
--Stefan]

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/io.c
include/block/block.h