From: Anthony Liguori <anthony@codemonkey.ws>
To: "Richard W.M. Jones" <rjones@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com
Subject: Re: [Qemu-devel] [PATCH] Detect zero writes (for discussion only, not to be applied)
Date: Fri, 27 Jul 2012 08:55:31 -0500 [thread overview]
Message-ID: <87wr1p8g18.fsf@codemonkey.ws> (raw)
In-Reply-To: <1343318389-28877-1-git-send-email-rjones@redhat.com>
"Richard W.M. Jones" <rjones@redhat.com> writes:
> [Applies against qemu 1.1.0, not HEAD, because qemu from git seems to
> be broken at the moment. But the patch is easy to rebase.]
How's it broken?
Regards,
Anthony Liguori
> This patch adds a -drive detect_zero=on|off flag (defaults to "off").
>
> Setting this on causes the write path to detect all zero byte writes
> and, for block device drivers which support this, turn the request
> into the more space-efficient bdrv_co_do_write_zeroes call.
>
> The use case is for virt-sparsify. We want to create an intermediate
> qcow2 overlay file which we know will mostly contain zeroes, and we
> want qcow2 to handle this without creating a huge empty file. In my
> testing, the size of the intermediate file is reduced considerably
> (down to about 1/4 of the original size), making sparsification of
> large mostly-empty guests possible for the first time.
>
> The implementation is very simple-minded. It tests if the entire
> request is all zero bytes or not. A better implementation would
> almost certainly be even more space-efficient, but at the cost of
> splitting some write requests (if that's a problem).
>
> Testing: I booted and tested an F16 guest with this patch and the
> setting "on", without problems. I also modified libguestfs to add
> this flag, then ran the whole libguestfs test suite with no reported
> problems.
>
> Rich.
next prev parent reply other threads:[~2012-07-27 13:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-26 15:59 [Qemu-devel] [PATCH] Detect zero writes (for discussion only, not to be applied) Richard W.M. Jones
2012-07-26 15:59 ` [Qemu-devel] [PATCH] block: Add -drive detect_zero=on|off option to detect all zero writes Richard W.M. Jones
2012-07-27 13:58 ` Anthony Liguori
2012-07-27 19:01 ` Paolo Bonzini
2012-07-30 13:51 ` Richard W.M. Jones
2012-07-30 13:57 ` Paolo Bonzini
2012-07-30 14:03 ` Eric Blake
2012-07-30 14:09 ` Paolo Bonzini
2012-07-30 14:38 ` Kevin Wolf
2012-07-30 15:52 ` Richard W.M. Jones
2012-07-27 13:55 ` Anthony Liguori [this message]
2012-07-27 15:14 ` [Qemu-devel] [PATCH] Detect zero writes (for discussion only, not to be applied) Richard W.M. Jones
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=87wr1p8g18.fsf@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rjones@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.