From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpMd5-0004mB-19 for qemu-devel@nongnu.org; Thu, 12 Jul 2012 12:52:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SpMd1-00076J-0A for qemu-devel@nongnu.org; Thu, 12 Jul 2012 12:52:38 -0400 Received: from oxygen.pond.sub.org ([78.46.104.156]:54154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpMd0-000768-PZ for qemu-devel@nongnu.org; Thu, 12 Jul 2012 12:52:34 -0400 Received: from blackfin.pond.sub.org (p5B32A8C0.dip.t-dialin.net [91.50.168.192]) by oxygen.pond.sub.org (Postfix) with ESMTPA id C2EC99FE43 for ; Thu, 12 Jul 2012 18:52:32 +0200 (CEST) From: Markus Armbruster Date: Thu, 12 Jul 2012 18:52:31 +0200 Message-Id: <1342111951-27930-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH] ide scsi: Mess with geometry only for hard disk devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com Legacy -drive cyls=... are now ignored completely when the drive doesn't back a hard disk device. Before, they were first checked against a hard disk's limits, then ignored. Signed-off-by: Markus Armbruster --- hw/ide/qdev.c | 3 ++- hw/scsi-disk.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 22e58df..5ea9b8f 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -149,7 +149,8 @@ static int ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind) } blkconf_serial(&dev->conf, &dev->serial); - if (blkconf_geometry(&dev->conf, &dev->chs_trans, 65536, 16, 255) < 0) { + if (kind != IDE_CD + && blkconf_geometry(&dev->conf, &dev->chs_trans, 65536, 16, 255) < 0) { return -1; } diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 525816c..318318c 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -1750,7 +1750,8 @@ static int scsi_initfn(SCSIDevice *dev) } blkconf_serial(&s->qdev.conf, &s->serial); - if (blkconf_geometry(&dev->conf, NULL, 65535, 255, 255) < 0) { + if (dev->type == TYPE_DISK + && blkconf_geometry(&dev->conf, NULL, 65535, 255, 255) < 0) { return -1; } -- 1.7.6.5