From: Stefan Weinhuber <wein@linux.vnet.ibm.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Heinz Graalfs <graalfs@linux.vnet.ibm.com>,
Alexander Graf <agraf@suse.de>,
qemu-devel <qemu-devel@nongnu.org>,
Jens Freimann <jfrei@linux.vnet.ibm.com>,
Cornelia Huck <cornelia.huck@de.ibm.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Einar Lueck <elelueck@de.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO
Date: Wed, 02 May 2012 17:57:18 +0200 [thread overview]
Message-ID: <4FA1595E.40400@linux.vnet.ibm.com> (raw)
In-Reply-To: <4FA1446C.6020904@de.ibm.com>
On 2012-05-02 16:27, Christian Borntraeger wrote:
> On 02/05/12 14:54, Alexander Graf wrote:
>> On 05/02/2012 01:38 PM, Paolo Bonzini wrote:
>>>> On 05/02/2012 01:26 PM, Paolo Bonzini wrote:
>>>>>> and everyone should be happy :). I would really like to have as
>>>>>> little #ifdef TARGET_S390 code in QEMU. And #ifdef __s390__ is
>>>>>> even worse,
>>>>>> as it means we won't be able to execise that code path on other
>>>>>> architectures.
>>>>> True, but how do you exercise that code path with DASD geometry
>>>>> on !__s390__?
>>>> If we make things a flag for the guessing code, it should work just
>>>> as well with image files, right?
>>> Only when they're not blank. :) I was only thinking of #ifdef __s390__
>>> for the call to HDIO_GETGEO.
>>
>> Well, if guessing is a function
>>
>> guess_size(disk_size, block_size)
>>
>> then we would be able to do the same on an image file. Christian, would that work?
>
> I think that the geometry values can not always be guessed correctly based on
> block_size and disk_size.
>
> Stefan, can you clarify that?
>
> If we cannot reliably guess the geometry based on blocksize and size, I still think
> that we should use the host values, e.g. after checking that BIODASDINFO2 returns
> successfully.
If we know the device type (e.g. 3390) and the block_size, then we can
compute the number of blocks per track. The number of tracks per
cylinder is a given (15) and the number of cylinders can be computed
from these numbers and the disk_size.
How do we get the device type? I think we could get away with
restricting ECKD DASDs to type 3390, but even then, how would we
distinguish an ECKD DASD from anything else, e.g. a SCSI device?
We could simply attempt the above cylinder calculation for every device
and if we get a result without a remainder we just assume that we have a
DASD. This could lead to false positives, but maybe that is acceptable?
Stefan Weinhuber
next prev parent reply other threads:[~2012-05-02 15:58 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1335448165-26174-1-git-send-email-borntraeger@de.ibm.com>
[not found] ` <1335448165-26174-2-git-send-email-borntraeger@de.ibm.com>
[not found] ` <4F9AC55F.5000101@redhat.com>
2012-05-02 10:18 ` [Qemu-devel] [PATCH 1/3] Fix geometry sector calculation Christian Borntraeger
2012-05-02 10:25 ` Paolo Bonzini
2012-05-02 10:50 ` Christian Borntraeger
2012-05-02 11:05 ` Paolo Bonzini
2012-05-02 11:07 ` Alexander Graf
2012-05-02 11:09 ` Paolo Bonzini
2012-05-02 11:10 ` Alexander Graf
2012-05-02 11:23 ` Paolo Bonzini
[not found] ` <1335448165-26174-3-git-send-email-borntraeger@de.ibm.com>
[not found] ` <4F9AC55D.3000904@redhat.com>
2012-05-02 10:27 ` [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO Christian Borntraeger
2012-05-02 11:09 ` Alexander Graf
2012-05-02 11:26 ` Paolo Bonzini
2012-05-02 11:35 ` Alexander Graf
2012-05-02 11:38 ` Paolo Bonzini
2012-05-02 12:54 ` Alexander Graf
2012-05-02 14:27 ` Christian Borntraeger
2012-05-02 15:05 ` Alexander Graf
2012-05-02 18:49 ` Christian Borntraeger
2012-05-02 15:57 ` Stefan Weinhuber [this message]
2012-05-02 18:39 ` Alexander Graf
2012-05-02 11:56 ` Christian Borntraeger
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=4FA1595E.40400@linux.vnet.ibm.com \
--to=wein@linux.vnet.ibm.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=elelueck@de.ibm.com \
--cc=graalfs@linux.vnet.ibm.com \
--cc=jfrei@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.