diff options
author | Fam Zheng <famz@redhat.com> | 2016-01-26 11:58:48 +0800 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2016-02-02 17:50:47 +0100 |
commit | 67a0fd2a9bca204d2b39f910a97c7137636a0715 (patch) | |
tree | 12dc70b53147c01182e6364582253bca9991a69f /block/mirror.c | |
parent | 1963f8d52e04a8f8b213e34e6a76fb286fb23ec1 (diff) |
block: Add "file" output parameter to block status query functions
The added parameter can be used to return the BDS pointer which the
valid offset is referring to. Its value should be ignored unless
BDRV_BLOCK_OFFSET_VALID in ret is set.
Until block drivers fill in the right value, let's clear it explicitly
right before calling .bdrv_get_block_status.
The "bs->file" condition in bdrv_co_get_block_status is kept now to keep iotest
case 102 passing, and will be fixed once all drivers return the right file
pointer.
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1453780743-16806-2-git-send-email-famz@redhat.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/mirror.c')
-rw-r--r-- | block/mirror.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/mirror.c b/block/mirror.c index e9e151c341..2c0edfaf48 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -168,6 +168,7 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s) MirrorOp *op; int pnum; int64_t ret; + BlockDriverState *file; max_iov = MIN(source->bl.max_iov, s->target->bl.max_iov); @@ -306,7 +307,7 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s) trace_mirror_one_iteration(s, sector_num, nb_sectors); ret = bdrv_get_block_status_above(source, NULL, sector_num, - nb_sectors, &pnum); + nb_sectors, &pnum, &file); if (ret < 0 || pnum < nb_sectors || (ret & BDRV_BLOCK_DATA && !(ret & BDRV_BLOCK_ZERO))) { bdrv_aio_readv(source, sector_num, &op->qiov, nb_sectors, |