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

index 3ef9b256f80561e8b20fe3c3125eb28050c5dda6..8866121cf72fb91877ed1d899718dda8c77d2de0 100644 (file)
@@ -1861,6 +1861,7 @@ static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *bs,
         *pnum = MIN(nb_sectors, (data - start) / BDRV_SECTOR_SIZE);
         ret = BDRV_BLOCK_ZERO;
     }
+    *file = bs;
     return ret | BDRV_BLOCK_OFFSET_VALID | start;
 }
 
index 9a8933b211b98565221c18f3c60e595ba258d01b..ea16a231c0dd853a0bd48c8402f6098f6475f8aa 100644 (file)
@@ -119,6 +119,7 @@ static int64_t coroutine_fn raw_co_get_block_status(BlockDriverState *bs,
                                             BlockDriverState **file)
 {
     *pnum = nb_sectors;
+    *file = bs->file->bs;
     return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_DATA |
            (sector_num << BDRV_SECTOR_BITS);
 }