Skip to contentSkip to conversation

compressed VMDKs and BDRV_BLOCK_OFFSET_VALID

Qemu-devel Peter Lieven 3 participants 4 messages Feb 24, 2014 Block layer

lore
Share & tools
lore
#0 lore raw

Hi,

I wonder if the current output of get_block_status for compressed VMDKs is correct or if we need this patch?:

block/vmdk.c +1 -1
index ff6f5ee..5fa29b0 100644
@@ -1146,7 +1146,7 @@ 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) {
+        if (extent->file == bs->file && !extent->compressed) {
             ret |= BDRV_BLOCK_OFFSET_VALID | offset;
         }
 

Peter

#1 lore raw
Quoted 10 lines · Peter Lieven

Hi,

I wonder if the current output of get_block_status for compressed VMDKs is correct or if we need this patch?:

block/vmdk.c +0 -0
index ff6f5ee..5fa29b0 100644

block/vmdk.c static int64_t coroutine_fn vmdk_co_get_block_status(BlockDriverState *bs, · line 1152

Quoted 8 lines
block/vmdk.c +1 -1
@@ -1146,7 +1146,7 @@ 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) {
+        if (extent->file == bs->file && !extent->compressed) {
             ret |= BDRV_BLOCK_OFFSET_VALID | offset;
         }
 

Yes, I think you are right. The output shouldn't contain offset for compressed extents.

Fam

#2 lore raw

Il 24/02/2014 15:37, Fam Zheng ha scritto:

Quoted 6 lines · Peter Lieven
Quoted 5 lines

Hi,

I wonder if the current output of get_block_status for compressed VMDKs is correct or if we need this patch?:

Quoted 16 lines

block/vmdk.c static int64_t coroutine_fn vmdk_co_get_block_status(BlockDriverState *bs, · line 1152

Quoted 13 lines
block/vmdk.c +1 -1
index ff6f5ee..5fa29b0 100644
@@ -1146,7 +1146,7 @@ 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) {
+        if (extent->file == bs->file && !extent->compressed) {
             ret |= BDRV_BLOCK_OFFSET_VALID | offset;
         }
 

Yes, I think you are right. The output shouldn't contain offset for compressed extents.

Ack.

Paolo

#3 lore raw

Am 24.02.2014 17:39, schrieb Paolo Bonzini:

Quoted 24 lines

Il 24/02/2014 15:37, Fam Zheng ha scritto:

Quoted 6 lines · Peter Lieven
Quoted 5 lines

Hi,

I wonder if the current output of get_block_status for compressed VMDKs is correct or if we need this patch?:

Quoted 16 lines

block/vmdk.c static int64_t coroutine_fn vmdk_co_get_block_status(BlockDriverState *bs, · line 1152

Quoted 13 lines
block/vmdk.c +1 -1
index ff6f5ee..5fa29b0 100644
@@ -1146,7 +1146,7 @@ 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) {
+        if (extent->file == bs->file && !extent->compressed) {
             ret |= BDRV_BLOCK_OFFSET_VALID | offset;
         }
 

Yes, I think you are right. The output shouldn't contain offset for compressed extents.

Quoted 1 line

Ack.

I will send a patch.

Peter

Quoted 4 lines

Paolo