On 4/2/25 08:07, Thomas Huth wrote:
On 25/11/2024 19.14, Philippe Mathieu-Daudé wrote:
Invert the 'no_sdcard' logic, renaming it as the more
explicit "create_default_sdcard_drive". Machines are
supposed to create a SD Card drive when this flag is
set. In many cases it doesn't make much sense (as
boards don't expose SD Card host controller),

This indeed shows the insanity of the previous state, thanks for tackling it!

but this
is patch only aims to expose that nonsense; so no
logical change intended (mechanical patch using gsed).

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
...
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 86fcf9c81f..5cec73ae68 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -285,7 +285,7 @@ struct MachineClass {
          no_cdrom:1,
          pci_allow_0_address:1,
          legacy_fw_cfg_order:1;
-    OnOffAuto no_sdcard;
+    bool create_default_sdcard_drive;

Can we maybe still bikeshed about the naming here? The current name is a little bit long, and maybe we could "standardize" the prefix of the flags here a little bit. We already have one switch starting with "has_..." and some others starting with "auto_enable_...", so I'd maybe suggest one of those instead:

   has_default_sdcard
   auto_enable_sdcard

I added "drive" within the name, because this option isn't only
about automatically creating a SD Card device, but also attach
a block drive to it, and 'create_default_sdcard_drive' was shorter
than 'implictly_create_sdcard_if_drive_provided'.

I'll repost using 'auto_create_sdcard' as compromise, also shorter
than 'auto_create_sdcard_for_drive'.

Thanks for the review,

Phil.

Reply via email to