[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qemu-img: Special post-backing
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] qemu-img: Special post-backing convert handling |
Date: |
Tue, 1 May 2018 13:09:52 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 05/01/2018 11:57 AM, Max Reitz wrote:
Currently, qemu-img convert writes zeroes when it reads zeroes.
Sometimes it does not because the target is initialized to zeroes
anyway, so we do not need to overwrite (and thus potentially allocate)
it. This is never the case for targets with backing files, though. But
even them may have an area that is initialized to zeroes, and that is
s/them/they/
the area past the end of the backing file (if that is shorter than the
overlay).
So if the target format's unallocated blocks are zero and there is a gap
between the target's backing file's end and the target's end, we do not
have to explicitly write zeroes there.
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1527898
Signed-off-by: Max Reitz <address@hidden>
---
qemu-img.c | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
Some long variable names, but it aids legibility. Nice fix.
Reviewed-by: Eric Blake <address@hidden>
(And here's hoping that Red Hat someday flips the switch so that new
images avoid compat=0.10 in their downstream builds, as we've had quite
a few corner cases where we already have optimized speed for compat=1.1 ...)
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org