From patchwork Mon Jan 18 10:19:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shmulik Ladkani X-Patchwork-Id: 8054121 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0AFBD9F6FA for ; Mon, 18 Jan 2016 10:19:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 569872025A for ; Mon, 18 Jan 2016 10:19:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5B8C120259 for ; Mon, 18 Jan 2016 10:19:57 +0000 (UTC) Received: from localhost ([::1]:58639 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aL6ui-0002kk-FG for patchwork-qemu-devel@patchwork.kernel.org; Mon, 18 Jan 2016 05:19:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56924) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aL6uZ-0002kS-US for qemu-devel@nongnu.org; Mon, 18 Jan 2016 05:19:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aL6uV-0000ro-E4 for qemu-devel@nongnu.org; Mon, 18 Jan 2016 05:19:47 -0500 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:33696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aL6uV-0000rg-6A for qemu-devel@nongnu.org; Mon, 18 Jan 2016 05:19:43 -0500 Received: by mail-wm0-x230.google.com with SMTP id 123so45868431wmz.0 for ; Mon, 18 Jan 2016 02:19:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ravellosystems-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=+8BMwawUe100PxL0bpPZh3qFO5sZ1e9si+LMWxOTEHM=; b=QYOxk/iegxolKriYLrc49wmiYS+SZXabqX03G27/LTs3bJ2/L2Z84n2Q42Wq82BGDG eQM4V9TTwEPvfmD63SHYCU6nGTtw2efDPCX3740I7NL57VUSw1KPnp9kGA3WhFfQ0kxG E0kj8qvXYSS22TFCccaNmRRRT91+Sk33kfRYO+tgW6Vl2ZWWu+DXv1lJ+KpMO6QxNNFu 3p7sBRGZqLeMICjEJk0QfZDqDNyUZ+Y5Q5EWyx5wHtR2J8dOfoaXo1aZBXQ1KYo/EtT6 rnXhjkkRrRIsrjMvvcGWP6xlq0fz+/SItkZgLEYfX2Ya0v1Zyb4dlRTYxM6Gjuxpj9IY x0TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+8BMwawUe100PxL0bpPZh3qFO5sZ1e9si+LMWxOTEHM=; b=AGZSLygBQy86E2Z1foBKA24EVWLCsjonJhDx835OITLgHFsInAfuzBfca/xuW7OWXR SVYIkNH/nnK4NddUj8+Iosmi5PIumN26XlQA9upVZGJ5fz68HYboYdqmouGTV9Spb6el Gg8NZZwhwXDGwx5EZB9HZYz0cGHEvQlDXncZFRvV9dPIIH15OcbledIwHBwPQSWlb85i a0R0DuQ1iI7bfBJB5wcdtG5vcdU2+OwO4hxAeedGGwQlSXqlesZd2Q7Ia8cxEnr2nn6L Znq2ObYtEPW+KmpwczxhPKJzV5OEJFnGN7pSYCeVq8P6S7nBr//l18JTcjudTDSV3ARS a9+g== X-Gm-Message-State: AG10YOQjC0iWk6yxIPCaPdK+tlr2c2YMsfnedhwLOnGCMJya0XUnGUNFKrTW+YhivQppKIZ1 X-Received: by 10.194.6.165 with SMTP id c5mr12450403wja.88.1453112382297; Mon, 18 Jan 2016 02:19:42 -0800 (PST) Received: from honey.ravello.local ([213.57.127.2]) by smtp.gmail.com with ESMTPSA id g3sm23118255wjw.31.2016.01.18.02.19.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jan 2016 02:19:41 -0800 (PST) From: Shmulik Ladkani To: John Snow Date: Mon, 18 Jan 2016 12:19:31 +0200 Message-Id: <1453112371-29760-1-git-send-email-shmulik.ladkani@ravellosystems.com> X-Mailer: git-send-email 1.9.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::230 Cc: Kevin Wolf , Shmulik Ladkani , Markus Armbruster , qemu-block@nongnu.org, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] ide: Correct the CHS 'cyls_max' limit to be 65535 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In b7eb0c9: hw/block-common: Factor out fall back to legacy -drive cyls=... 'blkconf_geometry()' was introduced, factoring out CHS limit validation code that was repeated in ide, scsi, virtio-blk. The original IDE CHS limit prior b7eb0c9 was 65535,16,255 (as per ATA CHS addressing). However the 'cyls_max' argument passed to 'blkconf_geometry' in the ide_dev_initfn case was accidentally set to 65536 instead of 65535. Fix, providing the correct 'cyls_max'. Signed-off-by: Shmulik Ladkani Reviewed-by: John Snow --- hw/ide/qdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c index 1f83109..fea5425 100644 --- a/hw/ide/qdev.c +++ b/hw/ide/qdev.c @@ -172,7 +172,7 @@ static int ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind) blkconf_serial(&dev->conf, &dev->serial); if (kind != IDE_CD) { - blkconf_geometry(&dev->conf, &dev->chs_trans, 65536, 16, 255, &err); + blkconf_geometry(&dev->conf, &dev->chs_trans, 65535, 16, 255, &err); if (err) { error_report_err(err); return -1;