Skip to content

Commit

Permalink
block/raw-posix: avoid bogus fixup for cylinders on DASD disks
Browse files Browse the repository at this point in the history
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"

Cc: [email protected]
Acked-by: Cornelia Huck <[email protected]>
Signed-off-by: Christian Borntraeger <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
  • Loading branch information
borntraeger authored and kevmw committed Jan 19, 2016
1 parent 82dc8b4 commit 972b543
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions block/raw-posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,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) {
Expand All @@ -799,12 +798,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;
Expand Down

0 comments on commit 972b543

Please sign in to comment.