]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw: Make MachineClass::is_default a boolean type
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Fri, 7 Feb 2020 16:19:47 +0000 (17:19 +0100)
committerEduardo Habkost <ehabkost@redhat.com>
Fri, 28 Feb 2020 19:57:19 +0000 (14:57 -0500)
There's no good reason for it to be type int, change it to bool.

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200207161948.15972-3-philmd@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
20 files changed:
hw/alpha/dp264.c
hw/cris/axis_dev88.c
hw/hppa/machine.c
hw/i386/pc_piix.c
hw/lm32/lm32_boards.c
hw/m68k/mcf5208.c
hw/microblaze/petalogix_s3adsp1800_mmu.c
hw/mips/mips_malta.c
hw/moxie/moxiesim.c
hw/nios2/10m50_devboard.c
hw/openrisc/openrisc_sim.c
hw/ppc/mac_oldworld.c
hw/ppc/spapr.c
hw/riscv/spike.c
hw/s390x/s390-virtio-ccw.c
hw/sh4/shix.c
hw/sparc/sun4m.c
hw/sparc64/sun4u.c
hw/unicore32/puv3.c
include/hw/boards.h

index 8d71a306174d9314503761c38cfc13430a377c26..d28f57199fa13cd6eb58a3ad7a92f6554c8b3a82 100644 (file)
@@ -181,7 +181,7 @@ static void clipper_machine_init(MachineClass *mc)
     mc->init = clipper_init;
     mc->block_default_type = IF_IDE;
     mc->max_cpus = 4;
-    mc->is_default = 1;
+    mc->is_default = true;
     mc->default_cpu_type = ALPHA_CPU_TYPE_NAME("ev67");
     mc->default_ram_id = "ram";
 }
index cf6790fd6fcdab28f97e64d01099bb05d4e77551..75e5c993b5d4a7927c09e0ea4de00cc7d4483bb1 100644 (file)
@@ -344,7 +344,7 @@ static void axisdev88_machine_init(MachineClass *mc)
 {
     mc->desc = "AXIS devboard 88";
     mc->init = axisdev88_init;
-    mc->is_default = 1;
+    mc->is_default = true;
     mc->default_cpu_type = CRIS_CPU_TYPE_NAME("crisv32");
     mc->default_ram_id = "axisdev88.ram";
 }
index 67181e75bacc1c37d9c521f0de6452dd690b2f17..bf18767e2494cfde02a5f4f5996cfa6fa864150c 100644 (file)
@@ -290,7 +290,7 @@ static void machine_hppa_machine_init(MachineClass *mc)
     mc->block_default_type = IF_SCSI;
     mc->max_cpus = HPPA_MAX_CPUS;
     mc->default_cpus = 1;
-    mc->is_default = 1;
+    mc->is_default = true;
     mc->default_ram_size = 512 * MiB;
     mc->default_boot_order = "cd";
     mc->default_ram_id = "ram";
index fa122030793f37fd55bb00804d18c3a7064c3dae..9088db8fb601a47aca61b6acf8fbce2247967bef 100644 (file)
@@ -423,7 +423,7 @@ static void pc_i440fx_5_0_machine_options(MachineClass *m)
     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
     pc_i440fx_machine_options(m);
     m->alias = "pc";
-    m->is_default = 1;
+    m->is_default = true;
     pcmc->default_cpu_version = 1;
 }
 
@@ -434,7 +434,7 @@ static void pc_i440fx_4_2_machine_options(MachineClass *m)
 {
     pc_i440fx_5_0_machine_options(m);
     m->alias = NULL;
-    m->is_default = 0;
+    m->is_default = false;
     compat_props_add(m->compat_props, hw_compat_4_2, hw_compat_4_2_len);
     compat_props_add(m->compat_props, pc_compat_4_2, pc_compat_4_2_len);
 }
@@ -446,7 +446,7 @@ static void pc_i440fx_4_1_machine_options(MachineClass *m)
 {
     pc_i440fx_4_2_machine_options(m);
     m->alias = NULL;
-    m->is_default = 0;
+    m->is_default = false;
     compat_props_add(m->compat_props, hw_compat_4_1, hw_compat_4_1_len);
     compat_props_add(m->compat_props, pc_compat_4_1, pc_compat_4_1_len);
 }
@@ -459,7 +459,7 @@ static void pc_i440fx_4_0_machine_options(MachineClass *m)
     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
     pc_i440fx_4_1_machine_options(m);
     m->alias = NULL;
-    m->is_default = 0;
+    m->is_default = false;
     pcmc->default_cpu_version = CPU_VERSION_LEGACY;
     compat_props_add(m->compat_props, hw_compat_4_0, hw_compat_4_0_len);
     compat_props_add(m->compat_props, pc_compat_4_0, pc_compat_4_0_len);
@@ -473,7 +473,7 @@ static void pc_i440fx_3_1_machine_options(MachineClass *m)
     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
 
     pc_i440fx_4_0_machine_options(m);
-    m->is_default = 0;
+    m->is_default = false;
     pcmc->do_not_add_smb_acpi = true;
     m->smbus_no_migration_support = true;
     m->alias = NULL;
index 747a175b55b9691d64970e7e41491800f6bc1597..b842f74344478670cab15dde5969db0c9c5d9d50 100644 (file)
@@ -295,7 +295,7 @@ static void lm32_evr_class_init(ObjectClass *oc, void *data)
 
     mc->desc = "LatticeMico32 EVR32 eval system";
     mc->init = lm32_evr_init;
-    mc->is_default = 1;
+    mc->is_default = true;
     mc->default_cpu_type = LM32_CPU_TYPE_NAME("lm32-full");
     mc->default_ram_size = 64 * MiB;
     mc->default_ram_id = "lm32_evr.sdram";
index 31622c71cb86a1d079b2b0b1cb752e1195baf260..b84c152ce3ca996b4fe05b4236edadb84fdcc1d6 100644 (file)
@@ -350,7 +350,7 @@ static void mcf5208evb_machine_init(MachineClass *mc)
 {
     mc->desc = "MCF5208EVB";
     mc->init = mcf5208evb_init;
-    mc->is_default = 1;
+    mc->is_default = true;
     mc->default_cpu_type = M68K_CPU_TYPE_NAME("m5208");
     mc->default_ram_id = "mcf5208.ram";
 }
index 849bafc186ba5988b2fda15717315a56d51b1aa8..0bb6cdea8d9022bb2c87db4cdec8708f60c1c587 100644 (file)
@@ -132,7 +132,7 @@ static void petalogix_s3adsp1800_machine_init(MachineClass *mc)
 {
     mc->desc = "PetaLogix linux refdesign for xilinx Spartan 3ADSP1800";
     mc->init = petalogix_s3adsp1800_init;
-    mc->is_default = 1;
+    mc->is_default = true;
 }
 
 DEFINE_MACHINE("petalogix-s3adsp1800", petalogix_s3adsp1800_machine_init)
index 6e7ba9235da333b572dc9a0bf724c61bb4cbb2da..d380f73d7bcc59d33c7ca4b709fa4334cfda215a 100644 (file)
@@ -1439,7 +1439,7 @@ static void mips_malta_machine_init(MachineClass *mc)
     mc->init = mips_malta_init;
     mc->block_default_type = IF_IDE;
     mc->max_cpus = 16;
-    mc->is_default = 1;
+    mc->is_default = true;
 #ifdef TARGET_MIPS64
     mc->default_cpu_type = MIPS_CPU_TYPE_NAME("20Kc");
 #else
index 1d06e39fcb2651c983cf53879412bef91a09fdf9..51a98287b582595c90cfd954991ad3e244c962c9 100644 (file)
@@ -150,7 +150,7 @@ static void moxiesim_machine_init(MachineClass *mc)
 {
     mc->desc = "Moxie simulator platform";
     mc->init = moxiesim_init;
-    mc->is_default = 1;
+    mc->is_default = true;
     mc->default_cpu_type = MOXIE_CPU_TYPE_NAME("MoxieLite");
 }
 
index ad8b2fc670972fd4e14d3dd1ba4c3b4f6c58ea66..33dc2bf511ae87351be68bd234c3d1b5a82a7e4f 100644 (file)
@@ -120,7 +120,7 @@ static void nios2_10m50_ghrd_machine_init(struct MachineClass *mc)
 {
     mc->desc = "Altera 10M50 GHRD Nios II design";
     mc->init = nios2_10m50_ghrd_init;
-    mc->is_default = 1;
+    mc->is_default = true;
 }
 
 DEFINE_MACHINE("10m50-ghrd", nios2_10m50_ghrd_machine_init);
index ad5371250f7ed0e74656a2c7b6df510c862b68c7..d08ce6181199aa1e75a7c5bc215710ce7b152c86 100644 (file)
@@ -176,7 +176,7 @@ static void openrisc_sim_machine_init(MachineClass *mc)
     mc->desc = "or1k simulation";
     mc->init = openrisc_sim_init;
     mc->max_cpus = 2;
-    mc->is_default = 1;
+    mc->is_default = true;
     mc->default_cpu_type = OPENRISC_CPU_TYPE_NAME("or1200");
 }
 
index 66e434bba3d2a0f38524e7d18be3dc6de9343af4..440c406eb4c8df8623de364020eceabf9161e9aa 100644 (file)
@@ -435,7 +435,7 @@ static void heathrow_class_init(ObjectClass *oc, void *data)
     mc->block_default_type = IF_IDE;
     mc->max_cpus = MAX_CPUS;
 #ifndef TARGET_PPC64
-    mc->is_default = 1;
+    mc->is_default = true;
 #endif
     /* TOFIX "cad" when Mac floppy is implemented */
     mc->default_boot_order = "cd";
index c03ce6afb93f407276e6315dea090d6c20972a9b..cc10798be4181dd28c6cf5d490f6a614e2efa9e9 100644 (file)
@@ -4560,7 +4560,7 @@ static const TypeInfo spapr_machine_info = {
 static void spapr_machine_latest_class_options(MachineClass *mc)
 {
     mc->alias = "pseries";
-    mc->is_default = 1;
+    mc->is_default = true;
 }
 
 #define DEFINE_SPAPR_MACHINE(suffix, verstr, latest)                 \
index 882368178328b60d8d0f659ea847315891852aaa..6f03857660e855806e7b2badf6883791c6bae7d8 100644 (file)
@@ -448,7 +448,7 @@ static void spike_machine_init(MachineClass *mc)
     mc->desc = "RISC-V Spike Board";
     mc->init = spike_board_init;
     mc->max_cpus = 1;
-    mc->is_default = 1;
+    mc->is_default = true;
     mc->default_cpu_type = SPIKE_V1_10_0_CPU;
 }
 
index a89cf4c12984526aae6193241c60b13fff03e3ce..895498cca6199c16e43a07b70a69a58ffbf2f5dd 100644 (file)
@@ -630,7 +630,7 @@ bool css_migration_enabled(void)
         mc->desc = "VirtIO-ccw based S390 machine v" verstr;                  \
         if (latest) {                                                         \
             mc->alias = "s390-ccw-virtio";                                    \
-            mc->is_default = 1;                                               \
+            mc->is_default = true;                                            \
         }                                                                     \
     }                                                                         \
     static void ccw_machine_##suffix##_instance_init(Object *obj)             \
index 2fc29154287168364de2f0e82496697bc8a722af..68b14ee5e70a41ee6c1b3a3be416167c2522c955 100644 (file)
@@ -82,7 +82,7 @@ static void shix_machine_init(MachineClass *mc)
 {
     mc->desc = "shix card";
     mc->init = shix_init;
-    mc->is_default = 1;
+    mc->is_default = true;
     mc->default_cpu_type = TYPE_SH7750R_CPU;
 }
 
index f5bf95fc9f29fb0a3a962515e057d098b2a48250..36ee1a0a3dc6a338d3a5a9a392aeaf21b32b1cc7 100644 (file)
@@ -1402,7 +1402,7 @@ static void ss5_class_init(ObjectClass *oc, void *data)
     mc->desc = "Sun4m platform, SPARCstation 5";
     mc->init = ss5_init;
     mc->block_default_type = IF_SCSI;
-    mc->is_default = 1;
+    mc->is_default = true;
     mc->default_boot_order = "c";
     mc->default_cpu_type = SPARC_CPU_TYPE_NAME("Fujitsu-MB86904");
     mc->default_display = "tcx";
index b7ac42f7a5fc2c41945947e68407a78360db002b..d33e84f831a05a4e04026aefd8a7b2e0ca4d6a8d 100644 (file)
@@ -816,7 +816,7 @@ static void sun4u_class_init(ObjectClass *oc, void *data)
     mc->init = sun4u_init;
     mc->block_default_type = IF_IDE;
     mc->max_cpus = 1; /* XXX for now */
-    mc->is_default = 1;
+    mc->is_default = true;
     mc->default_boot_order = "c";
     mc->default_cpu_type = SPARC_CPU_TYPE_NAME("TI-UltraSparc-IIi");
     mc->ignore_boot_device_suffixes = true;
index 7e933de2281d2df8ed7fd3b8d1b07bc960c3aac1..7f9c0238fe0f6a3f342a8b64815ff9c4f55074c4 100644 (file)
@@ -140,7 +140,7 @@ static void puv3_machine_init(MachineClass *mc)
 {
     mc->desc = "PKUnity Version-3 based on UniCore32";
     mc->init = puv3_init;
-    mc->is_default = 1;
+    mc->is_default = true;
     mc->default_cpu_type = UNICORE32_CPU_TYPE_NAME("UniCore-II");
 }
 
index 142b86d0aef3f312895528067c95cb21d1306645..9bc42dfb2254c75444d4de8a5efa6b2c1a0a32c3 100644 (file)
@@ -81,6 +81,8 @@ typedef struct {
  * @max_cpus: maximum number of CPUs supported. Default: 1
  * @min_cpus: minimum number of CPUs supported. Default: 1
  * @default_cpus: number of CPUs instantiated if none are specified. Default: 1
+ * @is_default:
+ *    If true QEMU will use this machine by default if no '-M' option is given.
  * @get_hotplug_handler: this function is called during bus-less
  *    device hotplug. If defined it returns pointer to an instance
  *    of HotplugHandler object, which handles hotplug operation
@@ -181,7 +183,7 @@ struct MachineClass {
         no_sdcard:1,
         pci_allow_0_address:1,
         legacy_fw_cfg_order:1;
-    int is_default;
+    bool is_default;
     const char *default_machine_opts;
     const char *default_boot_order;
     const char *default_display;