On 4/3/25 16:49, Philippe Mathieu-Daudé wrote:
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
  meson.build                    |  1 +
  include/hw/boards.h            |  1 +
  include/qemu/target_info-qom.h | 14 ++++++++++++++
  target_info-qom.c              | 15 +++++++++++++++
  4 files changed, 31 insertions(+)
  create mode 100644 include/qemu/target_info-qom.h
  create mode 100644 target_info-qom.c

diff --git a/meson.build b/meson.build
index de9c9dacd35..b93253166c8 100644
--- a/meson.build
+++ b/meson.build
@@ -3815,6 +3815,7 @@ specific_ss.add(files('page-target.c', 
'page-vary-target.c'))
specific_ss.add(files('target_info-stub.c'))
  common_ss.add(files('target_info.c'))
+system_ss.add(files('target_info-qom.c'))
subdir('backends')
  subdir('disas')
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 02f43ac5d4d..b1bbf3c34d4 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -7,6 +7,7 @@
  #include "system/hostmem.h"
  #include "system/blockdev.h"
  #include "qapi/qapi-types-machine.h"
+#include "qemu/target_info-qom.h"
  #include "qemu/module.h"
  #include "qom/object.h"
  #include "hw/core/cpu.h"
diff --git a/include/qemu/target_info-qom.h b/include/qemu/target_info-qom.h
new file mode 100644
index 00000000000..c87d47acf66
--- /dev/null
+++ b/include/qemu/target_info-qom.h
@@ -0,0 +1,14 @@
+/*
+ * QEMU binary helpers
+ *
+ *  Copyright (c) Linaro
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef QEMU_TARGET_INFO_QOM_H
+#define QEMU_TARGET_INFO_QOM_H
+
+#define TYPE_LEGACY_BINARY_PREFIX "legacy-binary-"
+

How about TYPE_TARGET_PREFIX instead?
It's not related to any legacy stuff, as the new API will be used in the future (and will stay). As well, I don't think we should mention "binary" in any name, because what we really talk about are targets {user|system, architecture}, in the meaning of our build system (configure --target-list).

So please replace [legacy, binary] with target simply, so we keep a sane vocabulary in the future.

+#endif
diff --git a/target_info-qom.c b/target_info-qom.c
new file mode 100644
index 00000000000..6970b95ee0b
--- /dev/null
+++ b/target_info-qom.c
@@ -0,0 +1,15 @@
+/*
+ * QEMU legacy binary helpers
+ *
+ *  Copyright (c) Linaro
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/target_info-qom.h"
+
+static const TypeInfo target_info_types[] = {
+};
+
+DEFINE_TYPES(target_info_types)

Reply via email to