qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC 41/52] machine: Introduce core_type() hook


From: Philippe Mathieu-Daudé
Subject: Re: [RFC 41/52] machine: Introduce core_type() hook
Date: Mon, 13 Feb 2023 14:35:24 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.2

On 13/2/23 10:50, Zhao Liu wrote:
From: Zhao Liu <zhao1.liu@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.liu@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?

+}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]