qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Einar Lueck <elelueck@linux.vnet.ibm.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@gmail.com,
	agraf@suse.de, qemu-devel@nongnu.org,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Jens Freimann <jfrei@linux.vnet.ibm.com>,
	cornelia.huck@de.ibm.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH V2] hd-geometry.c: Integrate HDIO_GETGEO in guessing
Date: Mon, 14 Jan 2013 17:09:09 +0100	[thread overview]
Message-ID: <50F42DA5.4010509@linux.vnet.ibm.com> (raw)
In-Reply-To: <878v7v290x.fsf@blackfin.pond.sub.org>

On 01/14/2013 02:23 PM, Markus Armbruster wrote:
> Einar Lueck <elelueck@linux.vnet.ibm.com> writes:
>
>> This patch extends the function hd_geometry_guess. If no geo could
>> be guessed via guess_disk_lchs, a new function called guess_disk_pchs is
>> called. The latter utilizes HDIO_GET_GEO ioctl to ask the underlying disk
>> for geometry.
>> If this is not successful (e.g. image files) geometry is derived
>> from the size of the disk (as before).
>> The new HDIO_GETGEO logic is required for two use cases:
>> a) Support for geometries of Direct Attached Storage Disks (DASD)
>> on s390x configured as backing of virtio block devices.
>> b) Support for FCP attached SCSI disks that do not yet have a
>> partition table. Without this patch, fdisk -l on the host would
>> return different results then fdisk -l in the guest.
>
> I'm afraid this could mess up existing, working disks.
>
> Consider a disk where guess_disk_lchs() fails and HDIO_GETGEO succeeds.
>
> The old code arbitrarily picks a "standard" physical geometry then.
>
> Your code picks the one returned by HDIO_GETGEO.
>
> Unless the two geometries happen to lead to a compatible address
> translation, any guest that actually uses the translation now sees
> different disk contents, with predictably bad results.
>
> Can this happen?  If no, why not?
>

You are right. There may be such cases. Thus, I see two options:
a) making this code portion platform specific (s390x)
b) introduction of a a command line option to force reconsideration of 
HDIO_GETGEO
My impression is, that the value of b) is limited to s390x and therefore 
a) is the way to go.

Regards,
Einar.

  reply	other threads:[~2013-01-14 16:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11 17:00 [Qemu-devel] [PATCH V2] hd-geometry.c: Integrate HDIO_GETGEO in guessing Einar Lueck
2013-01-11 17:01 ` Einar Lueck
2013-01-14 13:23   ` Markus Armbruster
2013-01-14 16:09     ` Einar Lueck [this message]
2013-01-14 16:31       ` Markus Armbruster

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=50F42DA5.4010509@linux.vnet.ibm.com \
    --to=elelueck@linux.vnet.ibm.com \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=armbru@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.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).