All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Charles Arnold <carnold@suse.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] block: Fix vpc initialization of the Dynamic Disk Header
Date: Wed, 09 Nov 2011 17:38:51 +0100	[thread overview]
Message-ID: <4EBAAC9B.3000209@suse.de> (raw)
In-Reply-To: <4EBA48A90200009100076EF6@novprvoes0310.provo.novell.com>

Am 09.11.2011 17:32, schrieb Charles Arnold:
>>>> On 11/9/2011 at 08:58 AM, in message <4EBAA30D.1090209@redhat.com>, Kevin Wolf
> <kwolf@redhat.com> wrote: 
>>
>> Right, I'm not arguing that your change is wrong. What I'm asking for is
>> just something like:
>>
>> -    dyndisk_header->data_offset = be64_to_cpu(0xFFFFFFFF);
>> +    /* Note: The spec is actually wrong here, it says 0xFFFFFFFF, but
>> MS tools expect all 64 bits to be set */
>> +    dyndisk_header->data_offset = be64_to_cpu(0xFFFFFFFFFFFFFFFFULL);
>>
>> Kevin
> 
> Ok, I had the header comment on the brain, not a code comment. 
> Here is the revised patch.
> 
> - Charles
> 
> 
> 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
> like Citrix's vhd-util which checks specifically for the proper Data
> Offset field initialization.
> 
> Signed-off-by: Charles Arnold <carnold@suse.com>

Reviewed-by: Andreas Färber <afaerber@suse.de>

Andreas

> 
> diff --git a/block/vpc.c b/block/vpc.c
> index 416f489..179c6ae 100644
> --- a/block/vpc.c
> +++ b/block/vpc.c
> @@ -585,7 +585,11 @@ static int vpc_create(const char *filename, QEMUOptionParameter *options)
> 
>      memcpy(dyndisk_header->magic, "cxsparse", 8);
> 
> -    dyndisk_header->data_offset = be64_to_cpu(0xFFFFFFFF);
> +    /*
> +     * Note: The spec is actually wrong here for data_offset, it says
> +     * 0xFFFFFFFF, but MS tools expect all 64 bits to be set.
> +     */
> +    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);


-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2011-11-09 16:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2011-11-09 16:57         ` Kevin Wolf
2011-11-09 16:00     ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EBAAC9B.3000209@suse.de \
    --to=afaerber@suse.de \
    --cc=carnold@suse.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.