diff mbox series

[RFC,v2,07/11] hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine

Message ID 20250418005059.4436-8-philmd@linaro.org
State New
Headers show
Series single-binary: Make hw/arm/ common | expand

Commit Message

Philippe Mathieu-Daudé April 18, 2025, 12:50 a.m. UTC
When we'll start to use target_machine_interface_typename()
to filter machines for the ARM/Aarch64 binaries, the 'none'
machine will be filtered out. Register the proper interfaces
to keep it available.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/core/null-machine.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Pierrick Bouvier April 18, 2025, 3:32 a.m. UTC | #1
On 4/17/25 17:50, Philippe Mathieu-Daudé wrote:
> When we'll start to use target_machine_interface_typename()
> to filter machines for the ARM/Aarch64 binaries, the 'none'
> machine will be filtered out. Register the proper interfaces
> to keep it available.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/core/null-machine.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c
> index 1ccaf652eb4..614b52dae0d 100644
> --- a/hw/core/null-machine.c
> +++ b/hw/core/null-machine.c
> @@ -62,6 +62,11 @@ static const TypeInfo null_machine_types[] = {
>           .name           = MACHINE_TYPE_NAME("none"),
>           .parent         = TYPE_MACHINE,
>           .class_init     = null_machine_class_init,
> +        .interfaces     = (InterfaceInfo[]) {
> +            { TYPE_TARGET_ARM_MACHINE },
> +            { TYPE_TARGET_AARCH64_MACHINE },
> +            { },
> +        },
>       },
>   };
>   

I see better why those type were defined in a global header.
I would still favor a header in hw/arm, that this file can include (and 
other arch later when we'll implement it for them).
diff mbox series

Patch

diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c
index 1ccaf652eb4..614b52dae0d 100644
--- a/hw/core/null-machine.c
+++ b/hw/core/null-machine.c
@@ -62,6 +62,11 @@  static const TypeInfo null_machine_types[] = {
         .name           = MACHINE_TYPE_NAME("none"),
         .parent         = TYPE_MACHINE,
         .class_init     = null_machine_class_init,
+        .interfaces     = (InterfaceInfo[]) {
+            { TYPE_TARGET_ARM_MACHINE },
+            { TYPE_TARGET_AARCH64_MACHINE },
+            { },
+        },
     },
 };