diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-05-17 20:06:42 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-05-17 20:06:42 +0000 |
commit | 47cea614a15371f50df11964e5642a427fed0c5b (patch) | |
tree | 5b08f9b4c73dd860735f9624b803d4c13bb1f5aa /vmdk.h | |
parent | aedf53821fef9f662c2f4fc0a83bc09e0768ed54 (diff) |
vmdk2raw: convert VMware disk images to raw images
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@813 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'vmdk.h')
-rw-r--r-- | vmdk.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/vmdk.h b/vmdk.h new file mode 100644 index 0000000000..a847f8b155 --- /dev/null +++ b/vmdk.h @@ -0,0 +1,52 @@ +/* + Copyright (C) Matthew Chapman 2003 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#define SECTOR_BITS 9 +#define SECTOR_SIZE (1 << SECTOR_BITS) +#define SECTOR_MASK (SECTOR_SIZE - 1) + +#define L1_BITS (SECTOR_BITS - 3) +#define L1_SIZE (1 << L1_BITS) +#define L1_MASK (L1_SIZE - 1) + +#define L2_BITS SECTOR_BITS +#define L2_SIZE (1 << L2_BITS) +#define L2_MASK (L2_SIZE - 1) + +#define MIN(x,y) (((x) < (y)) ? (x) : (y)) + +struct cowdisk_header +{ + char magic[4]; /* COWD */ + uint32_t version; + uint32_t flags; + uint32_t disk_sectors; + uint32_t granularity; + uint32_t l1dir_sector; + uint32_t l1dir_size; + uint32_t file_sectors; + uint32_t cylinders; + uint32_t heads; + uint32_t sectors_per_track; +}; + +struct cowdisk_header2 +{ + uint32_t parent_ts; + uint32_t timestamp; +}; |