summaryrefslogtreecommitdiff
path: root/block/sheepdog.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2016-01-26 11:58:55 +0800
committerMax Reitz <mreitz@redhat.com>2016-02-02 17:50:47 +0100
commitd234c929310a322357ed4323c7014605449f5802 (patch)
treefcd8f0c5a6e50f6c3f0c8a2c027cbadb5b14affa /block/sheepdog.c
parent53f1dfd1ff5a603ea1bd67b925758d22f54e1f8a (diff)
downloadqemu-d234c929310a322357ed4323c7014605449f5802.tar.gz
qemu-d234c929310a322357ed4323c7014605449f5802.tar.bz2
qemu-d234c929310a322357ed4323c7014605449f5802.zip
sheepdog: Assign bs to file in sd_co_get_block_status
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1453780743-16806-9-git-send-email-famz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/sheepdog.c')
-rw-r--r--block/sheepdog.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 2ea05a6e28..a0098c1165 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;
}