diff mbox

[1/1] block/raw-posix: avoid bogus fixup for cylinders on DASD disks

Message ID 1450107679-34555-2-git-send-email-borntraeger@de.ibm.com
State New
Headers show

Commit Message

Christian Borntraeger Dec. 14, 2015, 3:41 p.m. UTC
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(-)

Comments

Markus Armbruster Dec. 14, 2015, 5:42 p.m. UTC | #1
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>
Cornelia Huck Dec. 14, 2015, 5:49 p.m. UTC | #2
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?
Christian Borntraeger Jan. 7, 2016, 9:23 a.m. UTC | #3
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?
diff mbox

Patch

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;