]> git.proxmox.com Git - mirror_qemu.git/commitdiff
vpc: Assign bs->file->bs to file in vpc_co_get_block_status
authorFam Zheng <famz@redhat.com>
Tue, 26 Jan 2016 03:58:57 +0000 (11:58 +0800)
committerMax Reitz <mreitz@redhat.com>
Tue, 2 Feb 2016 16:50:47 +0000 (17:50 +0100)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-id: 1453780743-16806-11-git-send-email-famz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/vpc.c

index a0703074f8551f09554865dcf051695b15d9a76b..f504536d1c259ed93692ae313eda1cfb0d52f758 100644 (file)
@@ -589,6 +589,7 @@ static int64_t coroutine_fn vpc_co_get_block_status(BlockDriverState *bs,
 
     if (be32_to_cpu(footer->type) == VHD_FIXED) {
         *pnum = nb_sectors;
+        *file = bs->file->bs;
         return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_DATA |
                (sector_num << BDRV_SECTOR_BITS);
     }
@@ -610,6 +611,7 @@ static int64_t coroutine_fn vpc_co_get_block_status(BlockDriverState *bs,
         /* *pnum can't be greater than one block for allocated
          * sectors since there is always a bitmap in between. */
         if (allocated) {
+            *file = bs->file->bs;
             return BDRV_BLOCK_DATA | BDRV_BLOCK_OFFSET_VALID | start;
         }
         if (nb_sectors == 0) {