From nobody Sun Feb 8 14:56:41 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 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