diff options
author | Jeff Cody <jcody@redhat.com> | 2013-04-29 14:48:18 -0400 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2013-05-03 10:31:58 +0200 |
commit | e8d4e5ffdb015959551726a5700c19b5d772ada4 (patch) | |
tree | bb4b808e5a9f1d8671994140bee9498bd51c35fd /block/vhdx.h | |
parent | 203cdba3bc6fb6022dbece90483fe03ed33bcffb (diff) |
block: initial VHDX driver support framework - supports open and probe
This is the initial block driver framework for VHDX image support
(i.e. Hyper-V image file formats), that supports opening VHDX files, and
parsing the headers.
This commit does not yet enable:
- reading
- writing
- updating the header
- differencing files (images with parents)
- log replay / dirty logs (only clean images)
This is based on Microsoft's VHDX specification:
"VHDX Format Specification v0.95", published 4/12/2012
https://www.microsoft.com/en-us/download/details.aspx?id=29681
Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/vhdx.h')
-rw-r--r-- | block/vhdx.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/block/vhdx.h b/block/vhdx.h index fcddd37d98..c3b64c6ff6 100644 --- a/block/vhdx.h +++ b/block/vhdx.h @@ -308,4 +308,18 @@ typedef struct QEMU_PACKED VHDXParentLocatorEntry { /* ----- END VHDX SPECIFICATION STRUCTURES ---- */ + +uint32_t vhdx_checksum_calc(uint32_t crc, uint8_t *buf, size_t size, + int crc_offset); + +bool vhdx_checksum_is_valid(uint8_t *buf, size_t size, int crc_offset); + + +static void leguid_to_cpus(MSGUID *guid) +{ + le32_to_cpus(&guid->data1); + le16_to_cpus(&guid->data2); + le16_to_cpus(&guid->data3); +} + #endif |