qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jamie Lokier <jamie@shareable.org>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 0/2] Update documentation for qemu-img + add new -B option
Date: Wed, 4 Jun 2008 16:39:53 +0100	[thread overview]
Message-ID: <20080604153953.GA31234@shareable.org> (raw)
In-Reply-To: <aaccfcb60806040324j374ac350n40a2488e0aa8026f@mail.gmail.com>

Marc Bevand wrote:
> > Another thing, which might be easier and more useful, would be
> > instantiating zeros in the source image into holes in the relative
> > image.  To save space, after lots of changes on the virtual hard disk
> > and some zeroing.  (Microsoft has a tool to do this with Virtual PC).
> 
> Actually "qemu-img convert A B" already does this: zeros in A are
> converted to holes in B (more precisely: real holes if B is a raw
> image, or undefined clusters if the qcow/qcow2 case). B in this
> example would be a flat image.
> 
> If you wanted to do the same thing with B a relative image, the
> qcow/qcow2 format would need to be extended because there is currently
> no defined way to efficiently represent zero'd clusters in relative
> images. (Or actually now that I think about it maybe we could
> represent zero'd clusters as if they were compressed even when
> compression is disabled.)

I was actually thinking the base image already has zeros in those
sectors, typically.  This is when you created a relative image, did
lots of work in it, finished by deleting lots of temporary files, ran
a cleanup tool (in the guest) which zeros sectors which aren't
referenced in the filesystem, then those sectors match what's in the
base image again.

But your idea is even better.

> I am curious, does Virtual PC support relative aka copy-on-write images ?

Yes, quite well.  It calls it "Differencing".

You can have images which are relative to other relative images too,
to any depth, to easily branch different test cases and configurations.

Btw, a couple of things I noticed, not sure where else to mention
them:

  - When using a relative image, you should be able to set the
    permissions on the base image to read-only.  If you have a lot of
    relative images, it's really important not to modify the base
    image, and worrying that one of your QEMU processes might write to
    the base image.  Virtual PC allows the base image to be read-only,
    and quite a lot of notes on Differencing stress how important it
    is to set permissions that way, if you are sharing the base.

  - I'm never sure from the documentation what happens when using
    '-snapshot' with a relative image, and you issue the 'commit'
    monitor command.  Does it commit the snapshot to the relative
    image, or the snapshot all the way to the base image (as help suggests).

  - Same for images which are relative to other relative images,
    i.e. nested.  How far up the tree does 'commit' write too?

  - qemu's 'vpc' format support isn't mentioned in the man page.
    That would explain why someone submitted another implementation a
    while back.

  - 'vpc' format support is broken: using Microsoft's freely
    downloadable "Windows Server 2003 R2" image, which is in 'vpc'
    format, will show lots of corruption and chkdsk errors.  "qemu-img
    convert" to convert to raw format, then using that, results in the
    same.  Using Virtual PC's convert-to-raw program results in an
    image which runs in QEMU without these errors, so it's clearly a
    bug in the 'vpc' format handling.

Cheers,
-- Jamie

  reply	other threads:[~2008-06-04 15:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-04  6:22 [Qemu-devel] [PATCH 0/2] Update documentation for qemu-img + add new -B option Marc Bevand
2008-06-04  6:23 ` [Qemu-devel] [PATCH 1/2] Update documentation for qemu-img convert options Marc Bevand
2008-06-04 13:54   ` [Qemu-devel] " Anthony Liguori
2008-06-04  6:23 ` [Qemu-devel] [PATCH 2/2] New qemu-img convert -B option to preserve the COW aspect of images and/or re-base them Marc Bevand
2008-06-04 14:03   ` [Qemu-devel] " Anthony Liguori
2008-06-04  7:37 ` [Qemu-devel] [PATCH 0/2] Update documentation for qemu-img + add new -B option Jamie Lokier
2008-06-04 10:24   ` Marc Bevand
2008-06-04 15:39     ` Jamie Lokier [this message]
2008-06-04 17:09       ` Marc Bevand
2008-06-05 12:16         ` Jamie Lokier

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=20080604153953.GA31234@shareable.org \
    --to=jamie@shareable.org \
    --cc=qemu-devel@nongnu.org \
    /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).