qemu-block
[Top][All Lists]
Advanced

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

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


From: Ivan Ren
Subject: Re: [Qemu-block] [PATCH v3] qcow2: fix preallocation with metadata on bare block device
Date: Sun, 13 May 2018 21:37:21 +0800

> 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, when do this, the qcow2_alloc_cluster_offset will call handle_alloc again, and will lead metada update. Good news is that in handle_alloc the preallocated zero cluster offset will be reuse. In this case, the preallocated metata will be keeped except some flags, and the cluster offset is fixed.


On Sat, May 12, 2018 at 1:29 AM Kevin Wolf <address@hidden> wrote:
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
> preallocated l2 entry to avoid this problem.
>
> Signed-off-by: Ivan Ren <address@hidden>

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?

Kevin

reply via email to

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