From b6b8a33354a448ee421f57676c1a93a536a63269 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 4 Sep 2013 19:00:28 +0200 Subject: 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 Signed-off-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- block/cow.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'block/cow.c') diff --git a/block/cow.c b/block/cow.c index 7450801cb7..d4b8c6bdd5 100644 --- a/block/cow.c +++ b/block/cow.c @@ -188,6 +188,12 @@ static int coroutine_fn cow_co_is_allocated(BlockDriverState *bs, return changed; } +static int64_t coroutine_fn cow_co_get_block_status(BlockDriverState *bs, + int64_t sector_num, int nb_sectors, int *num_same) +{ + return cow_co_is_allocated(bs, sector_num, nb_sectors, num_same); +} + static int cow_update_bitmap(BlockDriverState *bs, int64_t sector_num, int nb_sectors) { @@ -371,7 +377,7 @@ static BlockDriver bdrv_cow = { .bdrv_read = cow_co_read, .bdrv_write = cow_co_write, - .bdrv_co_is_allocated = cow_co_is_allocated, + .bdrv_co_get_block_status = cow_co_get_block_status, .create_options = cow_create_options, }; -- cgit v1.2.1