Re: [PATCH 1/2] qcow2: Force preallocation with data-file-raw

2020-06-23 Thread Kevin Wolf
Am 22.06.2020 um 11:48 hat Max Reitz geschrieben: > On 22.06.20 11:35, Max Reitz wrote: > > On 19.06.20 18:47, Alberto Garcia wrote: > >> On Fri 19 Jun 2020 12:40:11 PM CEST, Max Reitz wrote: > >>> +if (qcow2_opts->data_file_raw && > >>> +qcow2_opts->preallocation == PREALLOC_MODE_OFF)

Re: [PATCH 1/2] qcow2: Force preallocation with data-file-raw

2020-06-23 Thread Max Reitz
On 22.06.20 19:36, Alberto Garcia wrote: [...] > You would still have problems with images created with raw data files > but without preallocation. Yeah, sure, but, well. Bug in qemu. :/ Max signature.asc Description: OpenPGP digital signature

Re: [PATCH 1/2] qcow2: Force preallocation with data-file-raw

2020-06-22 Thread Eric Blake
On 6/22/20 10:48 AM, Max Reitz wrote: As I noted in my reply to myself, data-file-raw is an autoclear flag. That means, an old version of qemu that doesn’t recognize the flag must read the same data as a new version. It follows that the the L2 tables must be a 1:1 mapping. (Or the flag can’t b

Re: [PATCH 1/2] qcow2: Force preallocation with data-file-raw

2020-06-22 Thread Alberto Garcia
On Mon 22 Jun 2020 05:06:53 PM CEST, Max Reitz wrote: >>> No, this is wrong. This still wouldn’t fix the problem of having a >>> device file as the external data file, when it already has non-zero >>> data during creation. (Reading the qcow2 file would return zeroes, >>> but reading the device wo

Re: [PATCH 1/2] qcow2: Force preallocation with data-file-raw

2020-06-22 Thread Max Reitz
On 22.06.20 17:15, Nir Soffer wrote: > On Mon, Jun 22, 2020 at 6:07 PM Max Reitz wrote: >> >> On 22.06.20 16:46, Alberto Garcia wrote: >>> On Mon 22 Jun 2020 11:35:59 AM CEST, Max Reitz wrote: >> +if (qcow2_opts->data_file_raw && >> +qcow2_opts->preallocation == PREALLOC_MODE_O

Re: [PATCH 1/2] qcow2: Force preallocation with data-file-raw

2020-06-22 Thread Nir Soffer
On Mon, Jun 22, 2020 at 6:07 PM Max Reitz wrote: > > On 22.06.20 16:46, Alberto Garcia wrote: > > On Mon 22 Jun 2020 11:35:59 AM CEST, Max Reitz wrote: > +if (qcow2_opts->data_file_raw && > +qcow2_opts->preallocation == PREALLOC_MODE_OFF) > +{ > +/* > >>

Re: [PATCH 1/2] qcow2: Force preallocation with data-file-raw

2020-06-22 Thread Max Reitz
On 22.06.20 16:46, Alberto Garcia wrote: > On Mon 22 Jun 2020 11:35:59 AM CEST, Max Reitz wrote: +if (qcow2_opts->data_file_raw && +qcow2_opts->preallocation == PREALLOC_MODE_OFF) +{ +/* + * data-file-raw means that "the external data file ca

Re: [PATCH 1/2] qcow2: Force preallocation with data-file-raw

2020-06-22 Thread Alberto Garcia
On Mon 22 Jun 2020 11:35:59 AM CEST, Max Reitz wrote: >>> +if (qcow2_opts->data_file_raw && >>> +qcow2_opts->preallocation == PREALLOC_MODE_OFF) >>> +{ >>> +/* >>> + * data-file-raw means that "the external data file can be >>> + * read as a consistent standa

Re: [PATCH 1/2] qcow2: Force preallocation with data-file-raw

2020-06-22 Thread Max Reitz
On 22.06.20 11:35, Max Reitz wrote: > On 19.06.20 18:47, Alberto Garcia wrote: >> On Fri 19 Jun 2020 12:40:11 PM CEST, Max Reitz wrote: >>> +if (qcow2_opts->data_file_raw && >>> +qcow2_opts->preallocation == PREALLOC_MODE_OFF) >>> +{ >>> +/* >>> + * data-file-raw mea

Re: [PATCH 1/2] qcow2: Force preallocation with data-file-raw

2020-06-22 Thread Max Reitz
On 19.06.20 18:47, Alberto Garcia wrote: > On Fri 19 Jun 2020 12:40:11 PM CEST, Max Reitz wrote: >> +if (qcow2_opts->data_file_raw && >> +qcow2_opts->preallocation == PREALLOC_MODE_OFF) >> +{ >> +/* >> + * data-file-raw means that "the external data file can be >> +

Re: [PATCH 1/2] qcow2: Force preallocation with data-file-raw

2020-06-19 Thread Alberto Garcia
On Fri 19 Jun 2020 12:40:11 PM CEST, Max Reitz wrote: > +if (qcow2_opts->data_file_raw && > +qcow2_opts->preallocation == PREALLOC_MODE_OFF) > +{ > +/* > + * data-file-raw means that "the external data file can be > + * read as a consistent standalone raw ima

[PATCH 1/2] qcow2: Force preallocation with data-file-raw

2020-06-19 Thread Max Reitz
Setting the qcow2 data-file-raw bit means that you can ignore the qcow2 metadata when reading from the external data file. It does not mean that you have to ignore it, though. Therefore, the data read must be the same regardless of whether you interpret the metadata or whether you ignore it, and