On 13/2/23 10:50, Zhao Liu wrote:
From: Zhao Liu <zhao1....@intel.com>
Since supported core types are architecture specific, we need this hook
to allow archs define its own parsing or validation method.
As the example, add the x86 core_type() which will be used in "-hybrid"
parameter parsing.
Signed-off-by: Zhao Liu <zhao1....@intel.com>
---
hw/core/machine-topo.c | 14 ++++++++++++++
hw/core/machine.c | 1 +
hw/i386/x86.c | 15 +++++++++++++++
include/hw/boards.h | 7 +++++++
4 files changed, 37 insertions(+)
diff --git a/hw/core/machine-topo.c b/hw/core/machine-topo.c
index 12c05510c1b5..f9ab08a1252e 100644
--- a/hw/core/machine-topo.c
+++ b/hw/core/machine-topo.c
@@ -352,3 +352,17 @@ void machine_parse_smp_config(MachineState *ms,
return;
}
}
+
+/*
+ * machine_parse_hybrid_core_type: the default hook to parse hybrid core
+ * type corresponding to the coretype
+ * string option.
+ */
+int machine_parse_hybrid_core_type(MachineState *ms, const char *coretype)
+{
+ if (strcmp(coretype, "") == 0 || strcmp(coretype, "none") == 0) {
+ return 0;
+ }
+
+ return -1;
Shouldn't this use mc->core_type()? Where is it used?
+}