mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-17 23:08:07 +00:00
acrn-config: change names for vcpu_affinity[] related items
hypervisor is replacing vm_configs[].vcpu_affinity[] array with cpu_affinity_bitmap, the meaning of which has some changes as well. This patch changes the names in generated vm_configuration.c: -.vcpu_affinity = VMx_CONFIG_VCPU_AFFINITY, +.cpu_affinity_bitmap = VMx_CONFIG_CPU_AFFINITY, Changes in vm_configuration.h: -#define VMx_CONFIG_VCPU_AFFINITY {AFFINITY_CPU(xU), AFFINITY_CPU(xU)} +#define VMx_CONFIG_CPU_AFFINITY (AFFINITY_CPU(xU) | AFFINITY_CPU(xU)) Also don't generate default assignment of vcpu_num in vm_configuration.c, because now hypervisor can easily calculate it from cpu_affinity_bitmap. Accordingly, in the scenario xml files, tag "vcpu_affinity" is changed to "cpu_affinity". Tracked-On: #4641 Signed-off-by: Zide Chen <zide.chen@intel.com> Acked-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
@@ -499,7 +499,7 @@ def cpu_sharing_check(cpu_sharing, item):
|
||||
vm_cpu_share = []
|
||||
vm_cpu_share_consistent = True
|
||||
|
||||
cpu_affinity = common.get_leaf_tag_map(common.SCENARIO_INFO_FILE, "vcpu_affinity", "pcpu_id")
|
||||
cpu_affinity = common.get_leaf_tag_map(common.SCENARIO_INFO_FILE, "cpu_affinity", "pcpu_id")
|
||||
for vm_i in cpu_affinity.keys():
|
||||
for cpu in cpu_affinity[vm_i]:
|
||||
if cpu in use_cpus:
|
||||
|
@@ -451,14 +451,14 @@ def cpus_assignment(cpus_per_vm, index):
|
||||
for i in range(len(cpus_per_vm[index])):
|
||||
if i == 0:
|
||||
if len(cpus_per_vm[index]) == 1:
|
||||
cpu_str = "{{AFFINITY_CPU({0}U)}}".format(cpus_per_vm[index][0])
|
||||
cpu_str = "(AFFINITY_CPU({0}U))".format(cpus_per_vm[index][0])
|
||||
else:
|
||||
cpu_str = "{{AFFINITY_CPU({0}U)".format(cpus_per_vm[index][0])
|
||||
cpu_str = "(AFFINITY_CPU({0}U)".format(cpus_per_vm[index][0])
|
||||
else:
|
||||
if i == len(cpus_per_vm[index]) - 1:
|
||||
cpu_str = cpu_str + ", AFFINITY_CPU({0}U)}}".format(cpus_per_vm[index][i])
|
||||
cpu_str = cpu_str + " | AFFINITY_CPU({0}U))".format(cpus_per_vm[index][i])
|
||||
else:
|
||||
cpu_str = cpu_str + ", AFFINITY_CPU({0}U)".format(cpus_per_vm[index][i])
|
||||
cpu_str = cpu_str + " | AFFINITY_CPU({0}U)".format(cpus_per_vm[index][i])
|
||||
|
||||
vm_cpu_bmp['cpu_map'] = cpu_str
|
||||
vm_cpu_bmp['cpu_num'] = len(cpus_per_vm[index])
|
||||
|
Reference in New Issue
Block a user