diff options
author | Peter Maydell | 2017-09-07 11:45:18 +0200 |
---|---|---|
committer | Peter Maydell | 2017-09-07 11:45:18 +0200 |
commit | 8ee5f9b3ecc94e3eb7a8235f4b2c3ec9024807f6 (patch) | |
tree | 302d6285c803b2317a41bcd1dc5ffc67c0959776 /block/io.c | |
parent | Merge remote-tracking branch 'remotes/juanquintela/tags/tests/20170906' into ... (diff) | |
parent | qcow2: move qcow2_store_persistent_dirty_bitmaps() before cache flushing (diff) | |
download | qemu-8ee5f9b3ecc94e3eb7a8235f4b2c3ec9024807f6.tar.gz qemu-8ee5f9b3ecc94e3eb7a8235f4b2c3ec9024807f6.tar.xz qemu-8ee5f9b3ecc94e3eb7a8235f4b2c3ec9024807f6.zip |
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Block layer patches
# gpg: Signature made Wed 06 Sep 2017 14:44:41 BST
# gpg: using RSA key 0x7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6
* remotes/kevin/tags/for-upstream:
qcow2: move qcow2_store_persistent_dirty_bitmaps() before cache flushing
qemu-iotests: add 184 for throttle filter driver
block: add throttle block filter driver
block: convert ThrottleGroup to object with QOM
block: tidy ThrottleGroupMember initializations
block: add aio_context field in ThrottleGroupMember
block: move ThrottleGroup membership to ThrottleGroupMember
block: document semantics of bdrv_co_preadv|pwritev
qcow: Check failure of bdrv_getlength() and bdrv_truncate()
qcow: Change signature of get_cluster_offset()
block: add default implementations for bdrv_co_get_block_status()
block: remove bdrv_truncate callback in blkdebug
block: remove unused bdrv_media_changed
block: pass bdrv_* methods to bs->file by default in block filters
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'block/io.c')
-rw-r--r-- | block/io.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/block/io.c b/block/io.c index 26003814eb..4378ae4c7d 100644 --- a/block/io.c +++ b/block/io.c @@ -1714,6 +1714,32 @@ typedef struct BdrvCoGetBlockStatusData { bool done; } BdrvCoGetBlockStatusData; +int64_t coroutine_fn bdrv_co_get_block_status_from_file(BlockDriverState *bs, + int64_t sector_num, + int nb_sectors, + int *pnum, + BlockDriverState **file) +{ + assert(bs->file && bs->file->bs); + *pnum = nb_sectors; + *file = bs->file->bs; + return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | + (sector_num << BDRV_SECTOR_BITS); +} + +int64_t coroutine_fn bdrv_co_get_block_status_from_backing(BlockDriverState *bs, + int64_t sector_num, + int nb_sectors, + int *pnum, + BlockDriverState **file) +{ + assert(bs->backing && bs->backing->bs); + *pnum = nb_sectors; + *file = bs->backing->bs; + return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | + (sector_num << BDRV_SECTOR_BITS); +} + /* * Returns the allocation status of the specified sectors. * Drivers not implementing the functionality are assumed to not support |