mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
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>
This commit is contained in:
parent
003f230e37
commit
e4a97a893b
3 changed files with 81 additions and 103 deletions
|
@ -108,6 +108,14 @@ typedef struct {
|
|||
CPUArchId cpus[];
|
||||
} 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
|
||||
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue