qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: Fix vpc initialization of the Dynamic Disk Header
@ 2011-11-08 19:25 Charles Arnold
  2011-11-08 20:16 ` Andreas Färber
  2011-11-09  9:46 ` Kevin Wolf
  0 siblings, 2 replies; 9+ messages in thread
From: Charles Arnold @ 2011-11-08 19:25 UTC (permalink / raw)
  To: qemu-devel

The Data Offset field in the Dynamic Disk Header is an 8 byte field.
Although the specification (2006-10-11) gives an example of initializing
only the first 4 bytes, images generated by Microsoft on Windows initialize 
all 8 bytes.

Failure to initialize all 8 bytes results in errors from utilities
that check specifically for the complete Data Offset field initialization.

Signed-off-by: Charles Arnold <carnold@suse.com>

diff --git a/block/vpc.c b/block/vpc.c
index 416f489..35ac3fd 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -585,7 +585,7 @@ static int vpc_create(const char *filename, QEMUOptionParameter *options)

     memcpy(dyndisk_header->magic, "cxsparse", 8);

-    dyndisk_header->data_offset = be64_to_cpu(0xFFFFFFFF);
+    dyndisk_header->data_offset = be64_to_cpu(0xFFFFFFFFFFFFFFFFULL);
     dyndisk_header->table_offset = be64_to_cpu(3 * 512);
     dyndisk_header->version = be32_to_cpu(0x00010000);
     dyndisk_header->block_size = be32_to_cpu(block_size);

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-11-09 16:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-08 19:25 [Qemu-devel] [PATCH] block: Fix vpc initialization of the Dynamic Disk Header Charles Arnold
2011-11-08 20:16 ` Andreas Färber
2011-11-09  9:46 ` Kevin Wolf
2011-11-09 15:42   ` Charles Arnold
2011-11-09 15:58     ` Kevin Wolf
2011-11-09 16:32       ` Charles Arnold
2011-11-09 16:38         ` Andreas Färber
2011-11-09 16:57         ` Kevin Wolf
2011-11-09 16:00     ` Andreas Färber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).