diff mbox series

[v2,03/13] hw/arm/virt: register TYPE_TARGET_SPECIFIC on the abstract parent

Message ID 20260826184229.1145-4-luoyonggang@gmail.com
State New
Headers show
Series single-binary: link ARM and RISC-V into qemu-system | expand

Commit Message

Yonggang Luo Aug. 26, 2026, 6:42 p.m. UTC
Hide the ARM virt machine when the selected target is not ARM in a
combined qemu-system binary. Versioned virt types already implement
TYPE_TARGET_SPECIFIC; register it on the abstract parent as well.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
 hw/arm/virt.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index daba9af79f1..c2ace7706f1 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -4161,6 +4161,7 @@  static void virt_machine_class_init(ObjectClass *oc, const void *data)
     MachineClass *mc = MACHINE_CLASS(oc);
     HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);
 
+    TARGET_SPECIFIC_CLASS(oc)->is_available = target_base_arm;
     mc->init = machvirt_init;
     /* Start with max_cpus set to 512, which is the maximum supported by KVM.
      * The value may be reduced later when we have more information about the
@@ -4431,6 +4432,7 @@  static const TypeInfo virt_machine_info = {
     .instance_finalize = virt_instance_finalize,
     .interfaces = (const InterfaceInfo[]) {
          { TYPE_HOTPLUG_HANDLER },
+         { TYPE_TARGET_SPECIFIC },
          { }
     },
 };