From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLqQ5-0004DM-P0 for qemu-devel@nongnu.org; Thu, 12 Feb 2015 04:50:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLqQ2-0002GG-HY for qemu-devel@nongnu.org; Thu, 12 Feb 2015 04:50:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLqQ2-0002GC-0x for qemu-devel@nongnu.org; Thu, 12 Feb 2015 04:50:46 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1C9oj72014734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 12 Feb 2015 04:50:45 -0500 Date: Thu, 12 Feb 2015 10:50:42 +0100 From: Kevin Wolf Message-ID: <20150212095042.GC4189@noname.str.redhat.com> References: <1423671745-31547-1-git-send-email-kwolf@redhat.com> <54DBD899.3030603@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54DBD899.3030603@redhat.com> 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: Max Reitz Cc: qemu-devel@nongnu.org, stefanha@redhat.com Am 11.02.2015 um 23:32 hat Max Reitz geschrieben: > 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. Initially we rounded the size down. This ended up truncating images during qemu-img convert, so it was decided that rounding up is the less bad solution. > So, with that in mind (that nobody has been screaming so far): > > Reviewed-by: Max Reitz Thanks! > 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. That's possible. With VHD, however, I wouldn't make any such changes without proof that some software needs it and other software isn't affected. This is all pretty fragile. Kevin