summaryrefslogtreecommitdiffstats
path: root/include/block/block.h
diff options
context:
space:
mode:
authorFam Zheng2014-04-16 03:34:30 +0200
committerKevin Wolf2014-04-22 11:57:02 +0200
commitb8afb520e479e693c227aa39c2fb7670743e104f (patch)
tree839fbe93b1b9398a61db63acd89b1e68dbe816de /include/block/block.h
parentvmdk: Fix %d and %lld to PRI* in format strings (diff)
downloadqemu-b8afb520e479e693c227aa39c2fb7670743e104f.tar.gz
qemu-b8afb520e479e693c227aa39c2fb7670743e104f.tar.xz
qemu-b8afb520e479e693c227aa39c2fb7670743e104f.zip
block: Handle error of bdrv_getlength in bdrv_create_dirty_bitmap
bdrv_getlength could fail, check the return value before using it. Return NULL and set errno if it fails. Callers are updated to handle the error case. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block/block.h')
-rw-r--r--include/block/block.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/block/block.h b/include/block/block.h
index b3230a25f6..2b51eec571 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -429,7 +429,8 @@ bool bdrv_qiov_is_aligned(BlockDriverState *bs, QEMUIOVector *qiov);
struct HBitmapIter;
typedef struct BdrvDirtyBitmap BdrvDirtyBitmap;
-BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs, int granularity);
+BdrvDirtyBitmap *bdrv_create_dirty_bitmap(BlockDriverState *bs, int granularity,
+ Error **errp);
void bdrv_release_dirty_bitmap(BlockDriverState *bs, BdrvDirtyBitmap *bitmap);
BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDriverState *bs);
int bdrv_get_dirty(BlockDriverState *bs, BdrvDirtyBitmap *bitmap, int64_t sector);