diff options
author | Fam Zheng <famz@redhat.com> | 2016-01-26 11:58:55 +0800 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2016-02-02 17:50:47 +0100 |
commit | d234c929310a322357ed4323c7014605449f5802 (patch) | |
tree | fcd8f0c5a6e50f6c3f0c8a2c027cbadb5b14affa /block/sheepdog.c | |
parent | 53f1dfd1ff5a603ea1bd67b925758d22f54e1f8a (diff) | |
download | qemu-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.c | 3 |
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; } |