From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49118) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSoaF-0002Yc-TH for qemu-devel@nongnu.org; Tue, 03 Mar 2015 10:18:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSoaA-00085r-Qp for qemu-devel@nongnu.org; Tue, 03 Mar 2015 10:18:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47002) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSoaA-00084Q-Jd for qemu-devel@nongnu.org; Tue, 03 Mar 2015 10:18:02 -0500 Message-ID: <54F5CDA7.9060306@redhat.com> Date: Tue, 03 Mar 2015 10:05:11 -0500 From: Max Reitz MIME-Version: 1.0 References: <1425379316-19639-1-git-send-email-pl@kamp.de> <1425379316-19639-4-git-send-email-pl@kamp.de> In-Reply-To: <1425379316-19639-4-git-send-email-pl@kamp.de> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 3/5] block/vpc: make calculate_geometry spec conform List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , qemu-devel@nongnu.org Cc: kwolf@redhat.com, carnold@suse.com, jcody@redhat.com, famz@redhat.com, stefanha@redhat.com 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 > intact. > > [1] http://download.microsoft.com/download/f/f/e/ffef50a5-07dd-4cf8-aaa3-442c0673a029/Virtual%20Hard%20Disk%20Format%20Spec_10_18_06.doc > > Signed-off-by: Peter Lieven > --- > block/vpc.c | 41 ++++++++++++++++++++++------------------- > 1 file changed, 22 insertions(+), 19 deletions(-) With s/to big/too big/: Reviewed-by: Max Reitz