[libvirt] [PATCH] virfile: safezero: fall back to writing block by block if mmap fails
Michal Privoznik
mprivozn at redhat.com
Fri Oct 4 06:33:35 UTC 2013
On 02.10.2013 09:31, Oskari Saarenmaa wrote:
> mmap can fail on 32-bit systems if we're trying to zero out a lot of data.
> Fall back to using block-by-block writing in that case. While we could map
> smaller blocks it's unlikely that this code is used a lot and its easier to
> just fall back to one of the existing methods.
>
> Also modified the block-by-block zeroing to not allocate a megabyte of
> zeroes if we're writing less than that.
>
> Signed-off-by: Oskari Saarenmaa <os at ohmu.fi>
> ---
> src/util/virfile.c | 34 ++++++++++++++--------------------
> 1 file changed, 14 insertions(+), 20 deletions(-)
ACKed and pushed. Thanks for your contribution!
Michal
More information about the libvir-list
mailing list