qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Charles Arnold <carnold@suse.com>
Cc: qemu-devel@nongnu.org, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH] block: Add support for vpc Fixed Disk type
Date: Mon, 06 Feb 2012 17:51:08 +0100	[thread overview]
Message-ID: <4F3004FC.7070802@redhat.com> (raw)
In-Reply-To: <4F2F9BD60200009100079F2D@novprvoes0310.provo.novell.com>

Am 06.02.2012 17:22, schrieb Charles Arnold:
>>>> On 2/6/2012 at 08:46 AM, in message <4F2FF5B9.9090404@redhat.com>, Kevin Wolf
> <kwolf@redhat.com> wrote: 
>>
>> Somehow you lost the ret = -EFBIG here.
>>
>> Otherwise the patch looks good enough for me.
>>
>> Kevin
> 
> Thanks Kevin.  Here is the revised patch with just this fix.
> - Charles

Thanks, applied to the block branch.

I have one question left, though:

> +    total_sectors = total_size / BDRV_SECTOR_SIZE;
> +    if (disk_type == VHD_DYNAMIC) {
> +        /* Calculate matching total_size and geometry. Increase the number of
> +           sectors requested until we get enough (or fail). */
> +        for (i = 0; total_sectors > (int64_t)cyls * heads * secs_per_cyl;
> +             i++) {
> +            if (calculate_geometry(total_sectors + i,
> +                                   &cyls, &heads, &secs_per_cyl)) {
> +                ret = -EFBIG;
> +                goto fail;
> +            }
> +        }
> +    } else {
> +        if (calculate_geometry(total_sectors, &cyls, &heads, &secs_per_cyl)) {
> +            ret = -EFBIG;
> +            goto fail;
> +        }
> +    }

What's the reason that we need to do things differently here depending
on the subformat? Dynamic disks round up the size so that during image
conversion images won't be truncated. For fixed images,
calculate_geometry can round down, so don't fixed image have the same
problem?

Kevin

  reply	other threads:[~2012-02-06 16:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31 19:03 [Qemu-devel] [PATCH] block: Add support for vpc Fixed Disk type Charles Arnold
2012-01-31 22:08 ` Andreas Färber
2012-01-31 23:04   ` Charles Arnold
2012-01-31 23:15     ` Andreas Färber
2012-02-01 12:15     ` Kevin Wolf
2012-02-01 16:51       ` Charles Arnold
2012-02-01 17:09         ` Stefan Weil
2012-02-02  8:58         ` Kevin Wolf
2012-02-03  0:16           ` Charles Arnold
2012-02-06 15:46             ` Kevin Wolf
2012-02-06 16:22               ` Charles Arnold
2012-02-06 16:51                 ` Kevin Wolf [this message]
2012-02-06 23:48                   ` Charles Arnold
2012-02-07  9:22                     ` [Qemu-devel] [PATCH] vpc: Round up image size during fixed image creation Kevin Wolf

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=4F3004FC.7070802@redhat.com \
    --to=kwolf@redhat.com \
    --cc=afaerber@suse.de \
    --cc=carnold@suse.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 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).