summary refs log tree commit diff stats
path: root/include/hw/boards.h
diff options
context:
space:
mode:
authorYanan Wang <wangyanan55@huawei.com>2021-09-29 10:58:12 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2021-10-01 15:28:19 +0200
commite4a97a893bcd7511aba812969d1fa6fe42dc1931 (patch)
tree1391c300f710f8d886a615499b8c9f1b630c6613 /include/hw/boards.h
parent003f230e37d724ac52004d7f8270159da105780f (diff)
downloadfocaccia-qemu-e4a97a893bcd7511aba812969d1fa6fe42dc1931.tar.gz
focaccia-qemu-e4a97a893bcd7511aba812969d1fa6fe42dc1931.zip
machine: Make smp_parse generic enough for all arches
Currently the only difference between smp_parse and pc_smp_parse
is the support of dies parameter and the related error reporting.
With some arch compat variables like "bool dies_supported", we can
make smp_parse generic enough for all arches and the PC specific
one can be removed.

Making smp_parse() generic enough can reduce code duplication and
ease the code maintenance, and also allows extending the topology
with more arch specific members (e.g., clusters) in the future.

Suggested-by: Andrew Jones <drjones@redhat.com>
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Yanan Wang <wangyanan55@huawei.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20210929025816.21076-13-wangyanan55@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/hw/boards.h')
-rw-r--r--include/hw/boards.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 2a1bba86c0..72a23e4e0f 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -109,6 +109,14 @@ typedef struct {
 } CPUArchIdList;
 
 /**
+ * SMPCompatProps:
+ * @dies_supported - whether dies are supported by the machine
+ */
+typedef struct {
+    bool dies_supported;
+} SMPCompatProps;
+
+/**
  * MachineClass:
  * @deprecation_reason: If set, the machine is marked as deprecated. The
  *    string should provide some clear information about what to use instead.
@@ -248,6 +256,7 @@ struct MachineClass {
     bool numa_mem_supported;
     bool auto_enable_numa;
     bool smp_prefer_sockets;
+    SMPCompatProps smp_props;
     const char *default_ram_id;
 
     HotplugHandler *(*get_hotplug_handler)(MachineState *machine,