Skip to content

Commit

Permalink
hw: Default -drive to if=ide explicitly where it works
Browse files Browse the repository at this point in the history
Block backends defined with -drive if=ide are meant to be picked up by
machine initialization code: a suitable frontend gets created and
wired up automatically.

if=ide drives not picked up that way can still be used with -device as
if they had if=none, 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=ide, 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=ide 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 <armbru@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1487153147-11530-2-git-send-email-armbru@redhat.com>
  • Loading branch information
Markus Armbruster committed Feb 21, 2017
1 parent b856256 commit 2059839
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions hw/alpha/dp264.c
Expand Up @@ -177,6 +177,7 @@ static void clipper_machine_init(MachineClass *mc)
{
mc->desc = "Alpha DP264/CLIPPER";
mc->init = clipper_init;
mc->block_default_type = IF_IDE;
mc->max_cpus = 4;
mc->is_default = 1;
}
Expand Down
3 changes: 3 additions & 0 deletions hw/arm/spitz.c
Expand Up @@ -998,6 +998,7 @@ static void spitzpda_class_init(ObjectClass *oc, void *data)

mc->desc = "Sharp SL-C3000 (Spitz) PDA (PXA270)";
mc->init = spitz_init;
mc->block_default_type = IF_IDE;
}

static const TypeInfo spitzpda_type = {
Expand All @@ -1012,6 +1013,7 @@ static void borzoipda_class_init(ObjectClass *oc, void *data)

mc->desc = "Sharp SL-C3100 (Borzoi) PDA (PXA270)";
mc->init = borzoi_init;
mc->block_default_type = IF_IDE;
}

static const TypeInfo borzoipda_type = {
Expand All @@ -1026,6 +1028,7 @@ static void terrierpda_class_init(ObjectClass *oc, void *data)

mc->desc = "Sharp SL-C3200 (Terrier) PDA (PXA270)";
mc->init = terrier_init;
mc->block_default_type = IF_IDE;
}

static const TypeInfo terrierpda_type = {
Expand Down
1 change: 1 addition & 0 deletions hw/arm/tosa.c
Expand Up @@ -263,6 +263,7 @@ static void tosapda_machine_init(MachineClass *mc)
{
mc->desc = "Sharp SL-6000 (Tosa) PDA (PXA255)";
mc->init = tosa_init;
mc->block_default_type = IF_IDE;
}

DEFINE_MACHINE("tosa", tosapda_machine_init)
Expand Down
1 change: 1 addition & 0 deletions hw/i386/pc.c
Expand Up @@ -2339,6 +2339,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
mc->query_hotpluggable_cpus = pc_query_hotpluggable_cpus;
mc->default_boot_order = "cad";
mc->hot_add_cpu = pc_hot_add_cpu;
mc->block_default_type = IF_IDE;
mc->max_cpus = 255;
mc->reset = pc_machine_reset;
hc->pre_plug = pc_machine_device_pre_plug_cb;
Expand Down
1 change: 1 addition & 0 deletions hw/mips/mips_fulong2e.c
Expand Up @@ -387,6 +387,7 @@ static void mips_fulong2e_machine_init(MachineClass *mc)
{
mc->desc = "Fulong 2e mini pc";
mc->init = mips_fulong2e_init;
mc->block_default_type = IF_IDE;
}

DEFINE_MACHINE("fulong2e", mips_fulong2e_machine_init)
1 change: 1 addition & 0 deletions hw/mips/mips_malta.c
Expand Up @@ -1264,6 +1264,7 @@ static void mips_malta_machine_init(MachineClass *mc)
{
mc->desc = "MIPS Malta Core LV";
mc->init = mips_malta_init;
mc->block_default_type = IF_IDE;
mc->max_cpus = 16;
mc->is_default = 1;
}
Expand Down
1 change: 1 addition & 0 deletions hw/mips/mips_r4k.c
Expand Up @@ -306,6 +306,7 @@ static void mips_machine_init(MachineClass *mc)
{
mc->desc = "mips r4k platform";
mc->init = mips_r4k_init;
mc->block_default_type = IF_IDE;
}

DEFINE_MACHINE("mips", mips_machine_init)
1 change: 1 addition & 0 deletions hw/ppc/mac_newworld.c
Expand Up @@ -518,6 +518,7 @@ static void core99_machine_class_init(ObjectClass *oc, void *data)

mc->desc = "Mac99 based PowerMAC";
mc->init = ppc_core99_init;
mc->block_default_type = IF_IDE;
mc->max_cpus = MAX_CPUS;
mc->default_boot_order = "cd";
mc->kvm_type = core99_kvm_type;
Expand Down
1 change: 1 addition & 0 deletions hw/ppc/mac_oldworld.c
Expand Up @@ -368,6 +368,7 @@ static void heathrow_machine_init(MachineClass *mc)
{
mc->desc = "Heathrow based PowerMAC";
mc->init = ppc_heathrow_init;
mc->block_default_type = IF_IDE;
mc->max_cpus = MAX_CPUS;
#ifndef TARGET_PPC64
mc->is_default = 1;
Expand Down
1 change: 1 addition & 0 deletions hw/ppc/prep.c
Expand Up @@ -684,6 +684,7 @@ static void prep_machine_init(MachineClass *mc)
{
mc->desc = "PowerPC PREP platform";
mc->init = ppc_prep_init;
mc->block_default_type = IF_IDE;
mc->max_cpus = MAX_CPUS;
mc->default_boot_order = "cad";
}
Expand Down
1 change: 1 addition & 0 deletions hw/sh4/r2d.c
Expand Up @@ -362,6 +362,7 @@ static void r2d_machine_init(MachineClass *mc)
{
mc->desc = "r2d-plus board";
mc->init = r2d_init;
mc->block_default_type = IF_IDE;
}

DEFINE_MACHINE("r2d", r2d_machine_init)
2 changes: 2 additions & 0 deletions hw/sparc64/sun4u.c
Expand Up @@ -579,6 +579,7 @@ static void sun4u_class_init(ObjectClass *oc, void *data)

mc->desc = "Sun4u platform";
mc->init = sun4u_init;
mc->block_default_type = IF_IDE;
mc->max_cpus = 1; /* XXX for now */
mc->is_default = 1;
mc->default_boot_order = "c";
Expand All @@ -596,6 +597,7 @@ static void sun4v_class_init(ObjectClass *oc, void *data)

mc->desc = "Sun4v platform";
mc->init = sun4v_init;
mc->block_default_type = IF_IDE;
mc->max_cpus = 1; /* XXX for now */
mc->default_boot_order = "c";
}
Expand Down

0 comments on commit 2059839

Please sign in to comment.