qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-5.1] qcow2: Don't open images with a backing file and the


From: Alberto Garcia
Subject: Re: [PATCH for-5.1] qcow2: Don't open images with a backing file and the data-file-raw bit
Date: Thu, 18 Jun 2020 14:03:25 +0200
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Wed 03 Jun 2020 03:53:03 PM CEST, Max Reitz wrote:
> Sorry for the long delay. :/

And sorry for my long delay as well.

> The patch itself looks good, but I’m not sure whether it is extensive
> enough.  Let me just jump straight to the problem:
>
> $ ./qemu-img create -f qcow2 \
>     -o data_file=foo.qcow2.raw,data_file_raw=on \
>     foo.qcow2 64M
> (Create some file empty foo.qcow2 with external data file that’s raw)
>
> $ ./qemu-img create -f qcow2 backing.qcow2 64M
> $ ./qemu-io -c 'write -P 42 0 64M' backing.qcow2
> (Create some file filled with 42s)
>
> $ ./qemu-img compare foo.qcow2 foo.qcow2.raw
> Images are identical.
> (As expected, foo.qcow2 is identical to its raw data file)
>
> $ ./qemu-img compare --image-opts \
>     file.filename=foo.qcow2,backing.file.filename=backing.qcow2 \
>     file.filename=foo.qcow2.raw
> Content mismatch at offset 0!
> (Oops.)

If two images have the same contents but then you compare them changing
the backing file of one of them you can also get a content mismatch. How
is this different?

Regardless of how we should ideally handle bs->backing and data-file-raw
(and yes I agree that it would be nice that QEMU would say "you cannot
have a backing file and an external raw file" in all cases) I think that
if the problem is that the user can override the backing file name and
get different contents, then that's not a problem that we should be
worried about.

Berto



reply via email to

[Prev in Thread] Current Thread [Next in Thread]