qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] block: Add support for vpc Fixed Disk type


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH] block: Add support for vpc Fixed Disk type
Date: Mon, 06 Feb 2012 17:51:08 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0

Am 06.02.2012 17:22, schrieb Charles Arnold:
>>>> On 2/6/2012 at 08:46 AM, in message <address@hidden>, Kevin Wolf
> <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]