From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51602) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai3ds-0001py-TR for qemu-devel@nongnu.org; Mon, 21 Mar 2016 13:29:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ai3do-0000yB-S8 for qemu-devel@nongnu.org; Mon, 21 Mar 2016 13:29:24 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:49729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai3do-0000xM-Et for qemu-devel@nongnu.org; Mon, 21 Mar 2016 13:29:20 -0400 Received: from localhost by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 21 Mar 2016 11:29:18 -0600 From: Michael Roth Date: Mon, 21 Mar 2016 12:28:17 -0500 Message-Id: <1458581313-19045-20-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1458581313-19045-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1458581313-19045-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 19/35] block/raw-posix: avoid bogus fixup for cylinders on DASD disks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Christian Borntraeger , qemu-stable@nongnu.org, Michael Roth From: Christian Borntraeger 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 --- 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; -- 1.9.1