From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
qemu-riscv@nongnu.org, qemu-ppc@nongnu.org,
"Paolo Bonzini" <pbonzini@redhat.com>,
qemu-s390x@nongnu.org, qemu-arm@nongnu.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH-for-10.0 1/3] hw/boards: Convert no_sdcard flag to OnOffAuto tri-state
Date: Mon, 25 Nov 2024 19:14:18 +0100 [thread overview]
Message-ID: <20241125181420.24424-2-philmd@linaro.org> (raw)
In-Reply-To: <20241125181420.24424-1-philmd@linaro.org>
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>
---
include/hw/boards.h | 2 +-
hw/arm/xilinx_zynq.c | 2 +-
hw/core/null-machine.c | 2 +-
hw/s390x/s390-virtio-ccw.c | 2 +-
system/vl.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 36fbb9b59d..86fcf9c81f 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -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;
diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index fde4d946b7..76bab2499f 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -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";
diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c
index f586a4bef5..b93056c0f7 100644
--- a/hw/core/null-machine.c
+++ b/hw/core/null-machine.c
@@ -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)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index fe03f716f3..8b40b87899 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -747,7 +747,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;
diff --git a/system/vl.c b/system/vl.c
index 3bb8f2db9a..4a7c29a8ab 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -1350,7 +1350,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) {
--
2.45.2
next prev parent reply other threads:[~2024-11-25 18:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-25 18:14 [PATCH-for-10.0 0/3] hw/boards: Try to make sense of MachineClass::no_sdcard flag Philippe Mathieu-Daudé
2024-11-25 18:14 ` Philippe Mathieu-Daudé [this message]
2025-02-04 6:59 ` [PATCH-for-10.0 1/3] hw/boards: Convert no_sdcard flag to OnOffAuto tri-state Thomas Huth
2024-11-25 18:14 ` [PATCH-for-10.0 2/3] hw/boards: Explicit no_sdcard=false as ON_OFF_AUTO_OFF Philippe Mathieu-Daudé
2025-02-04 7:00 ` Thomas Huth
2024-11-25 18:14 ` [PATCH-for-10.0 3/3] hw/boards: Rename no_sdcard -> create_default_sdcard_drive Philippe Mathieu-Daudé
2025-02-04 7:07 ` Thomas Huth
2025-02-04 11:09 ` Philippe Mathieu-Daudé
2024-11-26 5:24 ` [PATCH-for-10.0 0/3] hw/boards: Try to make sense of MachineClass::no_sdcard flag Philippe Mathieu-Daudé
2025-02-04 7:11 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241125181420.24424-2-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=berrange@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).