All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/1] Fixup for DASD geometry detection
@ 2015-12-14 15:41 Christian Borntraeger
  2015-12-14 15:41 ` [Qemu-devel] [PATCH 1/1] block/raw-posix: avoid bogus fixup for cylinders on DASD disks Christian Borntraeger
  2016-01-12 14:25 ` [Qemu-devel] [PATCH 0/1] Fixup for DASD geometry detection Kevin Wolf
  0 siblings, 2 replies; 6+ messages in thread
From: Christian Borntraeger @ 2015-12-14 15:41 UTC (permalink / raw)
  To: Kevin Wolf
  Cc: qemu-block, Ekaterina Tumanova, qemu-devel,
	Christian Borntraeger, Jens Freimann, Cornelia Huck

Kevin,

here is a fixup for the geometry detection. We tried to be overly
clever and calculate the cyclinder size for devices > 64k cyls. Now
this is wrong for the cyls parameter as the interface only has
16bit. Large DASD devices have a special token (0xfffe) that 
indicate to the DASD related code, that you have to calculate
the cyls size yourself.

Without this patch QEMU cannot pass through bigger DASD disks
and complains "cyls must be between 1 and 65535"


Christian Borntraeger (1):
  block/raw-posix: avoid bogus fixup for cylinders on DASD disks

 block/raw-posix.c | 7 -------
 1 file changed, 7 deletions(-)

-- 
2.3.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [PATCH 1/1] block/raw-posix: avoid bogus fixup for cylinders on DASD disks
  2015-12-14 15:41 [Qemu-devel] [PATCH 0/1] Fixup for DASD geometry detection Christian Borntraeger
@ 2015-12-14 15:41 ` Christian Borntraeger
  2015-12-14 17:42   ` Markus Armbruster
  2015-12-14 17:49   ` Cornelia Huck
  2016-01-12 14:25 ` [Qemu-devel] [PATCH 0/1] Fixup for DASD geometry detection Kevin Wolf
  1 sibling, 2 replies; 6+ messages in thread
From: Christian Borntraeger @ 2015-12-14 15:41 UTC (permalink / raw)
  To: Kevin Wolf
  Cc: qemu-block, Ekaterina Tumanova, qemu-devel,
	Christian Borntraeger, Jens Freimann, Cornelia Huck

large volume DASD that have > 64k cylinders do claim to have
0xFFFE cylinders as special value in the old 16 bit field. We
want to pass this "token" along to the guest, instead of
calculating the real number. Otherwise qemu might fail with
"cyls must be between 1 and 65535"

Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 block/raw-posix.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/block/raw-posix.c b/block/raw-posix.c
index d9162fd..2fff184 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -783,7 +783,6 @@ static int hdev_probe_geometry(BlockDriverState *bs, HDGeometry *geo)
 {
     BDRVRawState *s = bs->opaque;
     struct hd_geometry ioctl_geo = {0};
-    uint32_t blksize;
 
     /* If DASD, get its geometry */
     if (check_for_dasd(s->fd) < 0) {
@@ -803,12 +802,6 @@ static int hdev_probe_geometry(BlockDriverState *bs, HDGeometry *geo)
     }
     geo->heads = ioctl_geo.heads;
     geo->sectors = ioctl_geo.sectors;
-    if (!probe_physical_blocksize(s->fd, &blksize)) {
-        /* overwrite cyls: HDIO_GETGEO result is incorrect for big drives */
-        geo->cylinders = bdrv_nb_sectors(bs) / (blksize / BDRV_SECTOR_SIZE)
-                                             / (geo->heads * geo->sectors);
-        return 0;
-    }
     geo->cylinders = ioctl_geo.cylinders;
 
     return 0;
-- 
2.3.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 1/1] block/raw-posix: avoid bogus fixup for cylinders on DASD disks
  2015-12-14 15:41 ` [Qemu-devel] [PATCH 1/1] block/raw-posix: avoid bogus fixup for cylinders on DASD disks Christian Borntraeger
@ 2015-12-14 17:42   ` Markus Armbruster
  2015-12-14 17:49   ` Cornelia Huck
  1 sibling, 0 replies; 6+ messages in thread
From: Markus Armbruster @ 2015-12-14 17:42 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: Kevin Wolf, qemu-block, Ekaterina Tumanova, qemu-devel,
	Jens Freimann, Cornelia Huck

Christian Borntraeger <borntraeger@de.ibm.com> writes:

> large volume DASD that have > 64k cylinders do claim to have
> 0xFFFE cylinders as special value in the old 16 bit field. We
> want to pass this "token" along to the guest, instead of
> calculating the real number. Otherwise qemu might fail with
> "cyls must be between 1 and 65535"
>
> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>

Reviewed-by: Markus Armbruster <armbru@redhat.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 1/1] block/raw-posix: avoid bogus fixup for cylinders on DASD disks
  2015-12-14 15:41 ` [Qemu-devel] [PATCH 1/1] block/raw-posix: avoid bogus fixup for cylinders on DASD disks Christian Borntraeger
  2015-12-14 17:42   ` Markus Armbruster
@ 2015-12-14 17:49   ` Cornelia Huck
  2016-01-07  9:23     ` Christian Borntraeger
  1 sibling, 1 reply; 6+ messages in thread
From: Cornelia Huck @ 2015-12-14 17:49 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: Kevin Wolf, Ekaterina Tumanova, qemu-devel, qemu-block, Jens Freimann

On Mon, 14 Dec 2015 16:41:19 +0100
Christian Borntraeger <borntraeger@de.ibm.com> wrote:

> large volume DASD that have > 64k cylinders do claim to have
> 0xFFFE cylinders as special value in the old 16 bit field. We
> want to pass this "token" along to the guest, instead of
> calculating the real number. Otherwise qemu might fail with
> "cyls must be between 1 and 65535"
> 
> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  block/raw-posix.c | 7 -------
>  1 file changed, 7 deletions(-)

Maybe add cc:stable?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 1/1] block/raw-posix: avoid bogus fixup for cylinders on DASD disks
  2015-12-14 17:49   ` Cornelia Huck
@ 2016-01-07  9:23     ` Christian Borntraeger
  0 siblings, 0 replies; 6+ messages in thread
From: Christian Borntraeger @ 2016-01-07  9:23 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: Kevin Wolf, Ekaterina Tumanova, qemu-devel, qemu-block, Jens Freimann

On 12/14/2015 06:49 PM, Cornelia Huck wrote:
> On Mon, 14 Dec 2015 16:41:19 +0100
> Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> 
>> large volume DASD that have > 64k cylinders do claim to have
>> 0xFFFE cylinders as special value in the old 16 bit field. We
>> want to pass this "token" along to the guest, instead of
>> calculating the real number. Otherwise qemu might fail with
>> "cyls must be between 1 and 65535"
>>
>> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
>> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
>> ---
>>  block/raw-posix.c | 7 -------
>>  1 file changed, 7 deletions(-)
> 
> Maybe add cc:stable?

Yes.

Kevin, ping. I assume this goes via your tree?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH 0/1] Fixup for DASD geometry detection
  2015-12-14 15:41 [Qemu-devel] [PATCH 0/1] Fixup for DASD geometry detection Christian Borntraeger
  2015-12-14 15:41 ` [Qemu-devel] [PATCH 1/1] block/raw-posix: avoid bogus fixup for cylinders on DASD disks Christian Borntraeger
@ 2016-01-12 14:25 ` Kevin Wolf
  1 sibling, 0 replies; 6+ messages in thread
From: Kevin Wolf @ 2016-01-12 14:25 UTC (permalink / raw)
  To: Christian Borntraeger
  Cc: Cornelia Huck, Ekaterina Tumanova, qemu-devel, qemu-block, Jens Freimann

Am 14.12.2015 um 16:41 hat Christian Borntraeger geschrieben:
> Kevin,
> 
> here is a fixup for the geometry detection. We tried to be overly
> clever and calculate the cyclinder size for devices > 64k cyls. Now
> this is wrong for the cyls parameter as the interface only has
> 16bit. Large DASD devices have a special token (0xfffe) that 
> indicate to the DASD related code, that you have to calculate
> the cyls size yourself.
> 
> Without this patch QEMU cannot pass through bigger DASD disks
> and complains "cyls must be between 1 and 65535"

Thanks, applied to the block branch.

Kevin

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-12 14:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-14 15:41 [Qemu-devel] [PATCH 0/1] Fixup for DASD geometry detection Christian Borntraeger
2015-12-14 15:41 ` [Qemu-devel] [PATCH 1/1] block/raw-posix: avoid bogus fixup for cylinders on DASD disks Christian Borntraeger
2015-12-14 17:42   ` Markus Armbruster
2015-12-14 17:49   ` Cornelia Huck
2016-01-07  9:23     ` Christian Borntraeger
2016-01-12 14:25 ` [Qemu-devel] [PATCH 0/1] Fixup for DASD geometry detection Kevin Wolf

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.