From: Markus Armbruster <armbru@redhat.com>
To: Einar Lueck <elelueck@linux.vnet.ibm.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 14:23:26 +0100 [thread overview]
Message-ID: <878v7v290x.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <1357923660-35202-2-git-send-email-elelueck@linux.vnet.ibm.com> (Einar Lueck's message of "Fri, 11 Jan 2013 18:01:00 +0100")
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?
next prev parent reply other threads:[~2013-01-14 14:05 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 [this message]
2013-01-14 16:09 ` Einar Lueck
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=878v7v290x.fsf@blackfin.pond.sub.org \
--to=armbru@redhat.com \
--cc=agraf@suse.de \
--cc=aliguori@us.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=cornelia.huck@de.ibm.com \
--cc=elelueck@linux.vnet.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 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.