From: Fam Zheng Date: Tue, 26 Jan 2016 03:58:55 +0000 (+0800) Subject: sheepdog: Assign bs to file in sd_co_get_block_status X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d234c929310a322357ed4323c7014605449f5802;p=people%2Fliuw%2Flibxenctrl-split%2Fqemu-xen.git sheepdog: Assign bs to file in sd_co_get_block_status Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng Message-id: 1453780743-16806-9-git-send-email-famz@redhat.com Signed-off-by: Max Reitz --- diff --git a/block/sheepdog.c b/block/sheepdog.c index 2ea05a6e2..a0098c116 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -2739,6 +2739,9 @@ sd_co_get_block_status(BlockDriverState *bs, int64_t sector_num, int nb_sectors, if (*pnum > nb_sectors) { *pnum = nb_sectors; } + if (ret > 0 && ret & BDRV_BLOCK_OFFSET_VALID) { + *file = bs; + } return ret; }