From nobody Sun May 19 16:58:50 2024 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 1487682934818257.99517759283015; Tue, 21 Feb 2017 05:15:34 -0800 (PST) Received: from localhost ([::1]:44478 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgAHz-0003AB-CB for importer@patchew.org; Tue, 21 Feb 2017 08:15:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg9eX-0007dG-Km for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg9eU-00082g-LC for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47866) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg9eU-00082F-Dm for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:42 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 92E8C80F93 for ; Tue, 21 Feb 2017 12:34:42 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LCYfrU011810 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 21 Feb 2017 07:34:42 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CDC8E113864A; Tue, 21 Feb 2017 13:34:39 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 13:34:29 +0100 Message-Id: <1487680479-15132-2-git-send-email-armbru@redhat.com> In-Reply-To: <1487680479-15132-1-git-send-email-armbru@redhat.com> References: <1487680479-15132-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 21 Feb 2017 12:34:42 +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 01/11] hw: Default -drive to if=ide explicitly where it works 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: , 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" Block backends defined with -drive if=3Dide are meant to be picked up by machine initialization code: a suitable frontend gets created and wired up automatically. if=3Dide drives not picked up that way can still be used with -device as if they had if=3Dnone, but that's unclean and best avoided. Unused ones produce an "Orphaned drive without device" warning. -drive parameter "if" is optional, and the default depends on the machine type. If a machine type doesn't specify a default, the default is "ide". Many machine types default to if=3Dide, even though they don't actually have an IDE controller. A future patch will change these defaults to something more sensible. To prepare for it, this patch makes default "ide" explicit for the machines that actually pick up if=3Dide drives: * alpha: clipper * arm/aarch64: spitz borzoi terrier tosa * i386/x86_64: generic-pc-machine (with concrete subtypes pc-q35-* pc-i440fx-* pc-* isapc xenfv) * mips64el: fulong2e * mips/mipsel/mips64el: malta mips * ppc/ppc64: mac99 g3beige prep * sh4/sh4eb: r2d * sparc64: sun4u sun4v Note that ppc64 machine powernv already sets an "ide" default explicitly. Its IDE controller isn't implemented, yet. Signed-off-by: Markus Armbruster Reviewed-by: Thomas Huth Message-Id: <1487153147-11530-2-git-send-email-armbru@redhat.com> --- hw/alpha/dp264.c | 1 + hw/arm/spitz.c | 3 +++ hw/arm/tosa.c | 1 + hw/i386/pc.c | 1 + hw/mips/mips_fulong2e.c | 1 + hw/mips/mips_malta.c | 1 + hw/mips/mips_r4k.c | 1 + hw/ppc/mac_newworld.c | 1 + hw/ppc/mac_oldworld.c | 1 + hw/ppc/prep.c | 1 + hw/sh4/r2d.c | 1 + hw/sparc64/sun4u.c | 2 ++ 12 files changed, 15 insertions(+) diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index d6431fd..85405da 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -177,6 +177,7 @@ static void clipper_machine_init(MachineClass *mc) { mc->desc =3D "Alpha DP264/CLIPPER"; mc->init =3D clipper_init; + mc->block_default_type =3D IF_IDE; mc->max_cpus =3D 4; mc->is_default =3D 1; } diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c index 949a15a..fe2d5a7 100644 --- a/hw/arm/spitz.c +++ b/hw/arm/spitz.c @@ -998,6 +998,7 @@ static void spitzpda_class_init(ObjectClass *oc, void *= data) =20 mc->desc =3D "Sharp SL-C3000 (Spitz) PDA (PXA270)"; mc->init =3D spitz_init; + mc->block_default_type =3D IF_IDE; } =20 static const TypeInfo spitzpda_type =3D { @@ -1012,6 +1013,7 @@ static void borzoipda_class_init(ObjectClass *oc, voi= d *data) =20 mc->desc =3D "Sharp SL-C3100 (Borzoi) PDA (PXA270)"; mc->init =3D borzoi_init; + mc->block_default_type =3D IF_IDE; } =20 static const TypeInfo borzoipda_type =3D { @@ -1026,6 +1028,7 @@ static void terrierpda_class_init(ObjectClass *oc, vo= id *data) =20 mc->desc =3D "Sharp SL-C3200 (Terrier) PDA (PXA270)"; mc->init =3D terrier_init; + mc->block_default_type =3D IF_IDE; } =20 static const TypeInfo terrierpda_type =3D { diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c index c3db996..9f58a23 100644 --- a/hw/arm/tosa.c +++ b/hw/arm/tosa.c @@ -263,6 +263,7 @@ static void tosapda_machine_init(MachineClass *mc) { mc->desc =3D "Sharp SL-6000 (Tosa) PDA (PXA255)"; mc->init =3D tosa_init; + mc->block_default_type =3D IF_IDE; } =20 DEFINE_MACHINE("tosa", tosapda_machine_init) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index e3fcd51..a555c35 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -2339,6 +2339,7 @@ static void pc_machine_class_init(ObjectClass *oc, vo= id *data) mc->query_hotpluggable_cpus =3D pc_query_hotpluggable_cpus; mc->default_boot_order =3D "cad"; mc->hot_add_cpu =3D pc_hot_add_cpu; + mc->block_default_type =3D IF_IDE; mc->max_cpus =3D 255; mc->reset =3D pc_machine_reset; hc->pre_plug =3D pc_machine_device_pre_plug_cb; diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 9a4dae4..e636c3a 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -387,6 +387,7 @@ static void mips_fulong2e_machine_init(MachineClass *mc) { mc->desc =3D "Fulong 2e mini pc"; mc->init =3D mips_fulong2e_init; + mc->block_default_type =3D IF_IDE; } =20 DEFINE_MACHINE("fulong2e", mips_fulong2e_machine_init) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 75877de..5dd177e 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -1264,6 +1264,7 @@ static void mips_malta_machine_init(MachineClass *mc) { mc->desc =3D "MIPS Malta Core LV"; mc->init =3D mips_malta_init; + mc->block_default_type =3D IF_IDE; mc->max_cpus =3D 16; mc->is_default =3D 1; } diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index 27548c4..748586e 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -306,6 +306,7 @@ static void mips_machine_init(MachineClass *mc) { mc->desc =3D "mips r4k platform"; mc->init =3D mips_r4k_init; + mc->block_default_type =3D IF_IDE; } =20 DEFINE_MACHINE("mips", mips_machine_init) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 2bfdb64..716aea6 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -518,6 +518,7 @@ static void core99_machine_class_init(ObjectClass *oc, = void *data) =20 mc->desc =3D "Mac99 based PowerMAC"; mc->init =3D ppc_core99_init; + mc->block_default_type =3D IF_IDE; mc->max_cpus =3D MAX_CPUS; mc->default_boot_order =3D "cd"; mc->kvm_type =3D core99_kvm_type; diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 56282c5..5df94e2 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -368,6 +368,7 @@ static void heathrow_machine_init(MachineClass *mc) { mc->desc =3D "Heathrow based PowerMAC"; mc->init =3D ppc_heathrow_init; + mc->block_default_type =3D IF_IDE; mc->max_cpus =3D MAX_CPUS; #ifndef TARGET_PPC64 mc->is_default =3D 1; diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index ca7959c..961230c 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -684,6 +684,7 @@ static void prep_machine_init(MachineClass *mc) { mc->desc =3D "PowerPC PREP platform"; mc->init =3D ppc_prep_init; + mc->block_default_type =3D IF_IDE; mc->max_cpus =3D MAX_CPUS; mc->default_boot_order =3D "cad"; } diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index db373c7..6d06968 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -362,6 +362,7 @@ static void r2d_machine_init(MachineClass *mc) { mc->desc =3D "r2d-plus board"; mc->init =3D r2d_init; + mc->block_default_type =3D IF_IDE; } =20 DEFINE_MACHINE("r2d", r2d_machine_init) diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index d1a6bca..d347b66 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -579,6 +579,7 @@ static void sun4u_class_init(ObjectClass *oc, void *dat= a) =20 mc->desc =3D "Sun4u platform"; mc->init =3D sun4u_init; + mc->block_default_type =3D IF_IDE; mc->max_cpus =3D 1; /* XXX for now */ mc->is_default =3D 1; mc->default_boot_order =3D "c"; @@ -596,6 +597,7 @@ static void sun4v_class_init(ObjectClass *oc, void *dat= a) =20 mc->desc =3D "Sun4v platform"; mc->init =3D sun4v_init; + mc->block_default_type =3D IF_IDE; mc->max_cpus =3D 1; /* XXX for now */ mc->default_boot_order =3D "c"; } --=20 2.7.4 From nobody Sun May 19 16:58:50 2024 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 1487681764293278.83016344892326; Tue, 21 Feb 2017 04:56:04 -0800 (PST) Received: from localhost ([::1]:44290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg9z8-0001GE-1W for importer@patchew.org; Tue, 21 Feb 2017 07:56:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg9ea-0007gC-Qy for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg9eZ-00085I-Cl for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39024) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg9eU-00082D-De; Tue, 21 Feb 2017 07:34:42 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 669AE13A5E; Tue, 21 Feb 2017 12:34:42 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LCYfhj011812 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Feb 2017 07:34:42 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D1041113864D; Tue, 21 Feb 2017 13:34:39 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 13:34:30 +0100 Message-Id: <1487680479-15132-3-git-send-email-armbru@redhat.com> In-Reply-To: <1487680479-15132-1-git-send-email-armbru@redhat.com> References: <1487680479-15132-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 21 Feb 2017 12:34:42 +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 02/11] hw/arm/cubieboard hw/arm/xlnx-ep108: Fix units_per_default_bus 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: Beniamino Galvani , "Edgar E. Iglesias" , qemu-arm@nongnu.org, Peter Maydell , Alistair Francis 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" Machine types cubieboard, xlnx-ep108, xlnx-zcu102 have an onboard AHCI controller, but neglect to set their MachineClass member units_per_default_bus =3D 1. This permits -drive if=3Dide,unit=3D1, which makes no sense for AHCI. It also screws up index=3DN for odd N, because it gets desugared to unit=3D1,bus=3DN/2 Doesn't really matter, because these machine types fail to honor -drive if=3Dide. Add the missing units_per_default_bus =3D 1 anyway, along with a TODO comment on what needs to be done for -drive if=3Dide. Also set block_default_type =3D IF_IDE explicitly. It's currently the default, but the next commit will change it to something more sensible, and we want to keep the IF_IDE default for these three machines. See also the previous commit. Cc: Beniamino Galvani Cc: Alistair Francis Cc: "Edgar E. Iglesias" Cc: Peter Maydell Cc: qemu-arm@nongnu.org Signed-off-by: Markus Armbruster Acked-by: Alistair Francis Message-Id: <1487153147-11530-3-git-send-email-armbru@redhat.com> --- hw/arm/cubieboard.c | 4 ++++ hw/arm/xlnx-ep108.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/hw/arm/cubieboard.c b/hw/arm/cubieboard.c index dd19ba3..b98e1c4 100644 --- a/hw/arm/cubieboard.c +++ b/hw/arm/cubieboard.c @@ -71,6 +71,8 @@ static void cubieboard_init(MachineState *machine) memory_region_add_subregion(get_system_memory(), AW_A10_SDRAM_BASE, &s->sdram); =20 + /* TODO create and connect IDE devices for ide_drive_get() */ + cubieboard_binfo.ram_size =3D machine->ram_size; cubieboard_binfo.kernel_filename =3D machine->kernel_filename; cubieboard_binfo.kernel_cmdline =3D machine->kernel_cmdline; @@ -82,6 +84,8 @@ static void cubieboard_machine_init(MachineClass *mc) { mc->desc =3D "cubietech cubieboard"; mc->init =3D cubieboard_init; + mc->block_default_type =3D IF_IDE; + mc->units_per_default_bus =3D 1; } =20 DEFINE_MACHINE("cubieboard", cubieboard_machine_init) diff --git a/hw/arm/xlnx-ep108.c b/hw/arm/xlnx-ep108.c index 4ec590a..860780a 100644 --- a/hw/arm/xlnx-ep108.c +++ b/hw/arm/xlnx-ep108.c @@ -106,6 +106,8 @@ static void xlnx_ep108_init(MachineState *machine) sysbus_connect_irq(SYS_BUS_DEVICE(&s->soc.spi[i]), 1, cs_line); } =20 + /* TODO create and connect IDE devices for ide_drive_get() */ + xlnx_ep108_binfo.ram_size =3D ram_size; xlnx_ep108_binfo.kernel_filename =3D machine->kernel_filename; xlnx_ep108_binfo.kernel_cmdline =3D machine->kernel_cmdline; @@ -118,6 +120,8 @@ static void xlnx_ep108_machine_init(MachineClass *mc) { mc->desc =3D "Xilinx ZynqMP EP108 board"; mc->init =3D xlnx_ep108_init; + mc->block_default_type =3D IF_IDE; + mc->units_per_default_bus =3D 1; } =20 DEFINE_MACHINE("xlnx-ep108", xlnx_ep108_machine_init) @@ -126,6 +130,8 @@ static void xlnx_zcu102_machine_init(MachineClass *mc) { mc->desc =3D "Xilinx ZynqMP ZCU102 board"; mc->init =3D xlnx_ep108_init; + mc->block_default_type =3D IF_IDE; + mc->units_per_default_bus =3D 1; } =20 DEFINE_MACHINE("xlnx-zcu102", xlnx_zcu102_machine_init) --=20 2.7.4 From nobody Sun May 19 16:58:50 2024 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 1487682567619590.1780309344834; Tue, 21 Feb 2017 05:09:27 -0800 (PST) Received: from localhost ([::1]:44433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgAC3-0005j8-3z for importer@patchew.org; Tue, 21 Feb 2017 08:09:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48511) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg9ef-0007k7-6m for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg9ed-00086E-9K for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39080) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg9eY-00084j-Iz; Tue, 21 Feb 2017 07:34:46 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 941993A7695; Tue, 21 Feb 2017 12:34:45 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LCYfjj011814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Feb 2017 07:34:42 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D418F1138650; Tue, 21 Feb 2017 13:34:39 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 13:34:31 +0100 Message-Id: <1487680479-15132-4-git-send-email-armbru@redhat.com> In-Reply-To: <1487680479-15132-1-git-send-email-armbru@redhat.com> References: <1487680479-15132-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 21 Feb 2017 12:34:46 +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 03/11] hw: Default -drive to if=none instead of ide when ide cannot work 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: Peter Maydell , Stefano Stabellini , Jia Liu , Mark Cave-Ayland , Anthony Green , Laurent Vivier , Fabien Chouteau , Alexander Graf , Max Filippov , Michael Walle , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Bastian Koppelmann , Anthony Perard , "Edgar E . Iglesias" , Guan Xuetao , xen-devel@lists.xensource.com, Artyom Tarasenko 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" Block backends defined with -drive if=3Dide are meant to be picked up by machine initialization code: a suitable frontend gets created and wired up automatically. if=3Dide drives not picked up that way can still be used with -device as if they had if=3Dnone, but that's unclean and best avoided. Unused ones produce an "Orphaned drive without device" warning. -drive parameter "if" is optional, and the default depends on the machine type. If a machine type doesn't specify a default, the default is "ide". Many machine types implicitly default to if=3Dide that way, even though they don't actually have an IDE controller. This makes no sense. Change the implicit default to if=3Dnone. Affected machines: * all targets: none * aarch64/arm: akita ast2500 canon cheetah collie connex imx25 integratorcp kzm lm3s6965evb lm3s811evb mainstone musicpal n800 n810 netduino2 nuri palmetto realview romulus sabrelite smdkc210 sx1 sx1 verdex z2 * cris: axis-dev88 * i386/x86_64: xenpv * lm32: lm32-evr lm32-uclinux milkymist * m68k: an5206 dummy mcf5208evb * microblaze/microblazeel: petalogix-ml605 petalogix-s3adsp1800 * mips/mips64/mips64el/mipsel: mipssim * moxie: moxiesim * or32: or32-sim * ppc/ppc64/ppcemb: bamboo ref405ep taihu virtex-ml507 * ppc/ppc64: mpc8544ds ppce500 * sh4/sh4eb: shix * sparc: leon3_generic * sparc64: niagara * tricore: tricore_testboard * unicore32: puv3 * xtensa/xtensaeb: kc705 lx200 lx60 ml605 sim None of these machines have an IDE controller, let alone code to honor if=3Dide. Cc: Peter Maydell Cc: qemu-arm@nongnu.org Cc: Edgar E. Iglesias Cc: Stefano Stabellini Cc: Anthony Perard Cc: xen-devel@lists.xensource.com Cc: Michael Walle Cc: Laurent Vivier Cc: Anthony Green Cc: Jia Liu Cc: Alexander Graf Cc: qemu-ppc@nongnu.org Cc: Magnus Damm Cc: Fabien Chouteau Cc: Mark Cave-Ayland Cc: Artyom Tarasenko Cc: Bastian Koppelmann Cc: Guan Xuetao Cc: Max Filippov Signed-off-by: Markus Armbruster Acked-By: Artyom Tarasenko Reviewed-by: Laurent Vivier Reviewed-by: Thomas Huth Message-Id: <1487153147-11530-4-git-send-email-armbru@redhat.com> --- include/sysemu/blockdev.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h index 16432f3..351a039 100644 --- a/include/sysemu/blockdev.h +++ b/include/sysemu/blockdev.h @@ -19,12 +19,11 @@ void blockdev_auto_del(BlockBackend *blk); typedef enum { IF_DEFAULT =3D -1, /* for use with drive_add() only */ /* - * IF_IDE must be zero, because we want MachineClass member - * block_default_type to default-initialize to IF_IDE + * IF_NONE must be zero, because we want MachineClass member + * block_default_type to default-initialize to IF_NONE */ - IF_IDE =3D 0, - IF_NONE, - IF_SCSI, IF_FLOPPY, IF_PFLASH, IF_MTD, IF_SD, IF_VIRTIO, IF_XEN, + IF_NONE =3D 0, + IF_IDE, IF_SCSI, IF_FLOPPY, IF_PFLASH, IF_MTD, IF_SD, IF_VIRTIO, IF_XE= N, IF_COUNT } BlockInterfaceType; =20 --=20 2.7.4 From nobody Sun May 19 16:58:50 2024 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 1487682300923574.2494950142867; Tue, 21 Feb 2017 05:05:00 -0800 (PST) Received: from localhost ([::1]:44407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgA7k-00019g-U6 for importer@patchew.org; Tue, 21 Feb 2017 08:04:56 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg9eb-0007ho-UB for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg9eZ-00085N-Cj for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33306) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg9eU-00082B-Aj; Tue, 21 Feb 2017 07:34:42 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 6D1524E4F2; Tue, 21 Feb 2017 12:34:42 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LCYfBd012600 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Feb 2017 07:34:42 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D71811138657; Tue, 21 Feb 2017 13:34:39 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 13:34:32 +0100 Message-Id: <1487680479-15132-5-git-send-email-armbru@redhat.com> In-Reply-To: <1487680479-15132-1-git-send-email-armbru@redhat.com> References: <1487680479-15132-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 21 Feb 2017 12:34:42 +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 04/11] hw: Default -drive to if=none instead of scsi when scsi cannot work 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: Peter Maydell , Alistair Francis , qemu-arm@nongnu.org, "Edgar E. Iglesias" 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" Block backends defined with -drive if=3Dscsi are meant to be picked up by machine initialization code: a suitable frontend gets created and wired up automatically. if=3Dscsi drives not picked up that way can still be used with -device as if they had if=3Dnone, but that's unclean and best avoided. Unused ones produce an "Orphaned drive without device" warning. A few machine types default to if=3Dscsi, even though they don't actually have a SCSI HBA. This makes no sense. Change their default to if=3Dnone. Affected machines: * aarch64/arm: realview-pbx-a9 vexpress-a9 vexpress-a15 xilinx-zynq-a9 Cc: Peter Maydell Cc: "Edgar E. Iglesias" Cc: Alistair Francis Cc: qemu-arm@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Thomas Huth Reviewed-by: Alistair Francis Message-Id: <1487153147-11530-5-git-send-email-armbru@redhat.com> --- hw/arm/realview.c | 1 - hw/arm/vexpress.c | 1 - hw/arm/xilinx_zynq.c | 1 - 3 files changed, 3 deletions(-) diff --git a/hw/arm/realview.c b/hw/arm/realview.c index 8eafcca..8c11c7a 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -443,7 +443,6 @@ static void realview_pbx_a9_class_init(ObjectClass *oc,= void *data) =20 mc->desc =3D "ARM RealView Platform Baseboard Explore for Cortex-A9"; mc->init =3D realview_pbx_a9_init; - mc->block_default_type =3D IF_SCSI; mc->max_cpus =3D 4; } =20 diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index e057568..c6b1e67 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -752,7 +752,6 @@ static void vexpress_class_init(ObjectClass *oc, void *= data) =20 mc->desc =3D "ARM Versatile Express"; mc->init =3D vexpress_common_init; - mc->block_default_type =3D IF_SCSI; mc->max_cpus =3D 4; } =20 diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c index 7dac20d..3985356 100644 --- a/hw/arm/xilinx_zynq.c +++ b/hw/arm/xilinx_zynq.c @@ -323,7 +323,6 @@ static void zynq_machine_init(MachineClass *mc) { mc->desc =3D "Xilinx Zynq Platform Baseboard for Cortex-A9"; mc->init =3D zynq_init; - mc->block_default_type =3D IF_SCSI; mc->max_cpus =3D 1; mc->no_sdcard =3D 1; } --=20 2.7.4 From nobody Sun May 19 16:58:50 2024 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 1487683718099371.1920413311236; Tue, 21 Feb 2017 05:28:38 -0800 (PST) Received: from localhost ([::1]:44600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgAUe-0007Wz-Ki for importer@patchew.org; Tue, 21 Feb 2017 08:28:36 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48518) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg9ei-0007mR-1w for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg9ed-000869-80 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39038) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg9eV-00082y-Sp; Tue, 21 Feb 2017 07:34:43 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (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 0C56837F1F; Tue, 21 Feb 2017 12:34:44 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LCYgn4029937 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Feb 2017 07:34:43 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D9DD111386CE; Tue, 21 Feb 2017 13:34:39 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 13:34:33 +0100 Message-Id: <1487680479-15132-6-git-send-email-armbru@redhat.com> In-Reply-To: <1487680479-15132-1-git-send-email-armbru@redhat.com> References: <1487680479-15132-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 21 Feb 2017 12:34:44 +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 05/11] hw/arm/highbank: Default -drive to if=ide instead of if=scsi 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: Rob Herring , qemu-arm@nongnu.org, Peter Maydell 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" These machines have no onboard SCSI HBA, and no way to plug one. -drive if=3Dscsi therefore cannot work. They do have an onboard IDE controller (sysbus-ahci), but fail to honor if=3Dide. Change their default to if=3Dide, and add a TODO comment on what needs to be done to actually honor -drive if=3Dide. Cc: Rob Herring Cc: Peter Maydell Cc: qemu-arm@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Thomas Huth Message-Id: <1487153147-11530-6-git-send-email-armbru@redhat.com> --- hw/arm/highbank.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c index 80e5fd4..0a4508c 100644 --- a/hw/arm/highbank.c +++ b/hw/arm/highbank.c @@ -363,6 +363,8 @@ static void calxeda_init(MachineState *machine, enum cx= machines machine_id) sysbus_connect_irq(SYS_BUS_DEVICE(dev), 2, pic[82]); } =20 + /* TODO create and connect IDE devices for ide_drive_get() */ + highbank_binfo.ram_size =3D ram_size; highbank_binfo.kernel_filename =3D kernel_filename; highbank_binfo.kernel_cmdline =3D kernel_cmdline; @@ -405,7 +407,8 @@ static void highbank_class_init(ObjectClass *oc, void *= data) =20 mc->desc =3D "Calxeda Highbank (ECX-1000)"; mc->init =3D highbank_init; - mc->block_default_type =3D IF_SCSI; + mc->block_default_type =3D IF_IDE; + mc->units_per_default_bus =3D 1; mc->max_cpus =3D 4; } =20 @@ -421,7 +424,8 @@ static void midway_class_init(ObjectClass *oc, void *da= ta) =20 mc->desc =3D "Calxeda Midway (ECX-2000)"; mc->init =3D midway_init; - mc->block_default_type =3D IF_SCSI; + mc->block_default_type =3D IF_IDE; + mc->units_per_default_bus =3D 1; mc->max_cpus =3D 4; } =20 --=20 2.7.4 From nobody Sun May 19 16:58:50 2024 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 1487683526401504.81762267868885; Tue, 21 Feb 2017 05:25:26 -0800 (PST) Received: from localhost ([::1]:44558 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgARX-00047h-QM for importer@patchew.org; Tue, 21 Feb 2017 08:25:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg9eZ-0007ee-9s for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg9eV-00083F-W1 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38318) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg9eV-00082q-QA for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:43 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 026A97FB67 for ; Tue, 21 Feb 2017 12:34:44 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BF2E965410 for ; Tue, 21 Feb 2017 12:34:43 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id DCB2511386DC; Tue, 21 Feb 2017 13:34:39 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 13:34:34 +0100 Message-Id: <1487680479-15132-7-git-send-email-armbru@redhat.com> In-Reply-To: <1487680479-15132-1-git-send-email-armbru@redhat.com> References: <1487680479-15132-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 21 Feb 2017 12:34:44 +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 06/11] blockdev: Improve message for orphaned -drive 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: , 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" We warn when a -drive isn't supported by the machine type (commit a66c9dc): $ qemu-system-x86_64 -S -display none -drive if=3Dmtd Warning: Orphaned drive without device: id=3Dmtd0,file=3D,if=3Dmtd,bus= =3D0,unit=3D0 Improve this to point to the offending bit of configuration: qemu-system-x86_64: -drive if=3Dmtd: warning: machine type does not sup= port if=3Dmtd,bus=3D0,unit=3D0 Especially nice when it's hidden behind -readconfig foo.cfg: qemu-system-x86_64:foo.cfg:140: warning: machine type does not support = if=3Dmtd,bus=3D0,unit=3D0 Signed-off-by: Markus Armbruster Message-Id: <1487153147-11530-7-git-send-email-armbru@redhat.com> Reviewed-by: John Snow --- blockdev.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/blockdev.c b/blockdev.c index db82ac9..eb75f35 100644 --- a/blockdev.c +++ b/blockdev.c @@ -231,6 +231,7 @@ bool drive_check_orphaned(void) { BlockBackend *blk; DriveInfo *dinfo; + Location loc; bool rs =3D false; =20 for (blk =3D blk_next(NULL); blk; blk =3D blk_next(blk)) { @@ -239,10 +240,12 @@ bool drive_check_orphaned(void) /* Unless this is a default drive, this may be an oversight. */ if (!blk_get_attached_dev(blk) && !dinfo->is_default && dinfo->type !=3D IF_NONE) { - fprintf(stderr, "Warning: Orphaned drive without device: " - "id=3D%s,file=3D%s,if=3D%s,bus=3D%d,unit=3D%d\n", - blk_name(blk), blk_bs(blk) ? blk_bs(blk)->filename : "= ", - if_name[dinfo->type], dinfo->bus, dinfo->unit); + loc_push_none(&loc); + qemu_opts_loc_restore(dinfo->opts); + error_report("warning: machine type does not support" + " if=3D%s,bus=3D%d,unit=3D%d", + if_name[dinfo->type], dinfo->bus, dinfo->unit); + loc_pop(&loc); rs =3D true; } } --=20 2.7.4 From nobody Sun May 19 16:58:50 2024 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 1487681212513382.9910859352382; Tue, 21 Feb 2017 04:46:52 -0800 (PST) Received: from localhost ([::1]:44223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg9qE-00019v-5M for importer@patchew.org; Tue, 21 Feb 2017 07:46:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg9eZ-0007ec-97 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg9eV-00083H-W1 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53448) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg9eV-00082s-Qv for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:43 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (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 0BE373D95D for ; Tue, 21 Feb 2017 12:34:44 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LCYgTv029938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 21 Feb 2017 07:34:43 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id DF88911385E0; Tue, 21 Feb 2017 13:34:39 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 13:34:35 +0100 Message-Id: <1487680479-15132-8-git-send-email-armbru@redhat.com> In-Reply-To: <1487680479-15132-1-git-send-email-armbru@redhat.com> References: <1487680479-15132-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 21 Feb 2017 12:34:44 +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 07/11] blockdev: Make orphaned -drive fatal 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: , 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" Block backends defined with "-drive if=3DT" with T other than "none" are meant to be picked up by machine initialization code: a suitable frontend gets created and wired up automatically. If machine initialization code doesn't comply, the block backend remains unused. This triggers a warning since commit a66c9dc, v2.2.0. Drives created by default are exempted; use -nodefaults to get rid of them. Turn this warning into an error. Signed-off-by: Markus Armbruster Message-Id: <1487153147-11530-8-git-send-email-armbru@redhat.com> Reviewed-by: John Snow --- blockdev.c | 14 +++++++------- include/sysemu/blockdev.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/blockdev.c b/blockdev.c index eb75f35..bbf9d4d 100644 --- a/blockdev.c +++ b/blockdev.c @@ -227,30 +227,30 @@ DriveInfo *drive_get(BlockInterfaceType type, int bus= , int unit) return NULL; } =20 -bool drive_check_orphaned(void) +void drive_check_orphaned(void) { BlockBackend *blk; DriveInfo *dinfo; Location loc; - bool rs =3D false; + bool orphans =3D false; =20 for (blk =3D blk_next(NULL); blk; blk =3D blk_next(blk)) { dinfo =3D blk_legacy_dinfo(blk); - /* If dinfo->bdrv->dev is NULL, it has no device attached. */ - /* Unless this is a default drive, this may be an oversight. */ if (!blk_get_attached_dev(blk) && !dinfo->is_default && dinfo->type !=3D IF_NONE) { loc_push_none(&loc); qemu_opts_loc_restore(dinfo->opts); - error_report("warning: machine type does not support" + error_report("machine type does not support" " if=3D%s,bus=3D%d,unit=3D%d", if_name[dinfo->type], dinfo->bus, dinfo->unit); loc_pop(&loc); - rs =3D true; + orphans =3D true; } } =20 - return rs; + if (orphans) { + exit(1); + } } =20 DriveInfo *drive_get_by_index(BlockInterfaceType type, int index) diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h index 351a039..ac22f2a 100644 --- a/include/sysemu/blockdev.h +++ b/include/sysemu/blockdev.h @@ -48,7 +48,7 @@ BlockBackend *blk_by_legacy_dinfo(DriveInfo *dinfo); void override_max_devs(BlockInterfaceType type, int max_devs); =20 DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit); -bool drive_check_orphaned(void); +void drive_check_orphaned(void); DriveInfo *drive_get_by_index(BlockInterfaceType type, int index); int drive_get_max_bus(BlockInterfaceType type); int drive_get_max_devs(BlockInterfaceType type); --=20 2.7.4 From nobody Sun May 19 16:58:50 2024 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 1487682675787102.12599467471512; Tue, 21 Feb 2017 05:11:15 -0800 (PST) Received: from localhost ([::1]:44450 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgADo-0007Nx-DH for importer@patchew.org; Tue, 21 Feb 2017 08:11:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg9eZ-0007fA-N0 for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg9eX-00084S-7J for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53454) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg9eW-00083r-Vp for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:45 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (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 A13B83D963; Tue, 21 Feb 2017 12:34:44 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LCYgkN029941 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Feb 2017 07:34:43 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E26C411385E1; Tue, 21 Feb 2017 13:34:39 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 13:34:36 +0100 Message-Id: <1487680479-15132-9-git-send-email-armbru@redhat.com> In-Reply-To: <1487680479-15132-1-git-send-email-armbru@redhat.com> References: <1487680479-15132-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 21 Feb 2017 12:34:45 +0000 (UTC) Content-Transfer-Encoding: quoted-printable 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 08/11] hw: Drop superfluous special checks for orphaned -drive 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: =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Mark Cave-Ayland , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" We've traditionally rejected orphans here and there, but not systematically. For instance, the sun4m machines have an onboard SCSI HBA (bus=3D0), and have always rejected bus>0. Other machines with an onboard SCSI HBA don't. Commit a66c9dc made all orphans trigger a warning, and the previous commit turned this into an error. The checks "here and there" are now redundant. Drop them. Note that the one in mips_jazz.c was wrong: it rejected bus > MAX_FD, but MAX_FD is the number of floppy drives per bus. Error messages change from $ qemu-system-x86_64 -drive if=3Dide,bus=3D2 qemu-system-x86_64: Too many IDE buses defined (3 > 2) $ qemu-system-mips64 -M magnum,accel=3Dqtest -drive if=3Dfloppy,bus=3D2= ,id=3Dfd1 qemu: too many floppy drives $ qemu-system-sparc -M LX -drive if=3Dscsi,bus=3D1 qemu: too many SCSI bus to $ qemu-system-x86_64 -drive if=3Dide,bus=3D2 qemu-system-x86_64: -drive if=3Dide,bus=3D2: machine type does not supp= ort if=3Dide,bus=3D2,unit=3D0 $ qemu-system-mips64 -M magnum,accel=3Dqtest -drive if=3Dfloppy,bus=3D2= ,id=3Dfd1 qemu-system-mips64: -drive if=3Dfloppy,bus=3D2,id=3Dfd1: machine type d= oes not support if=3Dfloppy,bus=3D2,unit=3D0 $ qemu-system-sparc -M LX -drive if=3Dscsi,bus=3D1 qemu-system-sparc: -drive if=3Dscsi,bus=3D1: machine type does not supp= ort if=3Dscsi,bus=3D1,unit=3D0 Cc: John Snow Cc: "Herv=C3=A9 Poussineau" Cc: Mark Cave-Ayland Signed-off-by: Markus Armbruster Message-Id: <1487153147-11530-9-git-send-email-armbru@redhat.com> Reviewed-by: John Snow --- hw/ide/core.c | 17 ----------------- hw/mips/mips_jazz.c | 4 ---- hw/sparc/sun4m.c | 5 ----- 3 files changed, 26 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index 43709e5..cfa5de6 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2840,23 +2840,6 @@ const VMStateDescription vmstate_ide_bus =3D { void ide_drive_get(DriveInfo **hd, int n) { int i; - int highest_bus =3D drive_get_max_bus(IF_IDE) + 1; - int max_devs =3D drive_get_max_devs(IF_IDE); - int n_buses =3D max_devs ? (n / max_devs) : n; - - /* - * Note: The number of actual buses available is not known. - * We compute this based on the size of the DriveInfo* array, n. - * If it is less than max_devs * , - * We will stop looking for drives prematurely instead of overfilling - * the array. - */ - - if (highest_bus > n_buses) { - error_report("Too many IDE buses defined (%d > %d)", - highest_bus, n_buses); - exit(1); - } =20 for (i =3D 0; i < n; i++) { hd[i] =3D drive_get_by_index(IF_IDE, i); diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index 73f6c9f..1cef581 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -291,10 +291,6 @@ static void mips_jazz_init(MachineState *machine, qdev_get_gpio_in(rc4030, 5), &esp_reset, &dma_enable); =20 /* Floppy */ - if (drive_get_max_bus(IF_FLOPPY) >=3D MAX_FD) { - fprintf(stderr, "qemu: too many floppy drives\n"); - exit(1); - } for (n =3D 0; n < MAX_FD; n++) { fds[n] =3D drive_get(IF_FLOPPY, 0, n); } diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index f5b6efd..61416a6 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -989,11 +989,6 @@ static void sun4m_hw_init(const struct sun4m_hwdef *hw= def, slavio_misc_init(hwdef->slavio_base, hwdef->aux1_base, hwdef->aux2_bas= e, slavio_irq[30], fdc_tc); =20 - if (drive_get_max_bus(IF_SCSI) > 0) { - fprintf(stderr, "qemu: too many SCSI bus\n"); - exit(1); - } - esp_init(hwdef->esp_base, 2, espdma_memory_read, espdma_memory_write, espdma, espdma_irq, &esp_reset, &dma_enable); --=20 2.7.4 From nobody Sun May 19 16:58:50 2024 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 1487682014351405.36841567745205; Tue, 21 Feb 2017 05:00:14 -0800 (PST) Received: from localhost ([::1]:44344 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgA3A-0005SO-OR for importer@patchew.org; Tue, 21 Feb 2017 08:00:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg9eZ-0007ed-9l for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg9eW-00083j-9e for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52838) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg9eW-000835-1t for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:44 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (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 39CED61B91 for ; Tue, 21 Feb 2017 12:34:44 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LCYgrK011832 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 21 Feb 2017 07:34:43 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E54D811385ED; Tue, 21 Feb 2017 13:34:39 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 13:34:37 +0100 Message-Id: <1487680479-15132-10-git-send-email-armbru@redhat.com> In-Reply-To: <1487680479-15132-1-git-send-email-armbru@redhat.com> References: <1487680479-15132-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 21 Feb 2017 12:34:44 +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 09/11] hw/scsi: Concentrate -drive if=scsi auto-create in one place 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: , 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 logic to create frontends for -drive if=3Dscsi is in SCSI HBAs. For all other interface types, it's in machine initialization code. A few machine types create the SCSI HBAs necessary for that. That's also not done for other interface types. I'm going to deprecate these SCSI eccentricities. In preparation for that, create the frontends in main() instead of the SCSI HBAs, by calling new function scsi_legacy_handle_cmdline() there. Note that not all SCSI HBAs create frontends. Take care not to change that. Signed-off-by: Markus Armbruster Message-Id: <1487161136-9018-2-git-send-email-armbru@redhat.com> Acked-By: Paolo Bonzini --- hw/scsi/esp-pci.c | 3 --- hw/scsi/esp.c | 6 ------ hw/scsi/lsi53c895a.c | 3 --- hw/scsi/megasas.c | 4 ---- hw/scsi/mptsas.c | 4 ---- hw/scsi/scsi-bus.c | 45 ++++++++++++++++++++++++++++++++++++++------- hw/scsi/spapr_vscsi.c | 3 --- hw/scsi/virtio-scsi.c | 8 -------- include/hw/scsi/scsi.h | 3 ++- vl.c | 4 ++++ 10 files changed, 44 insertions(+), 39 deletions(-) diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c index 595f88b..e295d88 100644 --- a/hw/scsi/esp-pci.c +++ b/hw/scsi/esp-pci.c @@ -367,9 +367,6 @@ static void esp_pci_scsi_realize(PCIDevice *dev, Error = **errp) s->irq =3D pci_allocate_irq(dev); =20 scsi_bus_new(&s->bus, sizeof(s->bus), d, &esp_pci_scsi_info, NULL); - if (!d->hotplugged) { - scsi_bus_legacy_handle_cmdline(&s->bus, errp); - } } =20 static void esp_pci_scsi_uninit(PCIDevice *d) diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c index 5a5a4e9..eee831e 100644 --- a/hw/scsi/esp.c +++ b/hw/scsi/esp.c @@ -690,7 +690,6 @@ static void sysbus_esp_realize(DeviceState *dev, Error = **errp) SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); SysBusESPState *sysbus =3D ESP(dev); ESPState *s =3D &sysbus->esp; - Error *err =3D NULL; =20 sysbus_init_irq(sbd, &s->irq); assert(sysbus->it_shift !=3D -1); @@ -703,11 +702,6 @@ static void sysbus_esp_realize(DeviceState *dev, Error= **errp) qdev_init_gpio_in(dev, sysbus_esp_gpio_demux, 2); =20 scsi_bus_new(&s->bus, sizeof(s->bus), dev, &esp_scsi_info, NULL); - scsi_bus_legacy_handle_cmdline(&s->bus, &err); - if (err !=3D NULL) { - error_propagate(errp, err); - return; - } } =20 static void sysbus_esp_hard_reset(DeviceState *dev) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index feb1191..292fa87 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -2216,9 +2216,6 @@ static void lsi_scsi_realize(PCIDevice *dev, Error **= errp) QTAILQ_INIT(&s->queue); =20 scsi_bus_new(&s->bus, sizeof(s->bus), d, &lsi_scsi_info, NULL); - if (!d->hotplugged) { - scsi_bus_legacy_handle_cmdline(&s->bus, errp); - } } =20 static void lsi_scsi_unrealize(DeviceState *dev, Error **errp) diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c index 1a8b04c..e3d59b7 100644 --- a/hw/scsi/megasas.c +++ b/hw/scsi/megasas.c @@ -2325,7 +2325,6 @@ static const struct SCSIBusInfo megasas_scsi_info =3D= { =20 static void megasas_scsi_realize(PCIDevice *dev, Error **errp) { - DeviceState *d =3D DEVICE(dev); MegasasState *s =3D MEGASAS(dev); MegasasBaseClass *b =3D MEGASAS_DEVICE_GET_CLASS(s); uint8_t *pci_conf; @@ -2426,9 +2425,6 @@ static void megasas_scsi_realize(PCIDevice *dev, Erro= r **errp) =20 scsi_bus_new(&s->bus, sizeof(s->bus), DEVICE(dev), &megasas_scsi_info, NULL); - if (!d->hotplugged) { - scsi_bus_legacy_handle_cmdline(&s->bus, errp); - } } =20 static Property megasas_properties_gen1[] =3D { diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c index ad87e78..2e091c0 100644 --- a/hw/scsi/mptsas.c +++ b/hw/scsi/mptsas.c @@ -1271,7 +1271,6 @@ static const struct SCSIBusInfo mptsas_scsi_info =3D { =20 static void mptsas_scsi_realize(PCIDevice *dev, Error **errp) { - DeviceState *d =3D DEVICE(dev); MPTSASState *s =3D MPT_SAS(dev); Error *err =3D NULL; int ret; @@ -1326,9 +1325,6 @@ static void mptsas_scsi_realize(PCIDevice *dev, Error= **errp) QTAILQ_INIT(&s->pending); =20 scsi_bus_new(&s->bus, sizeof(s->bus), &dev->qdev, &mptsas_scsi_info, N= ULL); - if (!d->hotplugged) { - scsi_bus_legacy_handle_cmdline(&s->bus, errp); - } } =20 static void mptsas_scsi_uninit(PCIDevice *dev) diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index 5940cb1..b9111ee 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -261,12 +261,11 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, B= lockBackend *blk, return SCSI_DEVICE(dev); } =20 -void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, Error **errp) +void scsi_bus_legacy_handle_cmdline(SCSIBus *bus) { Location loc; DriveInfo *dinfo; int unit; - Error *err =3D NULL; =20 loc_push_none(&loc); for (unit =3D 0; unit <=3D bus->info->max_target; unit++) { @@ -276,15 +275,47 @@ void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, Err= or **errp) } qemu_opts_loc_restore(dinfo->opts); scsi_bus_legacy_add_drive(bus, blk_by_legacy_dinfo(dinfo), - unit, false, -1, NULL, &err); - if (err !=3D NULL) { - error_propagate(errp, err); - break; - } + unit, false, -1, NULL, &error_fatal); } loc_pop(&loc); } =20 +static bool is_scsi_hba_with_legacy_magic(Object *obj) +{ + static const char *magic[] =3D { + "am53c974", "dc390", "esp", "lsi53c810", "lsi53c895a", + "megasas", "megasas-gen2", "mptsas1068", "spapr-vscsi", + "virtio-scsi-device", + NULL + }; + const char *typename =3D object_get_typename(obj); + int i; + + for (i =3D 0; magic[i]; i++) + if (!strcmp(typename, magic[i])) { + return true; + } + + return false; +} + +static int scsi_legacy_handle_cmdline_cb(Object *obj, void *opaque) +{ + SCSIBus *bus =3D (SCSIBus *)object_dynamic_cast(obj, TYPE_SCSI_BUS); + + if (bus && is_scsi_hba_with_legacy_magic(OBJECT(bus->qbus.parent))) { + scsi_bus_legacy_handle_cmdline(bus); + } + + return 0; +} + +void scsi_legacy_handle_cmdline(void) +{ + object_child_foreach_recursive(object_get_root(), + scsi_legacy_handle_cmdline_cb, NULL); +} + static int32_t scsi_invalid_field(SCSIRequest *req, uint8_t *buf) { scsi_req_build_sense(req, SENSE_CODE(INVALID_FIELD)); diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c index 6090a20..7d44771 100644 --- a/hw/scsi/spapr_vscsi.c +++ b/hw/scsi/spapr_vscsi.c @@ -1206,9 +1206,6 @@ static void spapr_vscsi_realize(VIOsPAPRDevice *dev, = Error **errp) =20 scsi_bus_new(&s->bus, sizeof(s->bus), DEVICE(dev), &vscsi_scsi_info, NULL); - if (!dev->qdev.hotplugged) { - scsi_bus_legacy_handle_cmdline(&s->bus, errp); - } } =20 void spapr_vscsi_create(VIOsPAPRBus *bus) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index b01030b..4fb9259 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -897,14 +897,6 @@ static void virtio_scsi_device_realize(DeviceState *de= v, Error **errp) /* override default SCSI bus hotplug-handler, with virtio-scsi's one */ qbus_set_hotplug_handler(BUS(&s->bus), dev, &error_abort); =20 - if (!dev->hotplugged) { - scsi_bus_legacy_handle_cmdline(&s->bus, &err); - if (err !=3D NULL) { - error_propagate(errp, err); - return; - } - } - virtio_scsi_dataplane_setup(s, errp); } =20 diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index 9bad49e..eeef949 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -177,7 +177,8 @@ static inline SCSIBus *scsi_bus_from_device(SCSIDevice = *d) SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk, int unit, bool removable, int bootin= dex, const char *serial, Error **errp); -void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, Error **errp); +void scsi_bus_legacy_handle_cmdline(SCSIBus *bus); +void scsi_legacy_handle_cmdline(void); =20 /* * Predefined sense codes diff --git a/vl.c b/vl.c index 27d9829..ab40889 100644 --- a/vl.c +++ b/vl.c @@ -62,6 +62,7 @@ int main(int argc, char **argv) #include "hw/usb.h" #include "hw/i386/pc.h" #include "hw/isa/isa.h" +#include "hw/scsi/scsi.h" #include "hw/bt.h" #include "sysemu/watchdog.h" #include "hw/smbios/smbios.h" @@ -4509,6 +4510,9 @@ int main(int argc, char **argv, char **envp) =20 rom_reset_order_override(); =20 + /* Create frontends for -drive if=3Dscsi */ + scsi_legacy_handle_cmdline(); + /* Did we create any drives that we failed to create a device for? */ drive_check_orphaned(); =20 --=20 2.7.4 From nobody Sun May 19 16:58:50 2024 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 1487681490475779.5375840749006; Tue, 21 Feb 2017 04:51:30 -0800 (PST) Received: from localhost ([::1]:44245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg9uj-0005PD-2v for importer@patchew.org; Tue, 21 Feb 2017 07:51:29 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg9eZ-0007ea-8p for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg9eW-00083f-9G for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33314) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg9eW-000833-0s for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:44 -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 37E014E33C for ; Tue, 21 Feb 2017 12:34:44 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LCYgnm026913 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 21 Feb 2017 07:34:43 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E8D1411385F0; Tue, 21 Feb 2017 13:34:39 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 13:34:38 +0100 Message-Id: <1487680479-15132-11-git-send-email-armbru@redhat.com> In-Reply-To: <1487680479-15132-1-git-send-email-armbru@redhat.com> References: <1487680479-15132-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.38]); Tue, 21 Feb 2017 12:34:44 +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 10/11] hw: Deprecate -drive if=scsi with non-onboard HBAs 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: , 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" Block backends defined with "-drive if=3DT" with T other than "none" are meant to be picked up by machine initialization code: a suitable frontend gets created and wired up automatically. Drives defined with if=3Dscsi are also picked up by SCSI HBAs added with -device, unlike other interface types. Deprecate this usage, as follows. Create the frontends for onboard HBAs in machine initialization code, exactly like we do for if=3Dide and other interface types. Change scsi_legacy_handle_cmdline() to create a frontend only when it's still missing, and warn that this usage is deprecated. Signed-off-by: Markus Armbruster Message-Id: <1487161136-9018-3-git-send-email-armbru@redhat.com> --- hw/arm/realview.c | 2 +- hw/arm/versatilepb.c | 2 +- hw/i386/pc.c | 2 +- hw/scsi/lsi53c895a.c | 7 +++++++ hw/scsi/scsi-bus.c | 15 +++++++++++++-- hw/scsi/spapr_vscsi.c | 2 ++ include/hw/pci/pci.h | 2 ++ include/hw/scsi/scsi.h | 2 +- vl.c | 8 +++++++- 9 files changed, 35 insertions(+), 7 deletions(-) diff --git a/hw/arm/realview.c b/hw/arm/realview.c index 8c11c7a..b7d4753 100644 --- a/hw/arm/realview.c +++ b/hw/arm/realview.c @@ -259,7 +259,7 @@ static void realview_init(MachineState *machine, } n =3D drive_get_max_bus(IF_SCSI); while (n >=3D 0) { - pci_create_simple(pci_bus, -1, "lsi53c895a"); + lsi53c895a_create(pci_bus); n--; } } diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 7b5cb36..b0e9f5b 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -290,7 +290,7 @@ static void versatile_init(MachineState *machine, int b= oard_id) } n =3D drive_get_max_bus(IF_SCSI); while (n >=3D 0) { - pci_create_simple(pci_bus, -1, "lsi53c895a"); + lsi53c895a_create(pci_bus); n--; } =20 diff --git a/hw/i386/pc.c b/hw/i386/pc.c index a555c35..c2c75e2 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1652,7 +1652,7 @@ void pc_pci_device_init(PCIBus *pci_bus) =20 max_bus =3D drive_get_max_bus(IF_SCSI); for (bus =3D 0; bus <=3D max_bus; bus++) { - pci_create_simple(pci_bus, -1, "lsi53c895a"); + lsi53c895a_create(pci_bus); } } =20 diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 292fa87..595c260 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -2268,3 +2268,10 @@ static void lsi53c895a_register_types(void) } =20 type_init(lsi53c895a_register_types) + +void lsi53c895a_create(PCIBus *bus) +{ + LSIState *s =3D LSI53C895A(pci_create_simple(bus, -1, "lsi53c895a")); + + scsi_bus_legacy_handle_cmdline(&s->bus, false); +} diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c index b9111ee..8cc80bf 100644 --- a/hw/scsi/scsi-bus.c +++ b/hw/scsi/scsi-bus.c @@ -261,7 +261,7 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, Blo= ckBackend *blk, return SCSI_DEVICE(dev); } =20 -void scsi_bus_legacy_handle_cmdline(SCSIBus *bus) +void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, bool deprecated) { Location loc; DriveInfo *dinfo; @@ -274,6 +274,17 @@ void scsi_bus_legacy_handle_cmdline(SCSIBus *bus) continue; } qemu_opts_loc_restore(dinfo->opts); + if (deprecated) { + /* Handling -drive not claimed by machine initialization */ + if (blk_get_attached_dev(blk_by_legacy_dinfo(dinfo))) { + continue; /* claimed */ + } + if (!dinfo->is_default) { + error_report("warning: bus=3D%d,unit=3D%d is deprecated wi= th this" + " machine type", + bus->busnr, unit); + } + } scsi_bus_legacy_add_drive(bus, blk_by_legacy_dinfo(dinfo), unit, false, -1, NULL, &error_fatal); } @@ -304,7 +315,7 @@ static int scsi_legacy_handle_cmdline_cb(Object *obj, v= oid *opaque) SCSIBus *bus =3D (SCSIBus *)object_dynamic_cast(obj, TYPE_SCSI_BUS); =20 if (bus && is_scsi_hba_with_legacy_magic(OBJECT(bus->qbus.parent))) { - scsi_bus_legacy_handle_cmdline(bus); + scsi_bus_legacy_handle_cmdline(bus, true); } =20 return 0; diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c index 7d44771..55ee48c 100644 --- a/hw/scsi/spapr_vscsi.c +++ b/hw/scsi/spapr_vscsi.c @@ -1215,6 +1215,8 @@ void spapr_vscsi_create(VIOsPAPRBus *bus) dev =3D qdev_create(&bus->bus, "spapr-vscsi"); =20 qdev_init_nofail(dev); + scsi_bus_legacy_handle_cmdline(&VIO_SPAPR_VSCSI_DEVICE(dev)->bus, + false); } =20 static int spapr_vscsi_devnode(VIOsPAPRDevice *dev, void *fdt, int node_of= f) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index 05ef14b..6983f13 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -688,6 +688,8 @@ PCIDevice *pci_create_simple_multifunction(PCIBus *bus,= int devfn, PCIDevice *pci_create(PCIBus *bus, int devfn, const char *name); PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name); =20 +void lsi53c895a_create(PCIBus *bus); + qemu_irq pci_allocate_irq(PCIDevice *pci_dev); void pci_set_irq(PCIDevice *pci_dev, int level); =20 diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index eeef949..6b85786 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -177,7 +177,7 @@ static inline SCSIBus *scsi_bus_from_device(SCSIDevice = *d) SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk, int unit, bool removable, int bootin= dex, const char *serial, Error **errp); -void scsi_bus_legacy_handle_cmdline(SCSIBus *bus); +void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, bool deprecated); void scsi_legacy_handle_cmdline(void); =20 /* diff --git a/vl.c b/vl.c index ab40889..b5d0a19 100644 --- a/vl.c +++ b/vl.c @@ -4510,7 +4510,13 @@ int main(int argc, char **argv, char **envp) =20 rom_reset_order_override(); =20 - /* Create frontends for -drive if=3Dscsi */ + /* + * Create frontends for -drive if=3Dscsi leftovers. + * Normally, frontends for -drive get created by machine + * initialization for onboard SCSI HBAs. However, we create a few + * more ever since SCSI qdevification, but this is pretty much an + * implementation accident, and deprecated. + */ scsi_legacy_handle_cmdline(); =20 /* Did we create any drives that we failed to create a device for? */ --=20 2.7.4 From nobody Sun May 19 16:58:50 2024 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 1487683467426735.335643481429; Tue, 21 Feb 2017 05:24:27 -0800 (PST) Received: from localhost ([::1]:44555 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cgAQY-0003DE-VQ for importer@patchew.org; Tue, 21 Feb 2017 08:24:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg9eZ-0007eg-9y for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg9eW-00083w-FN for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36468) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg9eW-000837-6m for qemu-devel@nongnu.org; Tue, 21 Feb 2017 07:34:44 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (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 63851C06C9E8 for ; Tue, 21 Feb 2017 12:34:44 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1LCYgd4012614 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 21 Feb 2017 07:34:43 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id EC55311385FC; Tue, 21 Feb 2017 13:34:39 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 21 Feb 2017 13:34:39 +0100 Message-Id: <1487680479-15132-12-git-send-email-armbru@redhat.com> In-Reply-To: <1487680479-15132-1-git-send-email-armbru@redhat.com> References: <1487680479-15132-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 21 Feb 2017 12:34:44 +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 11/11] 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: , 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 Message-Id: <1487161136-9018-4-git-send-email-armbru@redhat.com> Acked-By: Paolo Bonzini --- 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 809b2b0..1e815ef 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