qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/1] Support default interface types per QEMUMachine


From: Christian Borntraeger
Subject: [Qemu-devel] [PATCH 1/1] Support default interface types per QEMUMachine
Date: Thu, 26 Apr 2012 17:23:00 +0200

From: Einar Lueck <address@hidden>

There are QEMUMachines that have neither IF_IDE nor IF_SCSI as a
default/standard interface to their block devices / drives. Therefore,
this patch introduces a new field def_blk_if per QEMUMachine struct.
The prior use_scsi field becomes thereby obsolete and is replaced through
.def_blk_if = IF_SCSI.

Signed-off-by: Einar Lueck <address@hidden>
Signed-off-by: Christian Borntraeger <address@hidden>
---
 blockdev.c                    |    4 ++--
 hw/alpha_dp264.c              |    1 +
 hw/an5206.c                   |    2 ++
 hw/axis_dev88.c               |    1 +
 hw/boards.h                   |    2 +-
 hw/collie.c                   |    1 +
 hw/device-hotplug.c           |    2 +-
 hw/dummy_m68k.c               |    2 ++
 hw/exynos4_boards.c           |    3 +++
 hw/gumstix.c                  |    2 ++
 hw/highbank.c                 |    2 +-
 hw/integratorcp.c             |    2 ++
 hw/leon3.c                    |    9 +++++----
 hw/lm32_boards.c              |    2 ++
 hw/mainstone.c                |    1 +
 hw/mcf5208.c                  |    2 ++
 hw/milkymist.c                |    1 +
 hw/mips_fulong2e.c            |    1 +
 hw/mips_jazz.c                |    4 ++--
 hw/mips_malta.c               |    1 +
 hw/mips_mipssim.c             |    1 +
 hw/mips_r4k.c                 |    1 +
 hw/musicpal.c                 |    1 +
 hw/nseries.c                  |    2 ++
 hw/omap_sx1.c                 |    2 ++
 hw/palm.c                     |    2 ++
 hw/pc_piix.c                  |   10 ++++++++++
 hw/pc_sysfw.c                 |    2 +-
 hw/petalogix_ml605_mmu.c      |    1 +
 hw/petalogix_s3adsp1800_mmu.c |    1 +
 hw/ppc405_boards.c            |    1 +
 hw/ppc440_bamboo.c            |    1 +
 hw/ppc_newworld.c             |    1 +
 hw/ppc_oldworld.c             |    1 +
 hw/ppc_prep.c                 |    1 +
 hw/ppce500_mpc8544ds.c        |    1 +
 hw/r2d.c                      |    1 +
 hw/realview.c                 |    7 ++++---
 hw/s390-virtio.c              |   16 +---------------
 hw/shix.c                     |    2 ++
 hw/spapr.c                    |    2 +-
 hw/spitz.c                    |    4 ++++
 hw/stellaris.c                |    3 +++
 hw/sun4m.c                    |   24 ++++++++++++------------
 hw/sun4u.c                    |    3 +++
 hw/tosa.c                     |    1 +
 hw/versatilepb.c              |    4 ++--
 hw/vexpress.c                 |    5 +++--
 hw/virtex_ml507.c             |    1 +
 hw/xen_machine_pv.c           |    1 +
 hw/xilinx_zynq.c              |    2 +-
 hw/xtensa_lx60.c              |    2 ++
 hw/xtensa_sim.c               |    2 ++
 hw/z2.c                       |    1 +
 vl.c                          |   18 +++++++++---------
 55 files changed, 116 insertions(+), 57 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index 0c2440e..3d9ddae 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -274,7 +274,7 @@ static bool do_check_io_limits(BlockIOLimit *io_limits)
     return true;
 }
 
-DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
+DriveInfo *drive_init(QemuOpts *opts, int def_blk_if)
 {
     const char *buf;
     const char *file = NULL;
@@ -326,7 +326,7 @@ DriveInfo *drive_init(QemuOpts *opts, int default_to_scsi)
             return NULL;
        }
     } else {
-        type = default_to_scsi ? IF_SCSI : IF_IDE;
+        type = def_blk_if;
         pstrcpy(devname, sizeof(devname), if_name[type]);
     }
 
diff --git a/hw/alpha_dp264.c b/hw/alpha_dp264.c
index 9eb939f..4bd8f1a 100644
--- a/hw/alpha_dp264.c
+++ b/hw/alpha_dp264.c
@@ -168,6 +168,7 @@ static QEMUMachine clipper_machine = {
     .name = "clipper",
     .desc = "Alpha DP264/CLIPPER",
     .init = clipper_init,
+    .def_blk_if = IF_IDE,
     .max_cpus = 4,
     .is_default = 1,
 };
diff --git a/hw/an5206.c b/hw/an5206.c
index 25407c0..e36d587 100644
--- a/hw/an5206.c
+++ b/hw/an5206.c
@@ -12,6 +12,7 @@
 #include "loader.h"
 #include "elf.h"
 #include "exec-memory.h"
+#include "blockdev.h"
 
 #define KERNEL_LOAD_ADDR 0x10000
 #define AN5206_MBAR_ADDR 0x10000000
@@ -86,6 +87,7 @@ static QEMUMachine an5206_machine = {
     .name = "an5206",
     .desc = "Arnewsh 5206",
     .init = an5206_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void an5206_machine_init(void)
diff --git a/hw/axis_dev88.c b/hw/axis_dev88.c
index 2304e35..aa240f7 100644
--- a/hw/axis_dev88.c
+++ b/hw/axis_dev88.c
@@ -351,6 +351,7 @@ static QEMUMachine axisdev88_machine = {
     .name = "axis-dev88",
     .desc = "AXIS devboard 88",
     .init = axisdev88_init,
+    .def_blk_if = IF_IDE,
     .is_default = 1,
 };
 
diff --git a/hw/boards.h b/hw/boards.h
index 667177d..f652eaf 100644
--- a/hw/boards.h
+++ b/hw/boards.h
@@ -17,7 +17,7 @@ typedef struct QEMUMachine {
     const char *alias;
     const char *desc;
     QEMUMachineInitFunc *init;
-    int use_scsi;
+    int def_blk_if;
     int max_cpus;
     unsigned int no_serial:1,
         no_parallel:1,
diff --git a/hw/collie.c b/hw/collie.c
index 42f4310..56b00af 100644
--- a/hw/collie.c
+++ b/hw/collie.c
@@ -61,6 +61,7 @@ static QEMUMachine collie_machine = {
     .name = "collie",
     .desc = "Collie PDA (SA-1110)",
     .init = collie_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void collie_machine_init(void)
diff --git a/hw/device-hotplug.c b/hw/device-hotplug.c
index 2bdc615..fc5cead 100644
--- a/hw/device-hotplug.c
+++ b/hw/device-hotplug.c
@@ -39,7 +39,7 @@ DriveInfo *add_init_drive(const char *optstr)
     if (!opts)
         return NULL;
 
-    dinfo = drive_init(opts, current_machine->use_scsi);
+    dinfo = drive_init(opts, current_machine->def_blk_if);
     if (!dinfo) {
         qemu_opts_del(opts);
         return NULL;
diff --git a/hw/dummy_m68k.c b/hw/dummy_m68k.c
index 7cc7a99..23ef556 100644
--- a/hw/dummy_m68k.c
+++ b/hw/dummy_m68k.c
@@ -11,6 +11,7 @@
 #include "loader.h"
 #include "elf.h"
 #include "exec-memory.h"
+#include "blockdev.h"
 
 #define KERNEL_LOAD_ADDR 0x10000
 
@@ -73,6 +74,7 @@ static QEMUMachine dummy_m68k_machine = {
     .name = "dummy",
     .desc = "Dummy board",
     .init = dummy_m68k_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void dummy_m68k_machine_init(void)
diff --git a/hw/exynos4_boards.c b/hw/exynos4_boards.c
index ea32c51..abf4096 100644
--- a/hw/exynos4_boards.c
+++ b/hw/exynos4_boards.c
@@ -28,6 +28,7 @@
 #include "exec-memory.h"
 #include "exynos4210.h"
 #include "boards.h"
+#include "blockdev.h"
 
 #undef DEBUG
 
@@ -159,12 +160,14 @@ static QEMUMachine 
exynos4_machines[EXYNOS4_NUM_OF_BOARDS] = {
         .name = "nuri",
         .desc = "Samsung NURI board (Exynos4210)",
         .init = nuri_init,
+        .def_blk_if = IF_IDE,
         .max_cpus = EXYNOS4210_NCPUS,
     },
     [EXYNOS4_BOARD_SMDKC210] = {
         .name = "smdkc210",
         .desc = "Samsung SMDKC210 board (Exynos4210)",
         .init = smdkc210_init,
+        .def_blk_if = IF_IDE,
         .max_cpus = EXYNOS4210_NCPUS,
     },
 };
diff --git a/hw/gumstix.c b/hw/gumstix.c
index 13a36ea..e271d23 100644
--- a/hw/gumstix.c
+++ b/hw/gumstix.c
@@ -127,12 +127,14 @@ static QEMUMachine connex_machine = {
     .name = "connex",
     .desc = "Gumstix Connex (PXA255)",
     .init = connex_init,
+    .def_blk_if = IF_IDE,
 };
 
 static QEMUMachine verdex_machine = {
     .name = "verdex",
     .desc = "Gumstix Verdex (PXA270)",
     .init = verdex_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void gumstix_machine_init(void)
diff --git a/hw/highbank.c b/hw/highbank.c
index 906eed5..95443a6 100644
--- a/hw/highbank.c
+++ b/hw/highbank.c
@@ -326,7 +326,7 @@ static QEMUMachine highbank_machine = {
     .name = "highbank",
     .desc = "Calxeda Highbank (ECX-1000)",
     .init = highbank_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
     .max_cpus = 4,
 };
 
diff --git a/hw/integratorcp.c b/hw/integratorcp.c
index 9bdb9e6..03d234e 100644
--- a/hw/integratorcp.c
+++ b/hw/integratorcp.c
@@ -14,6 +14,7 @@
 #include "net.h"
 #include "exec-memory.h"
 #include "sysemu.h"
+#include "blockdev.h"
 
 typedef struct {
     SysBusDevice busdev;
@@ -507,6 +508,7 @@ static QEMUMachine integratorcp_machine = {
     .name = "integratorcp",
     .desc = "ARM Integrator/CP (ARM926EJ-S)",
     .init = integratorcp_init,
+    .def_blk_if = IF_IDE,
     .is_default = 1,
 };
 
diff --git a/hw/leon3.c b/hw/leon3.c
index 0a5ff16..0df6f4f 100644
--- a/hw/leon3.c
+++ b/hw/leon3.c
@@ -31,6 +31,7 @@
 #include "elf.h"
 #include "trace.h"
 #include "exec-memory.h"
+#include "blockdev.h"
 
 #include "grlib.h"
 
@@ -209,10 +210,10 @@ static void leon3_generic_hw_init(ram_addr_t  ram_size,
 }
 
 QEMUMachine leon3_generic_machine = {
-    .name     = "leon3_generic",
-    .desc     = "Leon-3 generic",
-    .init     = leon3_generic_hw_init,
-    .use_scsi = 0,
+    .name       = "leon3_generic",
+    .desc       = "Leon-3 generic",
+    .init       = leon3_generic_hw_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void leon3_machine_init(void)
diff --git a/hw/lm32_boards.c b/hw/lm32_boards.c
index 4dd4f0a..a837c34 100644
--- a/hw/lm32_boards.c
+++ b/hw/lm32_boards.c
@@ -286,6 +286,7 @@ static QEMUMachine lm32_evr_machine = {
     .name = "lm32-evr",
     .desc = "LatticeMico32 EVR32 eval system",
     .init = lm32_evr_init,
+    .def_blk_if = IF_IDE,
     .is_default = 1
 };
 
@@ -293,6 +294,7 @@ static QEMUMachine lm32_uclinux_machine = {
     .name = "lm32-uclinux",
     .desc = "lm32 platform for uClinux and u-boot by Theobroma Systems",
     .init = lm32_uclinux_init,
+    .def_blk_if = IF_IDE,
     .is_default = 0
 };
 
diff --git a/hw/mainstone.c b/hw/mainstone.c
index 27f5900..c44d847 100644
--- a/hw/mainstone.c
+++ b/hw/mainstone.c
@@ -184,6 +184,7 @@ static QEMUMachine mainstone2_machine = {
     .name = "mainstone",
     .desc = "Mainstone II (PXA27x)",
     .init = mainstone_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void mainstone_machine_init(void)
diff --git a/hw/mcf5208.c b/hw/mcf5208.c
index d3ebe8d..7881300 100644
--- a/hw/mcf5208.c
+++ b/hw/mcf5208.c
@@ -15,6 +15,7 @@
 #include "loader.h"
 #include "elf.h"
 #include "exec-memory.h"
+#include "blockdev.h"
 
 #define SYS_FREQ 66000000
 
@@ -291,6 +292,7 @@ static QEMUMachine mcf5208evb_machine = {
     .name = "mcf5208evb",
     .desc = "MCF5206EVB",
     .init = mcf5208evb_init,
+    .def_blk_if = IF_IDE,
     .is_default = 1,
 };
 
diff --git a/hw/milkymist.c b/hw/milkymist.c
index 8bb6a97..889dedf 100644
--- a/hw/milkymist.c
+++ b/hw/milkymist.c
@@ -205,6 +205,7 @@ static QEMUMachine milkymist_machine = {
     .name = "milkymist",
     .desc = "Milkymist One",
     .init = milkymist_init,
+    .def_blk_if = IF_IDE,
     .is_default = 0
 };
 
diff --git a/hw/mips_fulong2e.c b/hw/mips_fulong2e.c
index 37dc711..b594254 100644
--- a/hw/mips_fulong2e.c
+++ b/hw/mips_fulong2e.c
@@ -394,6 +394,7 @@ QEMUMachine mips_fulong2e_machine = {
     .name = "fulong2e",
     .desc = "Fulong 2e mini pc",
     .init = mips_fulong2e_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void mips_fulong2e_machine_init(void)
diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c
index a6bc7ba..c7781bd 100644
--- a/hw/mips_jazz.c
+++ b/hw/mips_jazz.c
@@ -322,14 +322,14 @@ static QEMUMachine mips_magnum_machine = {
     .name = "magnum",
     .desc = "MIPS Magnum",
     .init = mips_magnum_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
 };
 
 static QEMUMachine mips_pica61_machine = {
     .name = "pica61",
     .desc = "Acer Pica 61",
     .init = mips_pica61_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
 };
 
 static void mips_jazz_machine_init(void)
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index 4752bb2..5918846 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -1013,6 +1013,7 @@ static QEMUMachine mips_malta_machine = {
     .name = "malta",
     .desc = "MIPS Malta Core LV",
     .init = mips_malta_init,
+    .def_blk_if = IF_IDE,
     .max_cpus = 16,
     .is_default = 1,
 };
diff --git a/hw/mips_mipssim.c b/hw/mips_mipssim.c
index 1ea7b58..207f634 100644
--- a/hw/mips_mipssim.c
+++ b/hw/mips_mipssim.c
@@ -223,6 +223,7 @@ static QEMUMachine mips_mipssim_machine = {
     .name = "mipssim",
     .desc = "MIPS MIPSsim platform",
     .init = mips_mipssim_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void mips_mipssim_machine_init(void)
diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c
index e2da49c..c36ff0c 100644
--- a/hw/mips_r4k.c
+++ b/hw/mips_r4k.c
@@ -296,6 +296,7 @@ static QEMUMachine mips_machine = {
     .name = "mips",
     .desc = "mips r4k platform",
     .init = mips_r4k_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void mips_machine_init(void)
diff --git a/hw/musicpal.c b/hw/musicpal.c
index c9f845a..33a5a17 100644
--- a/hw/musicpal.c
+++ b/hw/musicpal.c
@@ -1658,6 +1658,7 @@ static QEMUMachine musicpal_machine = {
     .name = "musicpal",
     .desc = "Marvell 88w8618 / MusicPal (ARM926EJ-S)",
     .init = musicpal_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void musicpal_machine_init(void)
diff --git a/hw/nseries.c b/hw/nseries.c
index a5cfa8c..810d00b 100644
--- a/hw/nseries.c
+++ b/hw/nseries.c
@@ -1408,12 +1408,14 @@ static QEMUMachine n800_machine = {
     .name = "n800",
     .desc = "Nokia N800 tablet aka. RX-34 (OMAP2420)",
     .init = n800_init,
+    .def_blk_if = IF_IDE,
 };
 
 static QEMUMachine n810_machine = {
     .name = "n810",
     .desc = "Nokia N810 tablet aka. RX-44 (OMAP2420)",
     .init = n810_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void nseries_machine_init(void)
diff --git a/hw/omap_sx1.c b/hw/omap_sx1.c
index 4e8ec4a..24821ee 100644
--- a/hw/omap_sx1.c
+++ b/hw/omap_sx1.c
@@ -231,12 +231,14 @@ static QEMUMachine sx1_machine_v2 = {
     .name = "sx1",
     .desc = "Siemens SX1 (OMAP310) V2",
     .init = sx1_init_v2,
+    .def_blk_if = IF_IDE,
 };
 
 static QEMUMachine sx1_machine_v1 = {
     .name = "sx1-v1",
     .desc = "Siemens SX1 (OMAP310) V1",
     .init = sx1_init_v1,
+    .def_blk_if = IF_IDE,
 };
 
 static void sx1_machine_init(void)
diff --git a/hw/palm.c b/hw/palm.c
index b1252ab..3a9d5e9 100644
--- a/hw/palm.c
+++ b/hw/palm.c
@@ -26,6 +26,7 @@
 #include "devices.h"
 #include "loader.h"
 #include "exec-memory.h"
+#include "blockdev.h"
 
 static uint32_t static_readb(void *opaque, target_phys_addr_t offset)
 {
@@ -279,6 +280,7 @@ static QEMUMachine palmte_machine = {
     .name = "cheetah",
     .desc = "Palm Tungsten|E aka. Cheetah PDA (OMAP310)",
     .init = palmte_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void palmte_machine_init(void)
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 6a75718..7a3252f 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -356,6 +356,7 @@ static QEMUMachine pc_machine_v1_1 = {
     .alias = "pc",
     .desc = "Standard PC",
     .init = pc_init_pci,
+    .def_blk_if = IF_IDE,
     .max_cpus = 255,
     .is_default = 1,
 };
@@ -387,6 +388,7 @@ static QEMUMachine pc_machine_v1_0 = {
     .name = "pc-1.0",
     .desc = "Standard PC",
     .init = pc_init_pci,
+    .def_blk_if = IF_IDE,
     .max_cpus = 255,
     .compat_props = (GlobalProperty[]) {
         PC_COMPAT_1_0,
@@ -401,6 +403,7 @@ static QEMUMachine pc_machine_v0_15 = {
     .name = "pc-0.15",
     .desc = "Standard PC",
     .init = pc_init_pci,
+    .def_blk_if = IF_IDE,
     .max_cpus = 255,
     .compat_props = (GlobalProperty[]) {
         PC_COMPAT_0_15,
@@ -432,6 +435,7 @@ static QEMUMachine pc_machine_v0_14 = {
     .name = "pc-0.14",
     .desc = "Standard PC",
     .init = pc_init_pci,
+    .def_blk_if = IF_IDE,
     .max_cpus = 255,
     .compat_props = (GlobalProperty[]) {
         PC_COMPAT_0_14, 
@@ -464,6 +468,7 @@ static QEMUMachine pc_machine_v0_13 = {
     .name = "pc-0.13",
     .desc = "Standard PC",
     .init = pc_init_pci_no_kvmclock,
+    .def_blk_if = IF_IDE,
     .max_cpus = 255,
     .compat_props = (GlobalProperty[]) {
         PC_COMPAT_0_13,
@@ -500,6 +505,7 @@ static QEMUMachine pc_machine_v0_12 = {
     .name = "pc-0.12",
     .desc = "Standard PC",
     .init = pc_init_pci_no_kvmclock,
+    .def_blk_if = IF_IDE,
     .max_cpus = 255,
     .compat_props = (GlobalProperty[]) {
         PC_COMPAT_0_12,
@@ -528,6 +534,7 @@ static QEMUMachine pc_machine_v0_11 = {
     .name = "pc-0.11",
     .desc = "Standard PC, qemu 0.11",
     .init = pc_init_pci_no_kvmclock,
+    .def_blk_if = IF_IDE,
     .max_cpus = 255,
     .compat_props = (GlobalProperty[]) {
         PC_COMPAT_0_11,
@@ -548,6 +555,7 @@ static QEMUMachine pc_machine_v0_10 = {
     .name = "pc-0.10",
     .desc = "Standard PC, qemu 0.10",
     .init = pc_init_pci_no_kvmclock,
+    .def_blk_if = IF_IDE,
     .max_cpus = 255,
     .compat_props = (GlobalProperty[]) {
         PC_COMPAT_0_11,
@@ -580,6 +588,7 @@ static QEMUMachine isapc_machine = {
     .name = "isapc",
     .desc = "ISA-only PC",
     .init = pc_init_isa,
+    .def_blk_if = IF_IDE,
     .max_cpus = 1,
     .compat_props = (GlobalProperty[]) {
         {
@@ -596,6 +605,7 @@ static QEMUMachine xenfv_machine = {
     .name = "xenfv",
     .desc = "Xen Fully-virtualized PC",
     .init = pc_xen_hvm_init,
+    .def_blk_if = IF_IDE,
     .max_cpus = HVM_MAX_VCPUS,
     .default_machine_opts = "accel=xen",
 };
diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c
index abf9004..56b5bbb 100644
--- a/hw/pc_sysfw.c
+++ b/hw/pc_sysfw.c
@@ -94,7 +94,7 @@ static void pc_fw_add_pflash_drv(void)
       return;
     }
 
-    drive_init(opts, machine->use_scsi);
+    drive_init(opts, machine->def_blk_if);
 }
 
 static void pc_system_flash_init(MemoryRegion *rom_memory,
diff --git a/hw/petalogix_ml605_mmu.c b/hw/petalogix_ml605_mmu.c
index 31a4348..d4d962e 100644
--- a/hw/petalogix_ml605_mmu.c
+++ b/hw/petalogix_ml605_mmu.c
@@ -140,6 +140,7 @@ static QEMUMachine petalogix_ml605_machine = {
     .name = "petalogix-ml605",
     .desc = "PetaLogix linux refdesign for xilinx ml605 little endian",
     .init = petalogix_ml605_init,
+    .def_blk_if = IF_IDE,
     .is_default = 0
 };
 
diff --git a/hw/petalogix_s3adsp1800_mmu.c b/hw/petalogix_s3adsp1800_mmu.c
index 8b37336..6117aa5 100644
--- a/hw/petalogix_s3adsp1800_mmu.c
+++ b/hw/petalogix_s3adsp1800_mmu.c
@@ -113,6 +113,7 @@ static QEMUMachine petalogix_s3adsp1800_machine = {
     .name = "petalogix-s3adsp1800",
     .desc = "PetaLogix linux refdesign for xilinx Spartan 3ADSP1800",
     .init = petalogix_s3adsp1800_init,
+    .def_blk_if = IF_IDE,
     .is_default = 1
 };
 
diff --git a/hw/ppc405_boards.c b/hw/ppc405_boards.c
index 476775d..ffba65d 100644
--- a/hw/ppc405_boards.c
+++ b/hw/ppc405_boards.c
@@ -363,6 +363,7 @@ static QEMUMachine ref405ep_machine = {
     .name = "ref405ep",
     .desc = "ref405ep",
     .init = ref405ep_init,
+    .def_blk_if = IF_IDE,
 };
 
 /*****************************************************************************/
diff --git a/hw/ppc440_bamboo.c b/hw/ppc440_bamboo.c
index f0a3ae4..52081fd 100644
--- a/hw/ppc440_bamboo.c
+++ b/hw/ppc440_bamboo.c
@@ -291,6 +291,7 @@ static QEMUMachine bamboo_machine = {
     .name = "bamboo",
     .desc = "bamboo",
     .init = bamboo_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void bamboo_machine_init(void)
diff --git a/hw/ppc_newworld.c b/hw/ppc_newworld.c
index 8796510..e2fa0c2 100644
--- a/hw/ppc_newworld.c
+++ b/hw/ppc_newworld.c
@@ -420,6 +420,7 @@ static QEMUMachine core99_machine = {
     .desc = "Mac99 based PowerMAC",
     .init = ppc_core99_init,
     .max_cpus = MAX_CPUS,
+    .def_blk_if = IF_IDE,
 #ifdef TARGET_PPC64
     .is_default = 1,
 #endif
diff --git a/hw/ppc_oldworld.c b/hw/ppc_oldworld.c
index 7e73d37..ce86280 100644
--- a/hw/ppc_oldworld.c
+++ b/hw/ppc_oldworld.c
@@ -334,6 +334,7 @@ static QEMUMachine heathrow_machine = {
     .name = "g3beige",
     .desc = "Heathrow based PowerMAC",
     .init = ppc_heathrow_init,
+    .def_blk_if = IF_IDE,
     .max_cpus = MAX_CPUS,
 #ifndef TARGET_PPC64
     .is_default = 1,
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 9d8e659..4af7a4d 100644
--- a/hw/ppc_prep.c
+++ b/hw/ppc_prep.c
@@ -722,6 +722,7 @@ static QEMUMachine prep_machine = {
     .name = "prep",
     .desc = "PowerPC PREP platform",
     .init = ppc_prep_init,
+    .def_blk_if = IF_IDE,
     .max_cpus = MAX_CPUS,
 };
 
diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c
index f1dfbe1..f2e5304 100644
--- a/hw/ppce500_mpc8544ds.c
+++ b/hw/ppce500_mpc8544ds.c
@@ -399,6 +399,7 @@ static QEMUMachine mpc8544ds_machine = {
     .name = "mpc8544ds",
     .desc = "mpc8544ds",
     .init = mpc8544ds_init,
+    .def_blk_if = IF_IDE,
     .max_cpus = 15,
 };
 
diff --git a/hw/r2d.c b/hw/r2d.c
index c55de01..52bcfd8 100644
--- a/hw/r2d.c
+++ b/hw/r2d.c
@@ -340,6 +340,7 @@ static QEMUMachine r2d_machine = {
     .name = "r2d",
     .desc = "r2d-plus board",
     .init = r2d_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void r2d_machine_init(void)
diff --git a/hw/realview.c b/hw/realview.c
index ecf4701..0e46143 100644
--- a/hw/realview.c
+++ b/hw/realview.c
@@ -380,14 +380,14 @@ static QEMUMachine realview_eb_machine = {
     .name = "realview-eb",
     .desc = "ARM RealView Emulation Baseboard (ARM926EJ-S)",
     .init = realview_eb_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
 };
 
 static QEMUMachine realview_eb_mpcore_machine = {
     .name = "realview-eb-mpcore",
     .desc = "ARM RealView Emulation Baseboard (ARM11MPCore)",
     .init = realview_eb_mpcore_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
     .max_cpus = 4,
 };
 
@@ -395,13 +395,14 @@ static QEMUMachine realview_pb_a8_machine = {
     .name = "realview-pb-a8",
     .desc = "ARM RealView Platform Baseboard for Cortex-A8",
     .init = realview_pb_a8_init,
+    .def_blk_if = IF_SCSI,
 };
 
 static QEMUMachine realview_pbx_a9_machine = {
     .name = "realview-pbx-a9",
     .desc = "ARM RealView Platform Baseboard Explore for Cortex-A9",
     .init = realview_pbx_a9_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
     .max_cpus = 4,
 };
 
diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
index 1ebe70d..b87f2eb 100644
--- a/hw/s390-virtio.c
+++ b/hw/s390-virtio.c
@@ -298,21 +298,6 @@ static void s390_init(ram_addr_t my_ram_size,
         qdev_set_nic_properties(dev, nd);
         qdev_init_nofail(dev);
     }
-
-    /* Create VirtIO disk drives */
-    for(i = 0; i < MAX_BLK_DEVS; i++) {
-        DriveInfo *dinfo;
-        DeviceState *dev;
-
-        dinfo = drive_get(IF_IDE, 0, i);
-        if (!dinfo) {
-            continue;
-        }
-
-        dev = qdev_create((BusState *)s390_bus, "virtio-blk-s390");
-        qdev_prop_set_drive_nofail(dev, "drive", dinfo->bdrv);
-        qdev_init_nofail(dev);
-    }
 }
 
 static QEMUMachine s390_machine = {
@@ -320,6 +305,7 @@ static QEMUMachine s390_machine = {
     .alias = "s390",
     .desc = "VirtIO based S390 machine",
     .init = s390_init,
+    .def_blk_if = IF_VIRTIO,
     .no_serial = 1,
     .no_parallel = 1,
     .use_virtcon = 1,
diff --git a/hw/shix.c b/hw/shix.c
index dd9ce17..10cc5a9 100644
--- a/hw/shix.c
+++ b/hw/shix.c
@@ -33,6 +33,7 @@
 #include "boards.h"
 #include "loader.h"
 #include "exec-memory.h"
+#include "blockdev.h"
 
 #define BIOS_FILENAME "shix_bios.bin"
 #define BIOS_ADDRESS 0xA0000000
@@ -93,6 +94,7 @@ static QEMUMachine shix_machine = {
     .name = "shix",
     .desc = "shix card",
     .init = shix_init,
+    .def_blk_if = IF_IDE,
     .is_default = 1,
 };
 
diff --git a/hw/spapr.c b/hw/spapr.c
index bfaf260..3510372 100644
--- a/hw/spapr.c
+++ b/hw/spapr.c
@@ -747,9 +747,9 @@ static QEMUMachine spapr_machine = {
     .name = "pseries",
     .desc = "pSeries Logical Partition (PAPR compliant)",
     .init = ppc_spapr_init,
+    .def_blk_if = IF_SCSI,
     .max_cpus = MAX_CPUS,
     .no_parallel = 1,
-    .use_scsi = 1,
 };
 
 static void spapr_machine_init(void)
diff --git a/hw/spitz.c b/hw/spitz.c
index 1d6d2b0..74827ca 100644
--- a/hw/spitz.c
+++ b/hw/spitz.c
@@ -976,24 +976,28 @@ static QEMUMachine akitapda_machine = {
     .name = "akita",
     .desc = "Akita PDA (PXA270)",
     .init = akita_init,
+    .def_blk_if = IF_IDE,
 };
 
 static QEMUMachine spitzpda_machine = {
     .name = "spitz",
     .desc = "Spitz PDA (PXA270)",
     .init = spitz_init,
+    .def_blk_if = IF_IDE,
 };
 
 static QEMUMachine borzoipda_machine = {
     .name = "borzoi",
     .desc = "Borzoi PDA (PXA270)",
     .init = borzoi_init,
+    .def_blk_if = IF_IDE,
 };
 
 static QEMUMachine terrierpda_machine = {
     .name = "terrier",
     .desc = "Terrier PDA (PXA270)",
     .init = terrier_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void spitz_machine_init(void)
diff --git a/hw/stellaris.c b/hw/stellaris.c
index 562fbbf..98b0d0d 100644
--- a/hw/stellaris.c
+++ b/hw/stellaris.c
@@ -16,6 +16,7 @@
 #include "net.h"
 #include "boards.h"
 #include "exec-memory.h"
+#include "blockdev.h"
 
 #define GPIO_A 0
 #define GPIO_B 1
@@ -1378,12 +1379,14 @@ static QEMUMachine lm3s811evb_machine = {
     .name = "lm3s811evb",
     .desc = "Stellaris LM3S811EVB",
     .init = lm3s811evb_init,
+    .def_blk_if = IF_IDE,
 };
 
 static QEMUMachine lm3s6965evb_machine = {
     .name = "lm3s6965evb",
     .desc = "Stellaris LM3S6965EVB",
     .init = lm3s6965evb_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void stellaris_machine_init(void)
diff --git a/hw/sun4m.c b/hw/sun4m.c
index 34088ad..99b7443 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -1375,7 +1375,7 @@ static QEMUMachine ss5_machine = {
     .name = "SS-5",
     .desc = "Sun4m platform, SPARCstation 5",
     .init = ss5_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
     .is_default = 1,
 };
 
@@ -1383,7 +1383,7 @@ static QEMUMachine ss10_machine = {
     .name = "SS-10",
     .desc = "Sun4m platform, SPARCstation 10",
     .init = ss10_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
     .max_cpus = 4,
 };
 
@@ -1391,7 +1391,7 @@ static QEMUMachine ss600mp_machine = {
     .name = "SS-600MP",
     .desc = "Sun4m platform, SPARCserver 600MP",
     .init = ss600mp_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
     .max_cpus = 4,
 };
 
@@ -1399,7 +1399,7 @@ static QEMUMachine ss20_machine = {
     .name = "SS-20",
     .desc = "Sun4m platform, SPARCstation 20",
     .init = ss20_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
     .max_cpus = 4,
 };
 
@@ -1407,35 +1407,35 @@ static QEMUMachine voyager_machine = {
     .name = "Voyager",
     .desc = "Sun4m platform, SPARCstation Voyager",
     .init = vger_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
 };
 
 static QEMUMachine ss_lx_machine = {
     .name = "LX",
     .desc = "Sun4m platform, SPARCstation LX",
     .init = ss_lx_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
 };
 
 static QEMUMachine ss4_machine = {
     .name = "SS-4",
     .desc = "Sun4m platform, SPARCstation 4",
     .init = ss4_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
 };
 
 static QEMUMachine scls_machine = {
     .name = "SPARCClassic",
     .desc = "Sun4m platform, SPARCClassic",
     .init = scls_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
 };
 
 static QEMUMachine sbook_machine = {
     .name = "SPARCbook",
     .desc = "Sun4m platform, SPARCbook",
     .init = sbook_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
 };
 
 static const struct sun4d_hwdef sun4d_hwdefs[] = {
@@ -1652,7 +1652,7 @@ static QEMUMachine ss1000_machine = {
     .name = "SS-1000",
     .desc = "Sun4d platform, SPARCserver 1000",
     .init = ss1000_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
     .max_cpus = 8,
 };
 
@@ -1660,7 +1660,7 @@ static QEMUMachine ss2000_machine = {
     .name = "SS-2000",
     .desc = "Sun4d platform, SPARCcenter 2000",
     .init = ss2000_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
     .max_cpus = 20,
 };
 
@@ -1834,7 +1834,7 @@ static QEMUMachine ss2_machine = {
     .name = "SS-2",
     .desc = "Sun4c platform, SPARCstation 2",
     .init = ss2_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
 };
 
 static void sun4m_register_types(void)
diff --git a/hw/sun4u.c b/hw/sun4u.c
index fe33138..dc6980e 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -947,6 +947,7 @@ static QEMUMachine sun4u_machine = {
     .name = "sun4u",
     .desc = "Sun4u platform",
     .init = sun4u_init,
+    .def_blk_if = IF_IDE,
     .max_cpus = 1, // XXX for now
     .is_default = 1,
 };
@@ -954,6 +955,7 @@ static QEMUMachine sun4u_machine = {
 static QEMUMachine sun4v_machine = {
     .name = "sun4v",
     .desc = "Sun4v platform",
+    .def_blk_if = IF_IDE,
     .init = sun4v_init,
     .max_cpus = 1, // XXX for now
 };
@@ -962,6 +964,7 @@ static QEMUMachine niagara_machine = {
     .name = "Niagara",
     .desc = "Sun4v platform, Niagara",
     .init = niagara_init,
+    .def_blk_if = IF_IDE,
     .max_cpus = 1, // XXX for now
 };
 
diff --git a/hw/tosa.c b/hw/tosa.c
index 6baa17d..9b3c789 100644
--- a/hw/tosa.c
+++ b/hw/tosa.c
@@ -250,6 +250,7 @@ static QEMUMachine tosapda_machine = {
     .name = "tosa",
     .desc = "Tosa PDA (PXA255)",
     .init = tosa_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void tosapda_machine_init(void)
diff --git a/hw/versatilepb.c b/hw/versatilepb.c
index 7c79c54..76c9015 100644
--- a/hw/versatilepb.c
+++ b/hw/versatilepb.c
@@ -367,14 +367,14 @@ static QEMUMachine versatilepb_machine = {
     .name = "versatilepb",
     .desc = "ARM Versatile/PB (ARM926EJ-S)",
     .init = vpb_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
 };
 
 static QEMUMachine versatileab_machine = {
     .name = "versatileab",
     .desc = "ARM Versatile/AB (ARM926EJ-S)",
     .init = vab_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
 };
 
 static void versatile_machine_init(void)
diff --git a/hw/vexpress.c b/hw/vexpress.c
index 18d87ac..162331d 100644
--- a/hw/vexpress.c
+++ b/hw/vexpress.c
@@ -29,6 +29,7 @@
 #include "sysemu.h"
 #include "boards.h"
 #include "exec-memory.h"
+#include "blockdev.h"
 
 #define VEXPRESS_BOARD_ID 0x8e0
 
@@ -469,7 +470,7 @@ static QEMUMachine vexpress_a9_machine = {
     .name = "vexpress-a9",
     .desc = "ARM Versatile Express for Cortex-A9",
     .init = vexpress_a9_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
     .max_cpus = 4,
 };
 
@@ -477,7 +478,7 @@ static QEMUMachine vexpress_a15_machine = {
     .name = "vexpress-a15",
     .desc = "ARM Versatile Express for Cortex-A15",
     .init = vexpress_a15_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
     .max_cpus = 4,
 };
 
diff --git a/hw/virtex_ml507.c b/hw/virtex_ml507.c
index 4a133b5..fea3176 100644
--- a/hw/virtex_ml507.c
+++ b/hw/virtex_ml507.c
@@ -259,6 +259,7 @@ static QEMUMachine virtex_machine = {
     .name = "virtex-ml507",
     .desc = "Xilinx Virtex ML507 reference design",
     .init = virtex_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void virtex_machine_init(void)
diff --git a/hw/xen_machine_pv.c b/hw/xen_machine_pv.c
index 7eee770..e86156e 100644
--- a/hw/xen_machine_pv.c
+++ b/hw/xen_machine_pv.c
@@ -112,6 +112,7 @@ static QEMUMachine xenpv_machine = {
     .name = "xenpv",
     .desc = "Xen Para-virtualized PC",
     .init = xen_init_pv,
+    .def_blk_if = IF_IDE,
     .max_cpus = 1,
     .default_machine_opts = "accel=xen",
 };
diff --git a/hw/xilinx_zynq.c b/hw/xilinx_zynq.c
index 7290c64..641473d 100644
--- a/hw/xilinx_zynq.c
+++ b/hw/xilinx_zynq.c
@@ -144,7 +144,7 @@ static QEMUMachine zynq_machine = {
     .name = "xilinx-zynq-a9",
     .desc = "Xilinx Zynq Platform Baseboard for Cortex-A9",
     .init = zynq_init,
-    .use_scsi = 1,
+    .def_blk_if = IF_SCSI,
     .max_cpus = 1,
     .no_sdcard = 1
 };
diff --git a/hw/xtensa_lx60.c b/hw/xtensa_lx60.c
index afdef49..7eb7c56 100644
--- a/hw/xtensa_lx60.c
+++ b/hw/xtensa_lx60.c
@@ -298,6 +298,7 @@ static QEMUMachine xtensa_lx60_machine = {
     .name = "lx60",
     .desc = "lx60 EVB (dc232b)",
     .init = xtensa_lx60_init,
+    .def_blk_if = IF_IDE,
     .max_cpus = 4,
 };
 
@@ -305,6 +306,7 @@ static QEMUMachine xtensa_lx200_machine = {
     .name = "lx200",
     .desc = "lx200 EVB (dc232b)",
     .init = xtensa_lx200_init,
+    .def_blk_if = IF_IDE,
     .max_cpus = 4,
 };
 
diff --git a/hw/xtensa_sim.c b/hw/xtensa_sim.c
index c7e05dc..7e0a00a 100644
--- a/hw/xtensa_sim.c
+++ b/hw/xtensa_sim.c
@@ -26,6 +26,7 @@
  */
 
 #include "sysemu.h"
+#include "blockdev.h"
 #include "boards.h"
 #include "loader.h"
 #include "elf.h"
@@ -107,6 +108,7 @@ static QEMUMachine xtensa_sim_machine = {
     .name = "sim",
     .desc = "sim machine (dc232b)",
     .init = xtensa_sim_init,
+    .def_blk_if = IF_IDE,
     .max_cpus = 4,
 };
 
diff --git a/hw/z2.c b/hw/z2.c
index 654ac55..cc204d6 100644
--- a/hw/z2.c
+++ b/hw/z2.c
@@ -371,6 +371,7 @@ static QEMUMachine z2_machine = {
     .name = "z2",
     .desc = "Zipit Z2 (PXA27x)",
     .init = z2_init,
+    .def_blk_if = IF_IDE,
 };
 
 static void z2_machine_init(void)
diff --git a/vl.c b/vl.c
index ae91a8a..e724084 100644
--- a/vl.c
+++ b/vl.c
@@ -764,9 +764,9 @@ static int bt_parse(const char *opt)
 
 static int drive_init_func(QemuOpts *opts, void *opaque)
 {
-    int *use_scsi = opaque;
+    int *def_blk_if = opaque;
 
-    return drive_init(opts, *use_scsi) == NULL;
+    return drive_init(opts, *def_blk_if) == NULL;
 }
 
 static int drive_enable_snapshot(QemuOpts *opts, void *opaque)
@@ -777,14 +777,14 @@ static int drive_enable_snapshot(QemuOpts *opts, void 
*opaque)
     return 0;
 }
 
-static void default_drive(int enable, int snapshot, int use_scsi,
+static void default_drive(int enable, int snapshot, int def_blk_if,
                           BlockInterfaceType type, int index,
                           const char *optstr)
 {
     QemuOpts *opts;
 
     if (type == IF_DEFAULT) {
-        type = use_scsi ? IF_SCSI : IF_IDE;
+        type = def_blk_if;
     }
 
     if (!enable || drive_get_by_index(type, index)) {
@@ -795,7 +795,7 @@ static void default_drive(int enable, int snapshot, int 
use_scsi,
     if (snapshot) {
         drive_enable_snapshot(opts, NULL);
     }
-    if (!drive_init(opts, use_scsi)) {
+    if (!drive_init(opts, def_blk_if)) {
         exit(1);
     }
 }
@@ -3416,14 +3416,14 @@ int main(int argc, char **argv, char **envp)
     /* open the virtual block devices */
     if (snapshot)
         qemu_opts_foreach(qemu_find_opts("drive"), drive_enable_snapshot, 
NULL, 0);
-    if (qemu_opts_foreach(qemu_find_opts("drive"), drive_init_func, 
&machine->use_scsi, 1) != 0)
+    if (qemu_opts_foreach(qemu_find_opts("drive"), drive_init_func, 
&machine->def_blk_if, 1) != 0)
         exit(1);
 
-    default_drive(default_cdrom, snapshot, machine->use_scsi,
+    default_drive(default_cdrom, snapshot, machine->def_blk_if,
                   IF_DEFAULT, 2, CDROM_OPTS);
-    default_drive(default_floppy, snapshot, machine->use_scsi,
+    default_drive(default_floppy, snapshot, machine->def_blk_if,
                   IF_FLOPPY, 0, FD_OPTS);
-    default_drive(default_sdcard, snapshot, machine->use_scsi,
+    default_drive(default_sdcard, snapshot, machine->def_blk_if,
                   IF_SD, 0, SD_OPTS);
 
     register_savevm_live(NULL, "ram", 0, 4, NULL, ram_save_live, NULL,
-- 
1.7.9.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]