qemu-devel
[Top][All Lists]
Advanced

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

Re: Bug? qemu-img convert to preallocated image makes it sparse


From: Eric Blake
Subject: Re: Bug? qemu-img convert to preallocated image makes it sparse
Date: Thu, 16 Jan 2020 08:57:50 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1

On 1/16/20 8:47 AM, Max Reitz wrote:

So when you convert to the target image, you have to make sure all areas
that are zero in the source are zero in the target, too.  The way we do
that is to write zeroes to the target.  The problem is that this
operation disregards the previous preallocation and discards the
preallocated space.

As for fixing the bug...  Can we fix it in qemu(-img)?

We could try to detect whether areas that are zero in the source are
zero in the (preallocated) target image, too.  But doing so what require
reading the data from those areas and comparing it to zero.  That would
take time and it isn’t trivial.  So that’s something I’d rather avoid.

Can't we also use block status queries on the destination, as that is likely to be faster than actual reads and comparison to zero?


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

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