|
|
cd9d16 |
From 69a9776f3e8a4ff5311f78cc63e52ea436dd9cbe Mon Sep 17 00:00:00 2001
|
|
|
cd9d16 |
From: Charles Arnold <carnold@suse.com>
|
|
|
cd9d16 |
Date: Wed, 9 Nov 2011 09:32:25 -0700
|
|
|
cd9d16 |
Subject: [PATCH] block: Fix vpc initialization of the Dynamic Disk Header
|
|
|
cd9d16 |
MIME-Version: 1.0
|
|
|
cd9d16 |
Content-Type: text/plain; charset=UTF-8
|
|
|
cd9d16 |
Content-Transfer-Encoding: 8bit
|
|
|
cd9d16 |
|
|
|
cd9d16 |
The Data Offset field in the Dynamic Disk Header is an 8 byte field.
|
|
|
cd9d16 |
Although the specification (2006-10-11) gives an example of initializing
|
|
|
cd9d16 |
only the first 4 bytes, images generated by Microsoft on Windows initialize
|
|
|
cd9d16 |
all 8 bytes.
|
|
|
cd9d16 |
|
|
|
cd9d16 |
Failure to initialize all 8 bytes results in errors from utilities
|
|
|
cd9d16 |
like Citrix's vhd-util which checks specifically for the proper Data
|
|
|
cd9d16 |
Offset field initialization.
|
|
|
cd9d16 |
|
|
|
cd9d16 |
Signed-off-by: Charles Arnold <carnold@suse.com>
|
|
|
cd9d16 |
Reviewed-by: Andreas Färber <afaerber@suse.de>
|
|
|
cd9d16 |
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
cd9d16 |
(cherry picked from commit 78439f6af1caa3e8bdafc9fc2d62aeefa53ed63a)
|
|
|
cd9d16 |
|
|
|
cd9d16 |
Signed-off-by: Bruce Rogers <brogers@suse.com>
|
|
|
cd9d16 |
Signed-off-by: Andreas Färber <afaerber@suse.de>
|
|
|
cd9d16 |
---
|
|
|
cd9d16 |
block/vpc.c | 6 +++++-
|
|
|
cd9d16 |
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
|
cd9d16 |
|
|
|
cd9d16 |
diff --git a/block/vpc.c b/block/vpc.c
|
|
|
cd9d16 |
index 56865da..ac33e15 100644
|
|
|
cd9d16 |
--- a/block/vpc.c
|
|
|
cd9d16 |
+++ b/block/vpc.c
|
|
|
cd9d16 |
@@ -587,7 +587,11 @@ static int vpc_create(const char *filename, QEMUOptionParameter *options)
|
|
|
cd9d16 |
|
|
|
cd9d16 |
memcpy(dyndisk_header->magic, "cxsparse", 8);
|
|
|
cd9d16 |
|
|
|
cd9d16 |
- dyndisk_header->data_offset = be64_to_cpu(0xFFFFFFFF);
|
|
|
cd9d16 |
+ /*
|
|
|
cd9d16 |
+ * Note: The spec is actually wrong here for data_offset, it says
|
|
|
cd9d16 |
+ * 0xFFFFFFFF, but MS tools expect all 64 bits to be set.
|
|
|
cd9d16 |
+ */
|
|
|
cd9d16 |
+ dyndisk_header->data_offset = be64_to_cpu(0xFFFFFFFFFFFFFFFFULL);
|
|
|
cd9d16 |
dyndisk_header->table_offset = be64_to_cpu(3 * 512);
|
|
|
cd9d16 |
dyndisk_header->version = be32_to_cpu(0x00010000);
|
|
|
cd9d16 |
dyndisk_header->block_size = be32_to_cpu(block_size);
|
|
|
cd9d16 |
--
|
|
|
cd9d16 |
1.7.11.2
|
|
|
cd9d16 |
|