From patchwork Thu Jul 12 16:52:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 170728 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8AEE02C02BE for ; Fri, 13 Jul 2012 02:52:47 +1000 (EST) Received: from localhost ([::1]:57990 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpMdB-0004mJ-N7 for incoming@patchwork.ozlabs.org; Thu, 12 Jul 2012 12:52:45 -0400 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) Received: by blackfin.pond.sub.org (Postfix, from userid 500) id 1DF356009D; Thu, 12 Jul 2012 18:52:32 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 12 Jul 2012 18:52:31 +0200 Message-Id: <1342111951-27930-1-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.7.6.5 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 78.46.104.156 Cc: kwolf@redhat.com Subject: [Qemu-devel] [PATCH] ide scsi: Mess with geometry only for hard disk devices X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Acked-by: Paolo Bonzini --- 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; }