From nobody Sun May  4 16:48:14 2025
Delivered-To: importer@patchew.org
Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as
 permitted sender) client-ip=208.118.235.17;
 envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org;
 helo=lists.gnu.org;
Authentication-Results: mx.zohomail.com;
	spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted
 sender)  smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by
 mx.zohomail.com
	with SMTPS id 1513956815821144.49546669589324;
 Fri, 22 Dec 2017 07:33:35 -0800 (PST)
Received: from localhost ([::1]:54472 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>)
	id 1eSPK4-0000Sc-HD
	for importer@patchew.org; Fri, 22 Dec 2017 10:33:20 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:57217)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kwolf@redhat.com>) id 1eSP6b-0005jI-PS
	for qemu-devel@nongnu.org; Fri, 22 Dec 2017 10:19:29 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kwolf@redhat.com>) id 1eSP6Y-0002NH-FI
	for qemu-devel@nongnu.org; Fri, 22 Dec 2017 10:19:25 -0500
Received: from mx1.redhat.com ([209.132.183.28]:45558)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <kwolf@redhat.com>)
	id 1eSP6U-0002It-Vn; Fri, 22 Dec 2017 10:19:19 -0500
Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com
	[10.5.11.12])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id 2E5FE80469;
	Fri, 22 Dec 2017 15:19:18 +0000 (UTC)
Received: from localhost.localdomain.com (ovpn-117-107.ams2.redhat.com
	[10.36.117.107])
	by smtp.corp.redhat.com (Postfix) with ESMTP id 10EC651DF2;
	Fri, 22 Dec 2017 15:19:16 +0000 (UTC)
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Date: Fri, 22 Dec 2017 16:18:26 +0100
Message-Id: <20171222151846.28110-16-kwolf@redhat.com>
In-Reply-To: <20171222151846.28110-1-kwolf@redhat.com>
References: <20171222151846.28110-1-kwolf@redhat.com>
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.28]);
	Fri, 22 Dec 2017 15:19:18 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 209.132.183.28
Subject: [Qemu-devel] [PULL v3 15/35] block: Remove the deprecated -hdachs
 option
X-BeenThere: qemu-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
	<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
	<mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org>
X-ZohoMail: RSF_0  Z_629925259 SPT_0
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"

From: Thomas Huth <thuth@redhat.com>

It's been marked as deprecated since QEMU v2.10.0, and so far nobody
complained that we should keep it, so let's remove this legacy option
now to simplify the code quite a bit.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 vl.c            | 86 ++---------------------------------------------------=
----
 qemu-doc.texi   |  8 ------
 qemu-options.hx | 19 ++-----------
 3 files changed, 4 insertions(+), 109 deletions(-)

diff --git a/vl.c b/vl.c
index d3a5c5d021..444b7507da 100644
--- a/vl.c
+++ b/vl.c
@@ -3052,9 +3052,8 @@ int main(int argc, char **argv, char **envp)
     const char *boot_order =3D NULL;
     const char *boot_once =3D NULL;
     DisplayState *ds;
-    int cyls, heads, secs, translation;
     QemuOpts *opts, *machine_opts;
-    QemuOpts *hda_opts =3D NULL, *icount_opts =3D NULL, *accel_opts =3D NU=
LL;
+    QemuOpts *icount_opts =3D NULL, *accel_opts =3D NULL;
     QemuOptsList *olist;
     int optind;
     const char *optarg;
@@ -3146,8 +3145,6 @@ int main(int argc, char **argv, char **envp)
=20
     cpu_model =3D NULL;
     snapshot =3D 0;
-    cyls =3D heads =3D secs =3D 0;
-    translation =3D BIOS_ATA_TRANSLATION_AUTO;
=20
     nb_nics =3D 0;
=20
@@ -3186,7 +3183,7 @@ int main(int argc, char **argv, char **envp)
         if (optind >=3D argc)
             break;
         if (argv[optind][0] !=3D '-') {
-            hda_opts =3D drive_add(IF_DEFAULT, 0, argv[optind++], HD_OPTS);
+            drive_add(IF_DEFAULT, 0, argv[optind++], HD_OPTS);
         } else {
             const QEMUOption *popt;
=20
@@ -3206,21 +3203,6 @@ int main(int argc, char **argv, char **envp)
                 cpu_model =3D optarg;
                 break;
             case QEMU_OPTION_hda:
-                {
-                    char buf[256];
-                    if (cyls =3D=3D 0)
-                        snprintf(buf, sizeof(buf), "%s", HD_OPTS);
-                    else
-                        snprintf(buf, sizeof(buf),
-                                 "%s,cyls=3D%d,heads=3D%d,secs=3D%d%s",
-                                 HD_OPTS , cyls, heads, secs,
-                                 translation =3D=3D BIOS_ATA_TRANSLATION_L=
BA ?
-                                 ",trans=3Dlba" :
-                                 translation =3D=3D BIOS_ATA_TRANSLATION_N=
ONE ?
-                                 ",trans=3Dnone" : "");
-                    drive_add(IF_DEFAULT, 0, optarg, buf);
-                    break;
-                }
             case QEMU_OPTION_hdb:
             case QEMU_OPTION_hdc:
             case QEMU_OPTION_hdd:
@@ -3271,70 +3253,6 @@ int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_snapshot:
                 snapshot =3D 1;
                 break;
-            case QEMU_OPTION_hdachs:
-                {
-                    const char *p;
-                    p =3D optarg;
-                    cyls =3D strtol(p, (char **)&p, 0);
-                    if (cyls < 1 || cyls > 16383)
-                        goto chs_fail;
-                    if (*p !=3D ',')
-                        goto chs_fail;
-                    p++;
-                    heads =3D strtol(p, (char **)&p, 0);
-                    if (heads < 1 || heads > 16)
-                        goto chs_fail;
-                    if (*p !=3D ',')
-                        goto chs_fail;
-                    p++;
-                    secs =3D strtol(p, (char **)&p, 0);
-                    if (secs < 1 || secs > 63)
-                        goto chs_fail;
-                    if (*p =3D=3D ',') {
-                        p++;
-                        if (!strcmp(p, "large")) {
-                            translation =3D BIOS_ATA_TRANSLATION_LARGE;
-                        } else if (!strcmp(p, "rechs")) {
-                            translation =3D BIOS_ATA_TRANSLATION_RECHS;
-                        } else if (!strcmp(p, "none")) {
-                            translation =3D BIOS_ATA_TRANSLATION_NONE;
-                        } else if (!strcmp(p, "lba")) {
-                            translation =3D BIOS_ATA_TRANSLATION_LBA;
-                        } else if (!strcmp(p, "auto")) {
-                            translation =3D BIOS_ATA_TRANSLATION_AUTO;
-                        } else {
-                            goto chs_fail;
-                        }
-                    } else if (*p !=3D '\0') {
-                    chs_fail:
-                        error_report("invalid physical CHS format");
-                        exit(1);
-                    }
-                    if (hda_opts !=3D NULL) {
-                        qemu_opt_set_number(hda_opts, "cyls", cyls,
-                                            &error_abort);
-                        qemu_opt_set_number(hda_opts, "heads", heads,
-                                            &error_abort);
-                        qemu_opt_set_number(hda_opts, "secs", secs,
-                                            &error_abort);
-                        if (translation =3D=3D BIOS_ATA_TRANSLATION_LARGE)=
 {
-                            qemu_opt_set(hda_opts, "trans", "large",
-                                         &error_abort);
-                        } else if (translation =3D=3D BIOS_ATA_TRANSLATION=
_RECHS) {
-                            qemu_opt_set(hda_opts, "trans", "rechs",
-                                         &error_abort);
-                        } else if (translation =3D=3D BIOS_ATA_TRANSLATION=
_LBA) {
-                            qemu_opt_set(hda_opts, "trans", "lba",
-                                         &error_abort);
-                        } else if (translation =3D=3D BIOS_ATA_TRANSLATION=
_NONE) {
-                            qemu_opt_set(hda_opts, "trans", "none",
-                                         &error_abort);
-                        }
-                    }
-                }
-                error_report("'-hdachs' is deprecated, please use '-device"
-                             " ide-hd,cyls=3Dc,heads=3Dh,secs=3Ds,...' ins=
tead");
-                break;
             case QEMU_OPTION_numa:
                 opts =3D qemu_opts_parse_noisily(qemu_find_opts("numa"),
                                                optarg, true);
diff --git a/qemu-doc.texi b/qemu-doc.texi
index ed55bd477d..96fda9c56e 100644
--- a/qemu-doc.texi
+++ b/qemu-doc.texi
@@ -2686,14 +2686,6 @@ The ``--net dump'' argument is now replaced with the
 ``-object filter-dump'' argument which works in combination
 with the modern ``-netdev`` backends instead.
=20
-@subsection -hdachs (since 2.10.0)
-
-The ``-hdachs'' argument is now a synonym for setting
-the ``cyls'', ``heads'', ``secs'', and ``trans'' properties
-on the ``ide-hd'' device using the ``-device'' argument.
-The new syntax allows different settings to be provided
-per disk.
-
 @subsection -usbdevice (since 2.10.0)
=20
 The ``-usbdevice DEV'' argument is now a synonym for setting
diff --git a/qemu-options.hx b/qemu-options.hx
index 94647e21e3..2d39ba0b6d 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -846,8 +846,8 @@ of available connectors of a given interface type.
 @item media=3D@var{media}
 This option defines the type of the media: disk or cdrom.
 @item cyls=3D@var{c},heads=3D@var{h},secs=3D@var{s}[,trans=3D@var{t}]
-These options have the same definition as they have in @option{-hdachs}.
-These parameters are deprecated, use the corresponding parameters
+Force disk physical geometry and the optional BIOS translation (trans=3Dno=
ne or
+lba). These parameters are deprecated, use the corresponding parameters
 of @code{-device} instead.
 @item snapshot=3D@var{snapshot}
 @var{snapshot} is "on" or "off" and controls snapshot mode for the given d=
rive
@@ -1027,21 +1027,6 @@ the raw disk image you use is not written back. You =
can however force
 the write back by pressing @key{C-a s} (@pxref{disk_images}).
 ETEXI
=20
-DEF("hdachs", HAS_ARG, QEMU_OPTION_hdachs, \
-    "-hdachs c,h,s[,t]\n" \
-    "                force hard disk 0 physical geometry and the optional =
BIOS\n" \
-    "                translation (t=3Dnone or lba) (usually QEMU can guess=
 them)\n",
-    QEMU_ARCH_ALL)
-STEXI
-@item -hdachs @var{c},@var{h},@var{s},[,@var{t}]
-@findex -hdachs
-Force hard disk 0 physical geometry (1 <=3D @var{c} <=3D 16383, 1 <=3D
-@var{h} <=3D 16, 1 <=3D @var{s} <=3D 63) and optionally force the BIOS
-translation mode (@var{t}=3Dnone, lba or auto). Usually QEMU can guess
-all those parameters. This option is deprecated, please use
-@code{-device ide-hd,cyls=3Dc,heads=3Dh,secs=3Ds,...} instead.
-ETEXI
-
 DEF("fsdev", HAS_ARG, QEMU_OPTION_fsdev,
     "-fsdev fsdriver,id=3Did[,path=3Dpath,][security_model=3D{mapped-xattr=
|mapped-file|passthrough|none}]\n"
     " [,writeout=3Dimmediate][,readonly][,socket=3Dsocket|sock_fd=3Dsock_f=
d][,fmode=3Dfmode][,dmode=3Ddmode]\n"
--=20
2.13.6