From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXY4C-0007lv-1Q for qemu-devel@nongnu.org; Thu, 24 May 2012 09:27:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXY46-0000pD-Dl for qemu-devel@nongnu.org; Thu, 24 May 2012 09:26:59 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:59648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXY46-0000os-55 for qemu-devel@nongnu.org; Thu, 24 May 2012 09:26:54 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 24 May 2012 14:26:51 +0100 Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by d06nrmr1407.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q4ODQmqo2396340 for ; Thu, 24 May 2012 14:26:48 +0100 Received: from d06av10.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q4ODH57a031517 for ; Thu, 24 May 2012 09:17:06 -0400 Message-ID: <4FBE3712.5030302@de.ibm.com> Date: Thu, 24 May 2012 15:26:42 +0200 From: Christian Borntraeger MIME-Version: 1.0 References: <1337858575-37612-1-git-send-email-borntraeger@de.ibm.com> <1337858575-37612-2-git-send-email-borntraeger@de.ibm.com> <4FBE1FF7.7050305@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1.1 1/1] Fix geometry sector calculation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Paolo Bonzini , Stefan Weinhuber , Christoph Hellwig , Markus Armbruster , qemu-devel On 24/05/12 15:06, Alexander Graf wrote: > > > On 24.05.2012, at 13:48, Paolo Bonzini wrote: > >> Il 24/05/2012 13:22, Christian Borntraeger ha scritto: >>> Currently the sector value for the geometry is masked, even if the >>> user usesa command line parameter that explicitely gives a number. >>> This breaks dasd devices on s390. A dasd device can have >>> a physical block size of 4096 (== same for logical block size) >>> and a typcial geometry of 15 heads and 12 sectors per cyl. >>> The ibm partition detection relies on a correct geometry >>> reported by the device. Unfortunately the current code changes >>> 12 to 8. This would be necessary if the total size is >>> not a multiple of logical sector size, but for dasd this >>> is not the case. >>> >>> This patch checks the device size and only applies sector >>> mask if necessary. >> >> Rereading the code, I have no idea what the masking is for. Perhaps we >> can even remove it. However, your patch makes sense, it is safe, and it >> would be nice to apply it even for 1.1. > > I also don't understand why this code is in virtio-blk.c. What does block geometry adjustment have to do with virtio? Indeed,my first version of the patch was just - blkcfg.sectors = secs & ~s->sector_mask; + blkcfg.sectors = secs; But then I read the commit message of this line, and the idea seems to be that a given geometry should be able to cover the full capacity of a disk (no half filled cylinders) >>From an s390 perspective all cases are fine and I would just remove the masking. I was just trying to keep the behaviour. Christian