qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Sam Eiderman <sameid@google.com>
Cc: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-block@nongnu.org, David Edmondson <dme@dme.org>,
	qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
	Tony Zhang <tzz@google.com>
Subject: Re: Clarification regarding new qemu-img convert --target-is-zero flag
Date: Wed, 10 Jun 2020 18:31:22 +0200	[thread overview]
Message-ID: <20200610163122.GF6947@linux.fritz.box> (raw)
In-Reply-To: <CAFr6bU=aD=AXnoR-qSdQtQC690FYFqFsDRHHGxdUDkTh2ho1cA@mail.gmail.com>

Am 10.06.2020 um 17:26 hat Sam Eiderman geschrieben:
> Thanks for the clarification Kevin,
> 
> Well first I want to discuss unallocated blocks.
> From my understanding operating systems do not rely on disks to be
> zero initialized, on the contrary, physical disks usually contain
> garbage.
> So an unallocated block should never be treated as zero by any real
> world application.

I think this is a dangerous assumption to make. The guest did have
access to these unallocated blocks before, and they read as zero, so not
writing these to the conversion target does change the virtual disk.
Whether or not this is a harmless change for the guest depends on the
software running in the VM.

> Now assuming that I only care about the allocated content of the
> disks, I would like to save io/time zeroing out unallocated blocks.
> 
> A real world example would be flushing a 500GB vmdk on a real SSD
> disk, if the vmdk contained only 2GB of data, no point in writing
> 498GB of zeroes to that SSD - reducing its lifespan for nothing.

Don't pretty much all SSDs support efficient zeroing/hole punching these
days so that the blocks would actually be deallocated on the disk level?

> Now from what I understand --target-is-zero will give me this behavior
> even though that I really use it as a "--skip-prezeroing-target"
> (sorry for the bad name)
> (This is only true if later *allocated zeroes* are indeed copied correctly)

As you noticed later, it doesn't.

The behaviour you want is more like -B, except that you don't have a
backing file. If you also pass -n, the actual filename you pass isn't
even used, so I guess '-B "" -n' should do the trick?

Kevin



  parent reply	other threads:[~2020-06-10 16:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10  5:28 Clarification regarding new qemu-img convert --target-is-zero flag Sam Eiderman
2020-06-10  6:16 ` Vladimir Sementsov-Ogievskiy
2020-06-10  6:28   ` Sam Eiderman
2020-06-10 11:37     ` Kevin Wolf
2020-06-10 11:52       ` Sam Eiderman
2020-06-10 11:56 ` David Edmondson
2020-06-10 12:19   ` Sam Eiderman
2020-06-10 13:36     ` Vladimir Sementsov-Ogievskiy
2020-06-10 14:06     ` Kevin Wolf
2020-06-10 15:26       ` Sam Eiderman
2020-06-10 15:29         ` Sam Eiderman
2020-06-10 15:42           ` David Edmondson
2020-06-10 15:47             ` Sam Eiderman
2020-06-10 15:48             ` Eric Blake
2020-06-10 15:57               ` David Edmondson
2020-06-10 16:21                 ` Eric Blake
2020-06-11 10:58                   ` David Edmondson
2020-06-10 16:31         ` Kevin Wolf [this message]
2020-06-11 13:41           ` Sam Eiderman

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=20200610163122.GF6947@linux.fritz.box \
    --to=kwolf@redhat.com \
    --cc=dme@dme.org \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sameid@google.com \
    --cc=tzz@google.com \
    --cc=vsementsov@virtuozzo.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).