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:
Zide Chen
2020-04-13 08:49:12 -07:00
committed by wenlingz
parent 71bdc27a0f
commit fafce7aa5f
9 changed files with 23 additions and 24 deletions

View File

@@ -25,7 +25,7 @@ def gen_common_header(config):
def cpu_affinity_output(vm_info, i, config):
"""
Output the macro vcpu affinity
Output the macro pcpu affinity bitmap
:param vm_info: the data structure have all the xml items values
:param i: the index of vm id
:param config: file pointor to store the information
@@ -34,7 +34,7 @@ def cpu_affinity_output(vm_info, i, config):
return
cpu_bits = vm_info.get_cpu_bitmap(i)
print("#define VM{0}_CONFIG_VCPU_AFFINITY\t\t{1}".format(
print("#define VM{0}_CONFIG_CPU_AFFINITY\t\t{1}".format(
i, cpu_bits['cpu_map']), file=config)
def clos_config_output(vm_info, i, config):