From: Eric Blake <eblake@redhat.com>
To: Max Reitz <mreitz@redhat.com>,
"Richard W.M. Jones" <rjones@redhat.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
mlevitsk@redhat.com, sgarzare@redhat.com
Subject: Re: Bug? qemu-img convert to preallocated image makes it sparse
Date: Thu, 16 Jan 2020 08:57:50 -0600 [thread overview]
Message-ID: <75daaf8f-0bfe-d3f6-5df4-88c29b2d9b07@redhat.com> (raw)
In-Reply-To: <962aa54b-f6e5-bb43-50a0-c4cad59cd22e@redhat.com>
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
next prev parent reply other threads:[~2020-01-16 14:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-16 14:13 Bug? qemu-img convert to preallocated image makes it sparse Richard W.M. Jones
2020-01-16 14:37 ` Max Reitz
2020-01-16 14:50 ` Kevin Wolf
2020-01-16 14:55 ` Max Reitz
2020-01-16 15:38 ` Maxim Levitsky
2020-01-16 15:56 ` Max Reitz
2020-01-16 16:00 ` Richard W.M. Jones
2020-01-16 16:02 ` Max Reitz
2020-01-17 10:28 ` David Edmondson
2020-01-16 14:47 ` Max Reitz
2020-01-16 14:53 ` Richard W.M. Jones
2020-01-16 14:57 ` Eric Blake [this message]
2020-01-16 15:03 ` Max Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=75daaf8f-0bfe-d3f6-5df4-88c29b2d9b07@redhat.com \
--to=eblake@redhat.com \
--cc=mlevitsk@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.com \
--cc=sgarzare@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).