qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCHv2] block: change default of .has_zero_init to 0


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCHv2] block: change default of .has_zero_init to 0
Date: Fri, 28 Jun 2013 13:57:03 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 28.06.2013 um 12:47 hat Peter Lieven geschrieben:
> .has_zero_init defaults to 1 for all formats and protocols.
> 
> this is a dangerous default since this means that all
> new added drivers need to manually overwrite it to 0 if
> they do not ensure that a device is zero initialized
> after bdrv_create().
> 
> if a driver needs to explicitly set this value to
> 1 its easier to verify the correctness in the review process.
> 
> during review of the existing drivers it turned out
> that ssh and gluster had a wrong default of 1.
> both protocols support host_devices as backend
> which are not by default zero initialized. this
> wrong assumption will lead to possible corruption
> if qemu-img convert is used to write to such a backend.
> 
> vpc and vmdk also defaulted to 1 altough they support
> fixed respectively flat extends. this has to be addresses
> in separate patches. both formats as well as the mentioned
> ssh and gluster are turned to the default of 0 with this
> patch for safety.
> 
> a similar problem with the wrong default existed for
> iscsi most likely because the driver developer did
> oversee the default value of 1.
> 
> Signed-off-by: Peter Lieven <address@hidden>
> ---
> v1->v2:
>  - fixed typos
>  - removed bdrv_has_zero_init_1 for vpc and vmdk
>  - added bdrv_has_zero_init_1 for cow

Thanks, applied to the block branch.

Kevin



reply via email to

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