From: Christian Borntraeger Date: Mon, 14 Dec 2015 15:41:19 +0000 (+0100) Subject: block/raw-posix: avoid bogus fixup for cylinders on DASD disks X-Git-Tag: v2.5.1~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=643c8d8ec102097a4bee2ba0ec1e42415371e659;p=thirdparty%2Fqemu.git 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" Cc: qemu-stable@nongnu.org Acked-by: Cornelia Huck Signed-off-by: Christian Borntraeger Reviewed-by: Markus Armbruster Signed-off-by: Kevin Wolf (cherry picked from commit 972b543c6b63579aee590b738d21af09f01569f7) Signed-off-by: Michael Roth --- diff --git a/block/raw-posix.c b/block/raw-posix.c index d9162fd3064..2fff1843cb1 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;