From: Fam Zheng <famz@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 3/5] vmdk: Add option to create zeroed-grain image
Date: Tue, 23 Apr 2013 08:52:02 +0800 [thread overview]
Message-ID: <20130423005202.GB8905@localhost.localdomain> (raw)
In-Reply-To: <20130422140627.GH21317@stefanha-thinkpad.redhat.com>
On Mon, 04/22 16:06, Stefan Hajnoczi wrote:
> On Mon, Apr 22, 2013 at 10:07:57AM +0800, Fam Zheng wrote:
> > Add image create option "zeroed-grain" to enable zeroed-grain GTE
> > feature of vmdk sparse extents. When this option is on, header version
> > of newly created extent will be 2 and VMDK4_FLAG_ZG flag bit will be
> > set.
> > Signed-off-by: Fam Zheng <famz@redhat.com>
> > ---
> > block/vmdk.c | 22 +++++++++++++++++-----
> > 1 file changed, 17 insertions(+), 5 deletions(-)
>
> Is there a way to upgrade an image file to use zeroed-grain GTEs once
> the file has been created?
>
Yes. We have discussed this on IRC.
Here's how we do it:
- If file version is 2 and zeroed-grain GTE bit set in header, we can
support bdrv_co_write_zeroes (this patch series implemented).
- If the file version is 2, we can enable zeroed-grain flag in header
on bdrv_co_write_zeroes, and use zeroed-grain GTE. (need another
patch to update the header).
- Otherwize, -ENOTSUP
For background, here's how vmware uses this feature:
- On shrinking a *child* disk (e.g.: vmware-vdiskmanager -k
child.vmdk), if the child cluster is filled with zero, then the image
version is upgraded to 2 and zeroed-grian flag is set, and
zeroed-grain GTE is used to clear out the cluster, no need to take
care of parent cluster allocation and actual data at all. That's
where the efficiency comes.
--
Fam
next prev parent reply other threads:[~2013-04-23 0:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-22 2:07 [Qemu-devel] [PATCH v2 0/5] vmdk: zeroed-grain GTE support Fam Zheng
2013-04-22 2:07 ` [Qemu-devel] [PATCH v2 1/5] vmdk: named return code Fam Zheng
2013-04-22 2:07 ` [Qemu-devel] [PATCH v2 2/5] vmdk: add support for “zeroed‐grain” GTE Fam Zheng
2013-04-22 2:07 ` [Qemu-devel] [PATCH v2 3/5] vmdk: Add option to create zeroed-grain image Fam Zheng
2013-04-22 14:06 ` Stefan Hajnoczi
2013-04-23 0:52 ` Fam Zheng [this message]
2013-04-23 7:00 ` Stefan Hajnoczi
2013-04-22 2:07 ` [Qemu-devel] [PATCH v2 4/5] vmdk: change magic number to macro Fam Zheng
2013-04-22 2:07 ` [Qemu-devel] [PATCH v2 5/5] vmdk: add bdrv_co_write_zeroes Fam Zheng
2013-04-22 14:49 ` Stefan Hajnoczi
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=20130423005202.GB8905@localhost.localdomain \
--to=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=stefanha@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).