qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Thomas Huth <thuth@redhat.com>,
	Sam Eiderman <shmuel.eiderman@oracle.com>,
	kwolf@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org,
	fam@euphon.net, eblake@redhat.com
Cc: arbel.moshe@oracle.com
Subject: Re: [Qemu-devel] [PATCH v2] vmdk: Set vmdk parent backing_format to vmdk
Date: Fri, 3 May 2019 16:32:25 +0200	[thread overview]
Message-ID: <a44ffb98-4cc2-47b9-2c9e-eeeda445a0a0@redhat.com> (raw)
In-Reply-To: <8d201096-ab9d-82e0-93cb-74bd23d93dbe@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 4092 bytes --]

On 03.05.19 13:34, Thomas Huth wrote:
>  Hi Sam,
> 
> On 02/05/2019 15.08, Sam Eiderman wrote:
>> Commit b69864e ("vmdk: Support version=3 in VMDK descriptor files")
>> fixed the probe function to correctly guess vmdk descriptors with
>> version=3.
>>
>> This solves the issue where vmdk snapshot with parent vmdk descriptor
>> containing "version=3" would be treated as raw instead vmdk.
>>
>> In the future case where a new vmdk version is introduced, we will again
>> experience this issue, even if the user will provide "-f vmdk" it will
>> only apply to the tip image and not to the underlying "misprobed" parent
>> image.
>>
>> The code in vmdk.c already assumes that the backing file of vmdk must be
>> vmdk (see vmdk_is_cid_valid which returns 0 if backing file is not
>> vmdk).
>>
>> So let's make it official by supplying the backing_format as vmdk.
>>
>> Reviewed-by: Mark Kanda <mark.kanda@oracle.com>
>> Reviewed-By: Liran Alon <liran.alon@oracle.com>
>> Reviewed-by: Arbel Moshe <arbel.moshe@oracle.com>
>> Signed-off-by: Shmuel Eiderman <shmuel.eiderman@oracle.com>
>> ---
>>  block/vmdk.c           | 2 ++
>>  tests/qemu-iotests/110 | 6 +++---
>>  tests/qemu-iotests/126 | 4 ++--
>>  3 files changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/block/vmdk.c b/block/vmdk.c
>> index 8dec6ef767..de8cb859f8 100644
>> --- a/block/vmdk.c
>> +++ b/block/vmdk.c
>> @@ -397,6 +397,8 @@ static int vmdk_parent_open(BlockDriverState *bs)
>>          pstrcpy(bs->auto_backing_file, end_name - p_name + 1, p_name);
>>          pstrcpy(bs->backing_file, sizeof(bs->backing_file),
>>                  bs->auto_backing_file);
>> +        pstrcpy(bs->backing_format, sizeof(bs->backing_format),
>> +                "vmdk");
>>      }
> 
> Your patch with this change has already been merged into the QEMU master
> branch...
> 
>> diff --git a/tests/qemu-iotests/110 b/tests/qemu-iotests/110
>> index fad672c1ae..982569dbc5 100755
>> --- a/tests/qemu-iotests/110
>> +++ b/tests/qemu-iotests/110
>> @@ -54,7 +54,7 @@ _make_test_img -b "$TEST_IMG_REL.base" 64M
>>  # qemu should be able to reconstruct the filename, so relative backing names
>>  # should work
>>  TEST_IMG="json:{'driver':'$IMGFMT','file':{'driver':'file','filename':'$TEST_IMG'}}" \
>> -    _img_info | _filter_img_info
>> +    _img_info | _filter_img_info | grep -v "backing file format"
>>  
>>  echo
>>  echo '=== Non-reconstructable filename ==='
>> @@ -78,7 +78,7 @@ TEST_IMG="json:{
>>              }
>>          ]
>>      }
>> -}" _img_info | _filter_img_info
>> +}" _img_info | _filter_img_info | grep -v "backing file format"
>>  
>>  echo
>>  echo '=== Backing name is always relative to the backed image ==='
>> @@ -110,7 +110,7 @@ TEST_IMG="json:{
>>              }
>>          ]
>>      }
>> -}" _img_info | _filter_img_info
>> +}" _img_info | _filter_img_info | grep -v "backing file format"
>>  
>>  
>>  # success, all done
>> diff --git a/tests/qemu-iotests/126 b/tests/qemu-iotests/126
>> index 96dc048d59..1f7618c8a5 100755
>> --- a/tests/qemu-iotests/126
>> +++ b/tests/qemu-iotests/126
>> @@ -63,7 +63,7 @@ TEST_IMG=$BASE_IMG _make_test_img 64M
>>  TEST_IMG=$TOP_IMG _make_test_img -b ./image:base.$IMGFMT
>>  
>>  # The default cluster size depends on the image format
>> -TEST_IMG=$TOP_IMG _img_info | grep -v 'cluster_size'
>> +TEST_IMG=$TOP_IMG _img_info | grep -v 'cluster_size\|backing file format'
>>  
>>  _rm_test_img "$BASE_IMG"
>>  _rm_test_img "$TOP_IMG"
>> @@ -79,7 +79,7 @@ TOP_IMG="file:image:top.$IMGFMT"
>>  TEST_IMG=$BASE_IMG _make_test_img 64M
>>  TEST_IMG=$TOP_IMG _make_test_img -b "$BASE_IMG"
>>  
>> -TEST_IMG=$TOP_IMG _img_info | grep -v 'cluster_size'
>> +TEST_IMG=$TOP_IMG _img_info | grep -v 'cluster_size\|backing file format'
>>  
>>  _rm_test_img "$BASE_IMG"
>>  _rm_test_img "image:top.$IMGFMT"
>>
> 
> ... so please just send a patch with these fixes!

I already did, it's here:

http://lists.nongnu.org/archive/html/qemu-block/2019-04/msg00442.html

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2019-05-03 14:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190326195837.8416-1-shmuel.eiderman@oracle.com>
     [not found] ` <891af075-0e1d-de0b-b874-738b0c8f34ae@redhat.com>
     [not found]   ` <AC82FB5B-34EF-453F-B4CB-33F1BBF58623@oracle.com>
2019-05-02  9:31     ` [Qemu-devel] [Qemu-block] [PATCH] vmdk: Set vmdk parent backing_format to vmdk Thomas Huth
2019-05-02  9:31       ` Thomas Huth
2019-05-02 13:08       ` [Qemu-devel] [PATCH v2] " Sam Eiderman
2019-05-02 13:08         ` Sam Eiderman
2019-05-02 13:08         ` Sam Eiderman
2019-05-02 13:08           ` Sam Eiderman
2019-05-03 11:34           ` Thomas Huth
2019-05-03 11:34             ` Thomas Huth
2019-05-03 14:32             ` Max Reitz [this message]
2019-05-03 14:32               ` Max Reitz
2019-05-04 12:43               ` Sam
2019-05-04 12:43                 ` Sam
2019-05-07 13:26                 ` Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a44ffb98-4cc2-47b9-2c9e-eeeda445a0a0@redhat.com \
    --to=mreitz@redhat.com \
    --cc=arbel.moshe@oracle.com \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=shmuel.eiderman@oracle.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).