Re: [Qemu-block] [PATCH v3] qcow2: fix preallocation with metadata on bare block device

2018-05-14 Thread Ivan Ren
> Oh, yes, there is no doubt that the result will be correct. My point is > that people aren't usually interested so much in the physical layout of > the clusters, but more about the fact that no metadata updates and no > COW is necessary when you write to a cluster for the first time (i.e. > becau

Re: [Qemu-block] [PATCH v3] qcow2: fix preallocation with metadata on bare block device

2018-05-13 Thread Kevin Wolf
Am 13.05.2018 um 15:37 hat Ivan Ren geschrieben: > > Doesn't this defeat the purpose of preallocation? Usually, the idea with > > preallocation is that you don't need to update any metadata on the first > > write, but if you set QCOW_OFLAG_ZERO, we do need a metadata update > > again. > > > > So wh

Re: [Qemu-block] [PATCH v3] qcow2: fix preallocation with metadata on bare block device

2018-05-13 Thread Ivan Ren
> Doesn't this defeat the purpose of preallocation? Usually, the idea with > preallocation is that you don't need to update any metadata on the first > write, but if you set QCOW_OFLAG_ZERO, we do need a metadata update > again. > > So what's the advantage compared to not preallocating at all? Yes

Re: [Qemu-block] [PATCH v3] qcow2: fix preallocation with metadata on bare block device

2018-05-11 Thread Kevin Wolf
Am 11.05.2018 um 17:36 hat Ivan Ren geschrieben: > Create a qcow2 directly on bare block device with > "-o preallocation=metadata" option. When read this qcow2, it will > return pre-existing data on block device. This patch add > QCOW_OFLAG_ZERO flag (supported in qcow_version >= 3) for > prealloca

[Qemu-block] [PATCH v3] qcow2: fix preallocation with metadata on bare block device

2018-05-11 Thread Ivan Ren
Create a qcow2 directly on bare block device with "-o preallocation=metadata" option. When read this qcow2, it will return pre-existing data on block device. This patch add QCOW_OFLAG_ZERO flag (supported in qcow_version >= 3) for preallocated l2 entry to avoid this problem. Signed-off-by: Ivan Re