On 11/21/2012 02:01 AM, Dietmar Maurer wrote: > This is a very simple archive format, see docs/specs/vma_spec.txt > > Signed-off-by: Dietmar Maurer <diet...@proxmox.com> > ---
> +++ b/docs/specs/vma_spec.txt > @@ -0,0 +1,24 @@ > +=Virtual Machine Archive format (VMA)= > + > +This format contains a header which includes the VM configuration as > +binary blobs, and a list of devices (dev_id, name). > + > +The actual VM image date is stored inside extends. En extend contains s/date/data/ s/extends. En extend/extents. An extent/ > +up to 64 clusters, and start with a 512 byte header containing > +additional information for those clusters. > + > +We use a cluster size of 65536, and use 8 bytes for each > +cluster in the header to store the following information: > + > +* 1 byte dev_id (to identity the drive) > +* 2 bytes zero indicator (mark zero regions (16x4069)) s/4069/4096/ > +* 4 bytes cluster number Is that sufficient, or is it possible to have an image larger than 64k*4G that would overflow? > +* 1 byte not used (reserved) > + > +We only store non-zero blocks (such block is 4096 bytes). > + > +Each archive is marked with an unique uuid. The archive header and all s/an unique/a/ (by definition, 'uuid' is an acronym that already means unique; also, it is 'a' and not 'an' before any 'u' pronounced as 'y', which is true for both 'unique' and a spelled-out 'uuid') > +extend headers includes that uuid and a MD5 checksum (over header s/extend/extent/ > +data). > + > + > diff --git a/vma-reader.c b/vma-reader.c > new file mode 100644 > index 0000000..7a54de5 > --- /dev/null > +++ b/vma-reader.c > @@ -0,0 +1,720 @@ > +/* > + * VMA: Virtual Machine Archive > + * > + * Copyright (C) Proxmox Server Solutions Missing a year. > + * > + * Authors: > + * Dietmar Maurer (diet...@proxmox.com) > + * > + * This work is licensed under the terms of the GNU GPL, version 2. See Can you please use GPLv2+ (the 'or later' clause is essential if you want your work to be reusable in GPLv3[+] projects)? I didn't review the code, just the specification. I have to wonder how much of your work overlaps with Paolo's 'drive-mirror' and NBD server work; and it seems to me that it is better to use 'drive-mirror' for doing backup work into existing disk formats, rather than inventing yet another archive format. -- Eric Blake ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature