All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Edmondson <dme@dme.org>
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: Fri, 17 Jan 2020 10:28:18 +0000	[thread overview]
Message-ID: <m21rryz8al.fsf@dme.org> (raw)
In-Reply-To: <7586b832-ecd2-e766-6781-3a25f382c9ed@redhat.com>

On Thursday, 2020-01-16 at 15:37:22 +01, Max Reitz wrote:

> So I suppose the best idea I can come up with is indeed a
> --target-is-zero flag for qemu-img convert -n.  Would that work for you?

I was looking at adding this for a slightly different reason (converting
sparse images to newly provisioned LUNs).

Followup is a naive patch (I'm new to hacking on qemu and the block
layer seems complex due to maturity) that works in my tests. Feedback
much appreciated.

The patch specifically targets the initial blanking of the image rather
than any other attempt to write zeroes, as I couldn't convince myself
that there was no control flow where qemu-img convert might need to
overwrite (with zeroes) data that it itself had previously written.

dme.
-- 
Stop the music and go home.


  parent reply	other threads:[~2020-01-17 10:29 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 [this message]
2020-01-16 14:47 ` Max Reitz
2020-01-16 14:53   ` Richard W.M. Jones
2020-01-16 14:57   ` Eric Blake
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=m21rryz8al.fsf@dme.org \
    --to=dme@dme.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.