qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Alexander Graf <agraf@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Stefan Weinhuber <wein@linux.vnet.ibm.com>,
	Christoph Hellwig <hch@lst.de>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1.1 1/1] Fix geometry sector calculation
Date: Thu, 24 May 2012 15:26:42 +0200	[thread overview]
Message-ID: <4FBE3712.5030302@de.ibm.com> (raw)
In-Reply-To: <BA1CB0BB-95EE-4A39-B744-4C3D7EEBD6EC@suse.de>

On 24/05/12 15:06, Alexander Graf wrote:
> 
> 
> On 24.05.2012, at 13:48, Paolo Bonzini <pbonzini@redhat.com> 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

  reply	other threads:[~2012-05-24 13:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1337858575-37612-1-git-send-email-borntraeger@de.ibm.com>
2012-05-24 11:22 ` [Qemu-devel] [PATCH 1/1] Fix geometry sector calculation Christian Borntraeger
2012-05-24 11:48   ` [Qemu-devel] [PATCH 1.1 " Paolo Bonzini
2012-05-24 13:06     ` Alexander Graf
2012-05-24 13:26       ` Christian Borntraeger [this message]
2012-05-25 11:53         ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FBE3712.5030302@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=armbru@redhat.com \
    --cc=hch@lst.de \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wein@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).