aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorPeter Lieven <pl@kamp.de>2013-10-08 14:43:14 +0200
committerKevin Wolf <kwolf@redhat.com>2013-10-11 16:49:59 +0200
commit92bc50a5ad7fbc9a0bd17240eaea5027a100ca79 (patch)
tree105ca03529f39cc6d27eb0a89c36e498c61890f2 /block
parent88fb15351284868b70fa1d5b101e809057fcc5aa (diff)
downloadqemu-92bc50a5ad7fbc9a0bd17240eaea5027a100ca79.zip
qemu-92bc50a5ad7fbc9a0bd17240eaea5027a100ca79.tar.gz
qemu-92bc50a5ad7fbc9a0bd17240eaea5027a100ca79.tar.bz2
block/get_block_status: avoid redundant callouts on raw devices
if a raw device like an iscsi target or host device is used the current implementation makes a second call out to get the block status of bs->file. Signed-off-by: Peter Lieven <pl@kamp.de> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/raw_bsd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/block/raw_bsd.c b/block/raw_bsd.c
index d4ace60..d61906b 100644
--- a/block/raw_bsd.c
+++ b/block/raw_bsd.c
@@ -62,7 +62,9 @@ static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *bs,
int64_t sector_num,
int nb_sectors, int *pnum)
{
- return bdrv_get_block_status(bs->file, sector_num, nb_sectors, pnum);
+ *pnum = nb_sectors;
+ return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_DATA |
+ (sector_num << BDRV_SECTOR_BITS);
}
static int coroutine_fn raw_co_write_zeroes(BlockDriverState *bs,