From patchwork Tue Jul 10 09:12:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 170093 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 2E8142C00E7 for ; Tue, 10 Jul 2012 19:20:25 +1000 (EST) Received: from localhost ([::1]:41300 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoWcI-00013z-Tz for incoming@patchwork.ozlabs.org; Tue, 10 Jul 2012 05:20:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoWbu-0000jl-M3 for qemu-devel@nongnu.org; Tue, 10 Jul 2012 05:20:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SoWbk-0004Jf-8k for qemu-devel@nongnu.org; Tue, 10 Jul 2012 05:19:58 -0400 Received: from oxygen.pond.sub.org ([78.46.104.156]:58054) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoWbk-0004JE-2B for qemu-devel@nongnu.org; Tue, 10 Jul 2012 05:19:48 -0400 Received: from blackfin.pond.sub.org (p57B0F62B.dip.t-dialin.net [87.176.246.43]) by oxygen.pond.sub.org (Postfix) with ESMTPA id B72899FE43; Tue, 10 Jul 2012 11:19:46 +0200 (CEST) Received: by blackfin.pond.sub.org (Postfix, from userid 500) id C593B600B8; Tue, 10 Jul 2012 11:12:57 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 10 Jul 2012 11:12:54 +0200 Message-Id: <1341911575-7306-29-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.7.6.5 In-Reply-To: <1341911575-7306-1-git-send-email-armbru@redhat.com> References: <1341911575-7306-1-git-send-email-armbru@redhat.com> 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, blauwirbel@gmail.com, stefanha@linux.vnet.ibm.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH v3 28/29] blockdev: Drop redundant CHS validation for if=ide 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 Leave it to ide_init_drive(). Signed-off-by: Markus Armbruster --- blockdev.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blockdev.c b/blockdev.c index 06c997e..5f8677e 100644 --- a/blockdev.c +++ b/blockdev.c @@ -330,15 +330,15 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi) max_devs = if_max_devs[type]; if (cyls || heads || secs) { - if (cyls < 1 || (type == IF_IDE && cyls > 16383)) { + if (cyls < 1) { error_report("invalid physical cyls number"); return NULL; } - if (heads < 1 || (type == IF_IDE && heads > 16)) { + if (heads < 1) { error_report("invalid physical heads number"); return NULL; } - if (secs < 1 || (type == IF_IDE && secs > 63)) { + if (secs < 1) { error_report("invalid physical secs number"); return NULL; }