diff mbox

[v9,12/16] vmdk: Return extent's file in bdrv_get_block_status

Message ID 1453780743-16806-13-git-send-email-famz@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Fam Zheng Jan. 26, 2016, 3:58 a.m. UTC
Signed-off-by: Fam Zheng <famz@redhat.com>
---
 block/vmdk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Max Reitz Jan. 27, 2016, 6:25 p.m. UTC | #1
On 26.01.2016 04:58, Fam Zheng wrote:
> Signed-off-by: Fam Zheng <famz@redhat.com>
> ---
>  block/vmdk.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Max Reitz <mreitz@redhat.com>
diff mbox

Patch

diff --git a/block/vmdk.c b/block/vmdk.c
index 61ed207..f8f7fcf 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1287,12 +1287,12 @@  static int64_t coroutine_fn vmdk_co_get_block_status(BlockDriverState *bs,
         break;
     case VMDK_OK:
         ret = BDRV_BLOCK_DATA;
-        if (extent->file == bs->file && !extent->compressed) {
+        if (!extent->compressed) {
             ret |= BDRV_BLOCK_OFFSET_VALID;
             ret |= (offset + (index_in_cluster << BDRV_SECTOR_BITS))
                     & BDRV_BLOCK_OFFSET_MASK;
         }
-
+        *file = extent->file->bs;
         break;
     }