Fixup for DASD geometry detection
cover Fixup for DASD geometry detection
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(-)
Signature · 1 line
2.3.0
PATCH 1/1 block/raw-posix: avoid bogus fixup for cylinders on DASD disks
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"
--- block/raw-posix.c | 7 ------- 1 file changed, 7 deletions(-)
block/raw-posix.c +0 -7
@@ -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 ;
Signature · 1 line
2.3.0
Re: [Qemu-devel] [PATCH 1/1] block/raw-posix: avoid bogus fixup for cylinders on DASD disks
Quoted 8 lines · Christian Borntraeger
large volume DASD that have > 64k cylinders do claim to have
0xFFFEcylinders 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 <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>
Re: [Qemu-devel] [PATCH 1/1] block/raw-posix: avoid bogus fixup for cylinders on DASD disks
In reply to Christian BorntraegerQuoted 11 lines · On Mon, 14 Dec 2015 16:41:19 +0100 Christian Borntraeger…
large volume DASD that have > 64k cylinders do claim to have
0xFFFEcylinders 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 <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>--- block/raw-posix.c | 7 ------- 1 file changed, 7 deletions(-)
Maybe add cc:stable?
Re: [Qemu-devel] [PATCH 1/1] block/raw-posix: avoid bogus fixup for cylinders on DASD disks
Quoted 9 lines · Cornelia Huck
Quoted 6 lines · On Mon, 14 Dec 2015 16:41:19 +0100 Christian Borntraeger…
large volume DASD that have > 64k cylinders do claim to have
0xFFFEcylinders 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"
Quoted 7 lines
Quoted 5 lines
Acked-by Cornelia Huck <[email protected]>Signed-off-by Christian Borntraeger <[email protected]>--- block/raw-posix.c | 7 ------- 1 file changed, 7 deletions(-)Maybe add cc:stable?
Yes.
Kevin, ping. I assume this goes via your tree?
Kevin Wolf
AppliedAm 14.12.2015 um 16:41 hat Christian Borntraeger geschrieben:
Quoted 11 lines
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