From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLfqC-0003ID-AA for qemu-devel@nongnu.org; Wed, 11 Feb 2015 17:33:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLfq7-0003zE-BJ for qemu-devel@nongnu.org; Wed, 11 Feb 2015 17:33:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54262) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLfq7-0003z8-4U for qemu-devel@nongnu.org; Wed, 11 Feb 2015 17:32:59 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1BMWwCe001501 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 11 Feb 2015 17:32:58 -0500 Message-ID: <54DBD899.3030603@redhat.com> Date: Wed, 11 Feb 2015 17:32:57 -0500 From: Max Reitz MIME-Version: 1.0 References: <1423671745-31547-1-git-send-email-kwolf@redhat.com> In-Reply-To: <1423671745-31547-1-git-send-email-kwolf@redhat.com> Content-Type: multipart/alternative; boundary="------------060903080606090905000402" Subject: Re: [Qemu-devel] [PATCH] vpc: Fix size in fixed image creation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: stefanha@redhat.com This is a multi-part message in MIME format. --------------060903080606090905000402 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2015-02-11 at 11:22, Kevin Wolf wrote: > If total_sectors is rounded to match the geometry, total_size needs to > be changed as well. Otherwise we end up with an image whose geometry > describes a disk larger than the image file, which doesn't end well. > > Signed-off-by: Kevin Wolf > --- > block/vpc.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) Looks fine to me, but the spec says: "When the user creates a hard disk of a certain size, the size of the hard disk image in the virtual machine is smaller than that created by the user. This is because CHS value calculated from the hard disk size is rounded down." So, well, qemu has been violating the specification all along, I guess. So, with that in mind (that nobody has been screaming so far): Reviewed-by: Max Reitz Alternatively we may want to "fix" it, and actually let the CHS size be smaller than total_sectors/total_size, if that's possible. But maybe that'll be even worse, so I'm fine either way. --------------060903080606090905000402 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id t1BMWwCe001501
On 2015-02-11 at 11:22, Kevin Wolf wrote:
If total_sectors is rounded to match the geometry, t=
otal_size needs to
be changed as well. Otherwise we end up with an image whose geometry
describes a disk larger than the image file, which doesn't end well.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/vpc.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Looks fine to me, but the spec says: "When the user creates a hard disk of a certain size, the size of the hard disk image in the virtual machine is smaller than that created by the user. This is because CHS value calculated from the hard disk size is rounded down."

So, well, qemu has been violating the specification all along, I guess.

So, with that in mind (that nobody has been screaming so far):

Reviewed-by: Max Reitz <mreitz@redhat.com>

Alternatively we may want to "fix" it, and actually let the CHS size be smaller than total_sectors/total_size, if that's possible. But maybe that'll be even worse, so I'm fine either way.
--------------060903080606090905000402--