From cce7389d6f668303f97254b264a2d067411f2a9d Mon Sep 17 00:00:00 2001 From: Zide Chen Date: Mon, 13 Apr 2020 08:49:12 -0700 Subject: [PATCH] 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 Acked-by: Victor Sun --- misc/acrn-config/config_app/templates/launch.html | 8 ++++---- misc/acrn-config/config_app/templates/scenario.html | 6 +++--- misc/acrn-config/launch_config/launch_item.py | 2 +- misc/acrn-config/library/launch_cfg_lib.py | 2 +- misc/acrn-config/library/scenario_cfg_lib.py | 8 ++++---- .../acrn-config/scenario_config/scenario_cfg_gen.py | 2 +- misc/acrn-config/scenario_config/scenario_item.py | 2 +- .../scenario_config/vm_configurations_c.py | 13 ++++++------- .../scenario_config/vm_configurations_h.py | 4 ++-- 9 files changed, 23 insertions(+), 24 deletions(-) diff --git a/misc/acrn-config/config_app/templates/launch.html b/misc/acrn-config/config_app/templates/launch.html index 1ddf101d9..cfed5775b 100644 --- a/misc/acrn-config/config_app/templates/launch.html +++ b/misc/acrn-config/config_app/templates/launch.html @@ -228,7 +228,7 @@ the launch scripts will be generated into misc/acrn-config/xmls/config-xmls/[boa {{sub_elem.tag}} {% if ','.join(['uos', elem.tag, sub_elem.tag]) not in launch_item_values - and elem.tag != 'vcpu_affinity'%} + and elem.tag != 'cpu_affinity'%}
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %} {% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %} @@ -273,7 +273,7 @@ the launch scripts will be generated into misc/acrn-config/xmls/config-xmls/[boa {% endif %} {% endfor %} - {% if elem.tag == 'vcpu_affinity' %} + {% if elem.tag == 'cpu_affinity' %} {% if not first_child %} @@ -393,4 +393,4 @@ the launch scripts will be generated into misc/acrn-config/xmls/config-xmls/[boa {% endif %} -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/misc/acrn-config/config_app/templates/scenario.html b/misc/acrn-config/config_app/templates/scenario.html index 2a4fbedfb..2608b6521 100644 --- a/misc/acrn-config/config_app/templates/scenario.html +++ b/misc/acrn-config/config_app/templates/scenario.html @@ -227,7 +227,7 @@ the source files will be generated into default path and overwirte the previous {{sub_elem.tag}} {% if ','.join([vm.tag, elem.tag, sub_elem.tag]) not in scenario_item_values - and elem.tag != 'vcpu_affinity' and elem.tag != 'pci_devs' %} + and elem.tag != 'cpu_affinity' and elem.tag != 'pci_devs' %} {% if sub_elem.tag in ['bootargs', 'kern_args'] %}
{% if 'readonly' in sub_elem.attrib and sub_elem.attrib['readonly'] == 'true' %} @@ -253,7 +253,7 @@ the source files will be generated into default path and overwirte the previous
{% endif %} {% else %} - {% set item_key = ','.join([vm.tag, elem.tag, sub_elem.tag]) if elem.tag != 'vcpu_affinity' + {% set item_key = ','.join([vm.tag, elem.tag, sub_elem.tag]) if elem.tag != 'cpu_affinity' and elem.tag != 'pci_devs' else ','.join([vm.tag, elem.tag]) %}