qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH for-4.1? 1/4] qcow2: Fix .bdrv_has_zero_init()


From: Kevin Wolf
Subject: Re: [Qemu-block] [PATCH for-4.1? 1/4] qcow2: Fix .bdrv_has_zero_init()
Date: Tue, 16 Jul 2019 18:54:59 +0200
User-agent: Mutt/1.11.3 (2019-02-01)

Am 15.07.2019 um 12:45 hat Max Reitz geschrieben:
> If a qcow2 file is preallocated, it can no longer guarantee that it
> initially appears as filled with zeroes.
> 
> So implement .bdrv_has_zero_init() by checking whether the file is
> preallocated; if so, forward the call to the underlying storage node,
> except for when it is encrypted: Encrypted preallocated images always
> return effectively random data, so .bdrv_has_zero_init() must always
> return 0 for them.
> 
> Reported-by: Stefano Garzarella <address@hidden>
> Signed-off-by: Max Reitz <address@hidden>

Hm... This patch only really works directly after image creation (which
is indeed where .bdrv_has_zero_init is used). Why do we have to have a
full qcow2_is_zero() that loops over the whole image just to find out
whether it's preallocated? Wouldn't looking at a single data cluster be
enough?

Kevin



reply via email to

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