From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RO4gd-0006V5-8A for qemu-devel@nongnu.org; Wed, 09 Nov 2011 04:43:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RO4gc-0007tC-8K for qemu-devel@nongnu.org; Wed, 09 Nov 2011 04:43:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6055) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RO4gc-0007t5-06 for qemu-devel@nongnu.org; Wed, 09 Nov 2011 04:43:14 -0500 Message-ID: <4EBA4BEC.5040401@redhat.com> Date: Wed, 09 Nov 2011 10:46:20 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <4EB91FA20200009100076E0E@novprvoes0310.provo.novell.com> In-Reply-To: <4EB91FA20200009100076E0E@novprvoes0310.provo.novell.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] block: Fix vpc initialization of the Dynamic Disk Header List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Charles Arnold Cc: qemu-devel@nongnu.org Am 08.11.2011 20:25, schrieb Charles Arnold: > 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 > > 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); Can you please add a short comment explaining why we deviate from the specification in this point? If someone notices the discrepancy later, he shouldn't have to dig up the git commit message. Kevin