[Qemu-devel] [PATCH for-4.1 0/2] Fix check for default backing files in bdrv_reopen_prepare()

Alberto Garcia posted 2 patches 5 years ago
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test checkpatch passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/cover.1554992449.git.berto@igalia.com
Maintainers: Max Reitz <mreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>
block.c                | 6 +++++-
tests/qemu-iotests/245 | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
[Qemu-devel] [PATCH for-4.1 0/2] Fix check for default backing files in bdrv_reopen_prepare()
Posted by Alberto Garcia 5 years ago
Hi,

Patch 1 is the fix for the bug reported by Max here:

   https://lists.gnu.org/archive/html/qemu-block/2019-04/msg00293.html

Patch 2 fixes a different (but slightly related) issue that I found
while preparing the first patch.

Regards,

Berto

Alberto Garcia (2):
  block: Fix check for default backing files in bdrv_reopen_prepare()
  block: Clear the backing_file fields on detach

 block.c                | 6 +++++-
 tests/qemu-iotests/245 | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

-- 
2.11.0


Re: [Qemu-devel] [PATCH for-4.1 0/2] Fix check for default backing files in bdrv_reopen_prepare()
Posted by Max Reitz 5 years ago
On 11.04.19 16:23, Alberto Garcia wrote:
> Hi,
> 
> Patch 1 is the fix for the bug reported by Max here:
> 
>    https://lists.gnu.org/archive/html/qemu-block/2019-04/msg00293.html
> 
> Patch 2 fixes a different (but slightly related) issue that I found
> while preparing the first patch.

I think the real problem is that bs->backing_file is not a cache for
bs->backing->bs->filename.

In fact, every user of bs->backing_file expects it to be something
different.  Some expect it to be a cache for bs->backing->bs->filename,
some expect it to be what the image header says (i.e., it if’s a
relative path, it’s relative to the overlay), some expect it to be what
the image header says, but relative paths to be translated so they are
relative to qemu’s CWD.

All of this should be cleaned up and this is what patch 7 in my "block:
Deal with filters" series does:

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

Max

Re: [Qemu-devel] [PATCH for-4.1 0/2] Fix check for default backing files in bdrv_reopen_prepare()
Posted by Alberto Garcia 5 years ago
On Sat 13 Apr 2019 02:56:57 AM CEST, Max Reitz wrote:
>> Patch 2 fixes a different (but slightly related) issue that I found
>> while preparing the first patch.
>
> I think the real problem is that bs->backing_file is not a cache for
> bs->backing->bs->filename.
>
> In fact, every user of bs->backing_file expects it to be something
> different.  Some expect it to be a cache for
> bs->backing->bs->filename, some expect it to be what the image header
> says (i.e., it if’s a relative path, it’s relative to the overlay),
> some expect it to be what the image header says, but relative paths to
> be translated so they are relative to qemu’s CWD.
>
> All of this should be cleaned up and this is what patch 7 in my "block:
> Deal with filters" series does:
>
> http://lists.nongnu.org/archive/html/qemu-block/2019-04/msg00308.html

Ok, you can leave out the second patch then. The first one should still
be correct, right?

Berto

Re: [Qemu-devel] [PATCH for-4.1 0/2] Fix check for default backing files in bdrv_reopen_prepare()
Posted by Max Reitz 5 years ago
On 13.04.19 10:46, Alberto Garcia wrote:
> On Sat 13 Apr 2019 02:56:57 AM CEST, Max Reitz wrote:
>>> Patch 2 fixes a different (but slightly related) issue that I found
>>> while preparing the first patch.
>>
>> I think the real problem is that bs->backing_file is not a cache for
>> bs->backing->bs->filename.
>>
>> In fact, every user of bs->backing_file expects it to be something
>> different.  Some expect it to be a cache for
>> bs->backing->bs->filename, some expect it to be what the image header
>> says (i.e., it if’s a relative path, it’s relative to the overlay),
>> some expect it to be what the image header says, but relative paths to
>> be translated so they are relative to qemu’s CWD.
>>
>> All of this should be cleaned up and this is what patch 7 in my "block:
>> Deal with filters" series does:
>>
>> http://lists.nongnu.org/archive/html/qemu-block/2019-04/msg00308.html
> 
> Ok, you can leave out the second patch then. The first one should still
> be correct, right?

I just think it’s unnecessary because as of my series both backing_file
and auto_backing_file serve the purpose.

Max

Re: [Qemu-devel] [PATCH for-4.1 0/2] Fix check for default backing files in bdrv_reopen_prepare()
Posted by Alberto Garcia 5 years ago
On Sat 13 Apr 2019 05:48:11 PM CEST, Max Reitz <mreitz@redhat.com> wrote:
>> Ok, you can leave out the second patch then. The first one should
>> still be correct, right?
>
> I just think it’s unnecessary because as of my series both
> backing_file and auto_backing_file serve the purpose.

Ok then!

Berto