On 02/08/2017 02:16 AM, wayen wrote: > @Thomas Huth, I just want to reduce the file size of qcow2 overlay image > by this conversion. Are you merely trying to sparsify the file (punch holes on the portion of the file that is not mapped to disk), so that the apparent file size is unchanged, but the actual disk usage is minimized? That's probably already possible (virt-sparsify from libguestfs seems to be able to do it; look at what steps it uses). Or are you asking for a way to defragment the file, so that the apparent size shrinks because all occupied clusters are now contiguous, so that there are no longer any need for holes? The end result is the same amount of disk usage, but right now, the only way to defragment is to convert from one image to a copy; we don't support in-place defragmentation yet. So far, no one has come up with a compelling reason why it is needed, or a patch to implement it, but there's no technical reason why it can't be done. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org