hw/boards: Convert no_sdcard flag to OnOffAuto tri-state
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 25 Nov 2024 14:16:54 +0000 (15:16 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Sun, 16 Feb 2025 13:25:08 +0000 (14:25 +0100)
MachineClass::no_sdcard is initialized as false by default.
To catch all uses, convert it to a tri-state, having the
current default (false) becoming AUTO.

No logical change intended.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20250204200934.65279-2-philmd@linaro.org>

hw/arm/xilinx_zynq.c
hw/core/null-machine.c
hw/s390x/s390-virtio-ccw.c
include/hw/boards.h
system/vl.c

index 8477b8287450eb4b16f9b5c013a5b3cd0cc3bed5..12418094f9d8bb3098b06c317382b917f0e93c47 100644 (file)
@@ -463,7 +463,7 @@ static void zynq_machine_class_init(ObjectClass *oc, void *data)
     mc->desc = "Xilinx Zynq Platform Baseboard for Cortex-A9";
     mc->init = zynq_init;
     mc->max_cpus = ZYNQ_MAX_CPUS;
-    mc->no_sdcard = 1;
+    mc->no_sdcard = ON_OFF_AUTO_ON;
     mc->ignore_memory_transaction_failures = true;
     mc->valid_cpu_types = valid_cpu_types;
     mc->default_ram_id = "zynq.ext_ram";
index f586a4bef5436c722a717e3ff25e07b8507099d3..b93056c0f7b3a1fd8c640cec8a5813f2a8b409f5 100644 (file)
@@ -53,7 +53,7 @@ static void machine_none_machine_init(MachineClass *mc)
     mc->no_parallel = 1;
     mc->no_floppy = 1;
     mc->no_cdrom = 1;
-    mc->no_sdcard = 1;
+    mc->no_sdcard = ON_OFF_AUTO_ON;
 }
 
 DEFINE_MACHINE("none", machine_none_machine_init)
index d9e683c5b49708c546289c7efd08cc276c3e5686..5f78c8d20ff9ce670810468f7d9aa7e22ac13327 100644 (file)
@@ -817,7 +817,7 @@ static void ccw_machine_class_init(ObjectClass *oc, void *data)
     mc->no_cdrom = 1;
     mc->no_floppy = 1;
     mc->no_parallel = 1;
-    mc->no_sdcard = 1;
+    mc->no_sdcard = ON_OFF_AUTO_ON;
     mc->max_cpus = S390_MAX_CPUS;
     mc->has_hotpluggable_cpus = true;
     mc->smp_props.books_supported = true;
index e1f41b2a5333679f9399d65fdab0810682951ca2..d61b0a477805a4e8b7a641929c2c631cdd49b6e2 100644 (file)
@@ -283,9 +283,9 @@ struct MachineClass {
         no_parallel:1,
         no_floppy:1,
         no_cdrom:1,
-        no_sdcard:1,
         pci_allow_0_address:1,
         legacy_fw_cfg_order:1;
+    OnOffAuto no_sdcard;
     bool is_default;
     const char *default_machine_opts;
     const char *default_boot_order;
index 9c6942c6cfcc27dbb8408a09a3ba3fc7eebb5f4d..04ce290997c2c14f309ead1aad79060671b57a5a 100644 (file)
@@ -1346,7 +1346,7 @@ static void qemu_disable_default_devices(void)
     if (!has_defaults || machine_class->no_cdrom) {
         default_cdrom = 0;
     }
-    if (!has_defaults || machine_class->no_sdcard) {
+    if (!has_defaults || machine_class->no_sdcard == ON_OFF_AUTO_ON) {
         default_sdcard = 0;
     }
     if (!has_defaults) {