qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0/2] Update documentation for qemu-img + add new


From: Jamie Lokier
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
User-agent: Mutt/1.5.13 (2006-08-11)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]