diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-09-04 19:00:28 +0200 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2013-09-06 15:25:09 +0200 |
commit | b6b8a33354a448ee421f57676c1a93a536a63269 (patch) | |
tree | 42500103c1b9a5afb4683b9047984b9064d39e33 /block/cow.c | |
parent | 11212d8fa08a4e5bd56bb4f6877f9a4c0439a02b (diff) |
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 'block/cow.c')
-rw-r--r-- | block/cow.c | 8 |
1 files changed, 7 insertions, 1 deletions
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, }; |