typedef struct TargetInfo {
/* runtime equivalent of TARGET_NAME definition */
const char *target_name;
+ /* QOM typename machines for this binary must implement */
+ const char *machine_typename;
} TargetInfo;
/**
*/
const char *target_name(void);
+/**
+ * target_machine_typename:
+ *
+ * Returns: Name of the QOM interface implemented by machines
+ * usable on this target binary.
+ */
+const char *target_machine_typename(void);
+
/**
* target_cpu_type:
*
#include "qemu/datadir.h"
#include "qemu/units.h"
#include "qemu/module.h"
+#include "qemu/target-info.h"
#include "exec/cpu-common.h"
#include "exec/page-vary.h"
#include "hw/qdev-properties.h"
GSList *el;
const char *type = qdict_get_try_str(qdict, "type");
- machines = object_class_get_list(TYPE_MACHINE, false);
+ machines = object_class_get_list(target_machine_typename(), false);
if (type) {
ObjectClass *machine_class = OBJECT_CLASS(find_machine(type, machines));
if (machine_class) {
#include "qemu/osdep.h"
#include "qemu/target-info.h"
#include "qemu/target-info-impl.h"
+#include "hw/boards.h"
#include "cpu.h"
static const TargetInfo target_info_stub = {
.target_name = TARGET_NAME,
+ .machine_typename = TYPE_MACHINE,
};
const TargetInfo *target_info(void)
{
return target_info()->target_name;
}
+
+const char *target_machine_typename(void)
+{
+ return target_info()->machine_typename;
+}