From nobody Sat Feb 7 07:12:15 2026 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.zoho.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: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487161476593454.68212242700633; Wed, 15 Feb 2017 04:24:36 -0800 (PST) Received: from localhost ([::1]:40111 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdydP-0003o9-7h for importer@patchew.org; Wed, 15 Feb 2017 07:24:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cdyY5-0008UF-Ol for qemu-devel@nongnu.org; Wed, 15 Feb 2017 07:19:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cdyY4-0000ZZ-KK for qemu-devel@nongnu.org; Wed, 15 Feb 2017 07:19:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34198) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cdyXz-0000Ul-W6; Wed, 15 Feb 2017 07:19:00 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ADD01C0567B3; Wed, 15 Feb 2017 12:18:59 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1FCIv8T010230 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 15 Feb 2017 07:18:59 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 6784C11384AF; Wed, 15 Feb 2017 13:18:56 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Wed, 15 Feb 2017 13:18:56 +0100 Message-Id: <1487161136-9018-4-git-send-email-armbru@redhat.com> In-Reply-To: <1487161136-9018-1-git-send-email-armbru@redhat.com> References: <1487161136-9018-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 15 Feb 2017 12:18:59 +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] [PATCH v2 3/3] hw/i386: Deprecate -drive if=scsi with PC machine types X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, pbonzini@redhat.com, mreitz@redhat.com, qemu-block@nongnu.org, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The PC machines (pc-q35-* pc-i440fx-* pc-* isapc xenfv) automatically create lsi53c895a SCSI HBAs and SCSI devices to honor -drive if=3Dscsi. For giggles, try -drive if=3Dscsi,bus=3D25,media=3Dcdrom --- this makes QEMU create 25 of them. lsi53c895a is thoroughly obsolete (PCI Ultra2 SCSI, ca. 2000), and currently has no maintainer in QEMU. megasas is a better choice, except with old OSes that lack drivers. virtio-scsi is a much better choice when you have a driver, but only (newish) Linux comes with one in the box. There is no good default that works for all guests. Encourage users to pick a non-obsolete SCSI HBA that works for them by deprecating -drive if=3Dscsi. Signed-off-by: Markus Armbruster --- hw/i386/pc.c | 8 +++++++- qemu-options.hx | 5 ----- tests/qemu-iotests/051.pc.out | 12 ++++++++---- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index c2c75e2..60b0946 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1650,9 +1650,15 @@ void pc_pci_device_init(PCIBus *pci_bus) int max_bus; int bus; =20 + /* Note: if=3Dscsi is deprecated with PC machine types */ max_bus =3D drive_get_max_bus(IF_SCSI); for (bus =3D 0; bus <=3D max_bus; bus++) { - lsi53c895a_create(pci_bus); + pci_create_simple(pci_bus, -1, "lsi53c895a"); + /* + * By not creating frontends here, we make + * scsi_legacy_handle_cmdline() create them, and warn that + * this usage is deprecated. + */ } } =20 diff --git a/qemu-options.hx b/qemu-options.hx index ac036b4..f41cc18 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -654,11 +654,6 @@ If you don't specify the "file=3D" argument, you defin= e an empty drive: qemu-system-i386 -drive if=3Dide,index=3D1,media=3Dcdrom @end example =20 -You can connect a SCSI disk with unit ID 6 on the bus #0: -@example -qemu-system-i386 -drive file=3Dfile,if=3Dscsi,bus=3D0,unit=3D6 -@end example - Instead of @option{-fda}, @option{-fdb}, you can use: @example qemu-system-i386 -drive file=3Dfile,index=3D0,if=3Dfloppy diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out index 603bb76..f8047a2 100644 --- a/tests/qemu-iotests/051.pc.out +++ b/tests/qemu-iotests/051.pc.out @@ -118,7 +118,8 @@ QEMU X.Y.Z monitor - type 'help' for more information =20 Testing: -drive if=3Dscsi,media=3Dcdrom QEMU X.Y.Z monitor - type 'help' for more information -(qemu) q=1B[K=1B[Dqu=1B[K=1B[D=1B[Dqui=1B[K=1B[D=1B[D=1B[Dquit=1B[K +(qemu) QEMU_PROG: -drive if=3Dscsi,media=3Dcdrom: warning: bus=3D0,unit=3D= 0 is deprecated with this machine type +q=1B[K=1B[Dqu=1B[K=1B[D=1B[Dqui=1B[K=1B[D=1B[D=1B[Dquit=1B[K =20 Testing: -drive if=3Dide QEMU X.Y.Z monitor - type 'help' for more information @@ -127,7 +128,8 @@ QEMU_PROG: Initialization of device ide-hd failed: Devi= ce initialization failed. =20 Testing: -drive if=3Dscsi QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: Initialization of device lsi53c895a failed: Device needs= media, but drive is empty +(qemu) QEMU_PROG: -drive if=3Dscsi: warning: bus=3D0,unit=3D0 is deprecate= d with this machine type +QEMU_PROG: -drive if=3Dscsi: Device needs media, but drive is empty =20 Testing: -drive if=3Dvirtio QEMU X.Y.Z monitor - type 'help' for more information @@ -172,7 +174,8 @@ QEMU X.Y.Z monitor - type 'help' for more information =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dscsi,media=3Dcdrom,readonly= =3Don QEMU X.Y.Z monitor - type 'help' for more information -(qemu) q=1B[K=1B[Dqu=1B[K=1B[D=1B[Dqui=1B[K=1B[D=1B[D=1B[Dquit=1B[K +(qemu) QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,if=3Dscsi,media=3Dcdrom,r= eadonly=3Don: warning: bus=3D0,unit=3D0 is deprecated with this machine type +q=1B[K=1B[Dqu=1B[K=1B[D=1B[Dqui=1B[K=1B[D=1B[D=1B[Dquit=1B[K =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dide,readonly=3Don QEMU X.Y.Z monitor - type 'help' for more information @@ -181,7 +184,8 @@ QEMU_PROG: Initialization of device ide-hd failed: Devi= ce initialization failed. =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dscsi,readonly=3Don QEMU X.Y.Z monitor - type 'help' for more information -(qemu) q=1B[K=1B[Dqu=1B[K=1B[D=1B[Dqui=1B[K=1B[D=1B[D=1B[Dquit=1B[K +(qemu) QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,if=3Dscsi,readonly=3Don: = warning: bus=3D0,unit=3D0 is deprecated with this machine type +q=1B[K=1B[Dqu=1B[K=1B[D=1B[Dqui=1B[K=1B[D=1B[D=1B[Dquit=1B[K =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dvirtio,readonly=3Don QEMU X.Y.Z monitor - type 'help' for more information --=20 2.7.4