[Top][All Lists]

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

Re: [Qemu-devel] [PATCH v2 3/5] block/vpc: make calculate_geometry spec

From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v2 3/5] block/vpc: make calculate_geometry spec conform
Date: Tue, 03 Mar 2015 10:05:11 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

On 2015-03-03 at 05:41, Peter Lieven wrote:
The VHD spec [1] allows for total_sectors of 65535 x 16 x 255 (~127GB)
represented by a CHS geometry. If total_sectors is greater
than 65535 x 16 x 255 this geometry is set as a maximum.

Qemu, Hyper-V and disk2vhd use this special geometry as an indicator
to use the image current size from the footer as disk size.

This patch changes vpc_create to effectively calculate a CxHxS geometry
for the given image size if possible while rounding up if necessary.
If the image size is to big to be represented in CHS we set the maximum

"too big" (as it was in v1) was correct, no need to make it wrong. :-)

and write the exact requested image size into the footer.

This partly reverts commit 258d2edb, but leaves support for >127G disks


Signed-off-by: Peter Lieven <address@hidden>
  block/vpc.c | 41 ++++++++++++++++++++++-------------------
  1 file changed, 22 insertions(+), 19 deletions(-)

With s/to big/too big/:

Reviewed-by: Max Reitz <address@hidden>

reply via email to

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