summaryrefslogtreecommitdiff
path: root/include/block
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-09-04 19:00:28 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2013-09-06 15:25:09 +0200
commitb6b8a33354a448ee421f57676c1a93a536a63269 (patch)
tree42500103c1b9a5afb4683b9047984b9064d39e33 /include/block
parent11212d8fa08a4e5bd56bb4f6877f9a4c0439a02b (diff)
downloadqemu-b6b8a33354a448ee421f57676c1a93a536a63269.tar.gz
block: introduce bdrv_get_block_status API
For now, bdrv_get_block_status is just another name for bdrv_is_allocated. The next patches will add more flags. This also touches all block drivers with a mostly mechanical rename. The sole exception is cow; because it calls cow_co_is_allocated from the read code, we keep that function and make cow_co_get_block_status a wrapper. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/block.h2
-rw-r--r--include/block/block_int.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/include/block/block.h b/include/block/block.h
index 5469c94f37..0b83321419 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -269,6 +269,8 @@ int bdrv_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors);
int bdrv_co_discard(BlockDriverState *bs, int64_t sector_num, int nb_sectors);
int bdrv_has_zero_init_1(BlockDriverState *bs);
int bdrv_has_zero_init(BlockDriverState *bs);
+int64_t bdrv_get_block_status(BlockDriverState *bs, int64_t sector_num,
+ int nb_sectors, int *pnum);
int bdrv_is_allocated(BlockDriverState *bs, int64_t sector_num, int nb_sectors,
int *pnum);
int bdrv_is_allocated_above(BlockDriverState *top, BlockDriverState *base,
diff --git a/include/block/block_int.h b/include/block/block_int.h
index b9212b8331..7c35198ad7 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -118,7 +118,7 @@ struct BlockDriver {
int64_t sector_num, int nb_sectors);
int coroutine_fn (*bdrv_co_discard)(BlockDriverState *bs,
int64_t sector_num, int nb_sectors);
- int coroutine_fn (*bdrv_co_is_allocated)(BlockDriverState *bs,
+ int64_t coroutine_fn (*bdrv_co_get_block_status)(BlockDriverState *bs,
int64_t sector_num, int nb_sectors, int *pnum);
/*