From: Fam Zheng Date: Tue, 26 Jan 2016 03:59:01 +0000 (+0800) Subject: qemu-img: In "map", use the returned "file" from bdrv_get_block_status X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9e4303400801e62e8e357decdb487834582459e8;p=qemu.git qemu-img: In "map", use the returned "file" from bdrv_get_block_status Now all drivers should return a correct "file", we can make use of it, even with the recursion into backing chain above. Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng Message-id: 1453780743-16806-15-git-send-email-famz@redhat.com Signed-off-by: Max Reitz --- diff --git a/qemu-img.c b/qemu-img.c index e653b2f304..c8bc63f0a0 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2236,7 +2236,7 @@ static int get_block_status(BlockDriverState *bs, int64_t sector_num, e->flags = ret & ~BDRV_BLOCK_OFFSET_MASK; e->offset = ret & BDRV_BLOCK_OFFSET_MASK; e->depth = depth; - e->bs = bs; + e->bs = file; return 0; }