diff mbox

compressed VMDKs and BDRV_BLOCK_OFFSET_VALID

Message ID 530B4DAA.6070301@kamp.de
State New
Headers show

Commit Message

Peter Lieven Feb. 24, 2014, 1:48 p.m. UTC
Hi,

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

Peter

Comments

Fam Zheng Feb. 24, 2014, 2:37 p.m. UTC | #1
On Mon, 02/24 14:48, Peter Lieven wrote:
> Hi,
> 
> I wonder if the current output of get_block_status for compressed VMDKs is correct or
> if we need this patch?:
> 
> diff --git a/block/vmdk.c b/block/vmdk.c
> index ff6f5ee..5fa29b0 100644
> --- a/block/vmdk.c
> +++ b/block/vmdk.c
> @@ -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
Paolo Bonzini Feb. 24, 2014, 4:39 p.m. UTC | #2
Il 24/02/2014 15:37, Fam Zheng ha scritto:
> On Mon, 02/24 14:48, Peter Lieven wrote:
>> Hi,
>>
>> I wonder if the current output of get_block_status for compressed VMDKs is correct or
>> if we need this patch?:
>>
>> diff --git a/block/vmdk.c b/block/vmdk.c
>> index ff6f5ee..5fa29b0 100644
>> --- a/block/vmdk.c
>> +++ b/block/vmdk.c
>> @@ -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
Peter Lieven Feb. 24, 2014, 8:22 p.m. UTC | #3
Am 24.02.2014 17:39, schrieb Paolo Bonzini:
> Il 24/02/2014 15:37, Fam Zheng ha scritto:
>> On Mon, 02/24 14:48, Peter Lieven wrote:
>>> Hi,
>>>
>>> I wonder if the current output of get_block_status for compressed VMDKs is correct or
>>> if we need this patch?:
>>>
>>> diff --git a/block/vmdk.c b/block/vmdk.c
>>> index ff6f5ee..5fa29b0 100644
>>> --- a/block/vmdk.c
>>> +++ b/block/vmdk.c
>>> @@ -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.
I will send a patch.

Peter
>
> Paolo
>
>
diff mbox

Patch

diff --git a/block/vmdk.c b/block/vmdk.c
index ff6f5ee..5fa29b0 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -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;
          }