mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-21 05:02:24 +00:00
config_tools: remove KATA and replace UUID with vmname to identify a vm
1. remove CONFIG_KATA_VM, CONFIG_MAX_KATA_VM_NUM and KATA_VM related code. 2. remove KATA_VM in scenario xml files. 3. remove KATA vm type in UI. 4. remove UUID DB. 5. remove uuid in the launch script generation logic. 6. use vmname to identify a vm. (eg: <name>ACRN_SOS_VM</name>) add the check logic to ensure vm name is a must-set item, not duplicated, and the string length is [1-15] and the whitespace is not allowed. 7. enlarge the max VM num to 32. Tracked-On: #6685 Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
This commit is contained in:
parent
b382448d69
commit
29b8da2a51
@ -597,18 +597,6 @@ $().ready(function(){
|
||||
}
|
||||
config_item.remove();
|
||||
});
|
||||
|
||||
$('#remove_vm_kata').on('click', function() {
|
||||
if(confirm("Do you want to remove the VM?")) {
|
||||
save_scenario("remove_vm_kata");
|
||||
}
|
||||
});
|
||||
|
||||
$('#add_vm_kata').on('click', function() {
|
||||
if(confirm("Do you want to add the Kata VM based on generic config?")) {
|
||||
save_scenario("add_vm_kata");
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
|
@ -56,7 +56,6 @@ the source files will be generated into default path and overwirte the previous
|
||||
<option value="SERVICE_VM">SERVICE_VM</option>
|
||||
<option value="POST_STD_VM">POST_STD_VM</option>
|
||||
<option value="POST_RT_VM">POST_RT_VM</option>
|
||||
<option value="KATA_VM">KATA_VM</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@ -115,11 +114,7 @@ the source files will be generated into default path and overwirte the previous
|
||||
|
||||
{% if board_info != None and root != None and scenario_item_values %}
|
||||
<table class="table table-hover" id="tab">
|
||||
{% set vm_kata = [] %}
|
||||
{% for vm in root|list %}
|
||||
{% if 'desc' in vm.attrib and vm.attrib['desc'] == 'specific for Kata' %}
|
||||
{% do vm_kata.append(1) %}
|
||||
{% endif %}
|
||||
{% set first_multi_child = {'IVSHMEM_REGION': 0, 'communication_vuart': 1} %}
|
||||
{% if xpath_dict['/'.join(['/acrn-config', vm.tag])]['configurable'] == 'y' or
|
||||
vm.xpath(xpath_dict['/'.join(['/acrn-config', vm.tag])]['configurable'])%}
|
||||
@ -149,11 +144,6 @@ the source files will be generated into default path and overwirte the previous
|
||||
Remove this VM</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if 'desc' in vm.attrib or vm.attrib['desc'] == 'specific for Kata' %}
|
||||
<div class="form-group">
|
||||
<button type="button" class="btn" id="remove_vm_kata">Remove Kata VM</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% for elem in vm|list %}
|
||||
@ -481,11 +471,6 @@ the source files will be generated into default path and overwirte the previous
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if not vm_kata and ('scenario' in root.attrib and root.attrib['scenario'] == 'sdc') %}
|
||||
<tr><td>
|
||||
<button type="button" class="btn" id="add_vm_kata">Add Kata VM</button>
|
||||
</td></tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
{% else %}
|
||||
<text class="form-control" id="err_msg">No setting available. Select one board info and make sure the scenario xml
|
||||
|
@ -299,30 +299,7 @@ def save_scenario():
|
||||
|
||||
generator = scenario_config_data['generator']
|
||||
if generator is not None:
|
||||
if generator == 'remove_vm_kata':
|
||||
scenario_config.delete_curr_key('vm:desc=specific for Kata')
|
||||
assign_vm_id(scenario_config)
|
||||
elif generator == 'add_vm_kata':
|
||||
vm_list = []
|
||||
for vm in list(scenario_config.get_curr_root()):
|
||||
if vm.tag == 'vm':
|
||||
vm_list.append(vm.attrib['id'])
|
||||
if len(vm_list) >= MAX_VM_NUM:
|
||||
return {'status': 'fail',
|
||||
'error_list': {'error': 'Can not add a new VM. Max VM number is {}.'.format(MAX_VM_NUM)}}
|
||||
|
||||
# clone vm kata from generic config
|
||||
generic_scenario_config = get_generic_scenario_config(scenario_config)
|
||||
generic_scenario_config_root = generic_scenario_config.get_curr_root()
|
||||
elem_kata = None
|
||||
for vm in list(generic_scenario_config_root):
|
||||
if 'desc' in vm.attrib and vm.attrib['desc'] == 'specific for Kata':
|
||||
elem_kata = vm
|
||||
break
|
||||
if elem_kata is not None:
|
||||
scenario_config.clone_curr_elem(elem_kata)
|
||||
assign_vm_id(scenario_config)
|
||||
elif generator.startswith('add_vm:'):
|
||||
if generator.startswith('add_vm:'):
|
||||
vm_list = []
|
||||
for vm in list(scenario_config.get_curr_root()):
|
||||
if vm.tag == 'vm':
|
||||
@ -445,8 +422,6 @@ def save_launch():
|
||||
'Please select a scenario with available post launched VMs.'}}
|
||||
add_vm_id = add_launch_type.split('ID :')[1].replace(')', '').strip()
|
||||
add_launch_type = 'LAUNCH_' + add_launch_type.split()[0]
|
||||
if add_launch_type == 'LAUNCH_KATA_VM':
|
||||
add_launch_type = 'LAUNCH_POST_STD_VM'
|
||||
add_launch_id = 1
|
||||
post_vm_list = get_post_launch_vm_list(scenario_name)
|
||||
for i in range(len(post_vm_list)):
|
||||
@ -647,7 +622,7 @@ def create_setting():
|
||||
scenario_config.clone_curr_elem(elem_clos_max, 'hv', 'FEATURES', 'RDT')
|
||||
# for i in range(num_mba_delay):
|
||||
# scenario_config.clone_curr_elem(elem_mba_delay, 'hv', 'FEATURES', 'RDT')
|
||||
for i in range(8):
|
||||
for i in range(7):
|
||||
scenario_config.delete_curr_key('vm:id={}'.format(i))
|
||||
scenario_config = set_default_config(scenario_config)
|
||||
scenario_config.save(create_name)
|
||||
@ -1084,7 +1059,6 @@ def get_generic_scenario_config(scenario_config, add_vm_type=None):
|
||||
'SERVICE_VM': ('shared', 'vm:id=0'),
|
||||
'POST_STD_VM': ('shared', 'vm:id=1'),
|
||||
'POST_RT_VM': ('shared', 'vm:id=2'),
|
||||
'KATA_VM': ('shared', 'vm:id=7'),
|
||||
'LAUNCH_POST_STD_VM': ('hybrid_launch_2user_vm', 'user_vm:id=1'),
|
||||
'LAUNCH_POST_RT_VM': ('shared_launch_6user_vm', 'user_vm:id=2')
|
||||
}
|
||||
@ -1278,7 +1252,7 @@ def assign_vm_id(scenario_config):
|
||||
pre_launched_vm_num += 1
|
||||
elif item.text in ['SERVICE_VM']:
|
||||
sos_vm_num += 1
|
||||
elif item.text in ['POST_STD_VM', 'POST_RT_VM', 'KATA_VM']:
|
||||
elif item.text in ['POST_STD_VM', 'POST_RT_VM']:
|
||||
post_launched_vm_num += 1
|
||||
|
||||
pre_launched_vm_index = 0
|
||||
@ -1294,7 +1268,7 @@ def assign_vm_id(scenario_config):
|
||||
elif item.text in ['SERVICE_VM']:
|
||||
vm.attrib['id'] = str(sos_vm_index)
|
||||
sos_vm_index += 1
|
||||
elif item.text in ['POST_STD_VM', 'POST_RT_VM', 'KATA_VM']:
|
||||
elif item.text in ['POST_STD_VM', 'POST_RT_VM']:
|
||||
vm.attrib['id'] = str(post_launched_vm_index)
|
||||
post_launched_vm_index += 1
|
||||
|
||||
|
@ -60,7 +60,7 @@
|
||||
|
||||
<vm id="0">
|
||||
<vm_type>PRE_RT_VM</vm_type>
|
||||
<name>ACRN PRE-LAUNCHED VM0</name>
|
||||
<name>PRE_RT_VM0</name>
|
||||
<guest_flags>
|
||||
<guest_flag>GUEST_FLAG_LAPIC_PASSTHROUGH</guest_flag>
|
||||
<guest_flag>GUEST_FLAG_RT</guest_flag>
|
||||
@ -123,7 +123,7 @@
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<vm_type>SERVICE_VM</vm_type>
|
||||
<name>ACRN Service VM</name>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -185,6 +185,7 @@
|
||||
</vm>
|
||||
<vm id="2">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -226,6 +227,7 @@
|
||||
</vm>
|
||||
<vm id="3">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM2</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
|
@ -60,7 +60,7 @@
|
||||
|
||||
<vm id="0">
|
||||
<vm_type>SERVICE_VM</vm_type>
|
||||
<name>ACRN Service VM</name>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -111,6 +111,7 @@
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -149,6 +150,7 @@
|
||||
</vm>
|
||||
<vm id="2">
|
||||
<vm_type>POST_RT_VM</vm_type>
|
||||
<name>POST_RT_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -188,6 +190,7 @@
|
||||
</vm>
|
||||
<vm id="3">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM2</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -227,6 +230,7 @@
|
||||
</vm>
|
||||
<vm id="4">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM3</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -266,6 +270,7 @@
|
||||
</vm>
|
||||
<vm id="5">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM4</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -305,6 +310,7 @@
|
||||
</vm>
|
||||
<vm id="6">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM5</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -342,40 +348,4 @@
|
||||
</communication_vuart>
|
||||
<PTM>n</PTM>
|
||||
</vm>
|
||||
<vm id="7">
|
||||
<vm_type>KATA_VM</vm_type>
|
||||
<cpu_affinity>
|
||||
<pcpu_id>0</pcpu_id>
|
||||
<pcpu_id>1</pcpu_id>
|
||||
</cpu_affinity>
|
||||
<clos>
|
||||
<vcpu_clos>0</vcpu_clos>
|
||||
<vcpu_clos>0</vcpu_clos>
|
||||
</clos>
|
||||
<epc_section>
|
||||
<base>0</base>
|
||||
<size>0</size>
|
||||
</epc_section>
|
||||
<legacy_vuart id="0">
|
||||
<type>VUART_LEGACY_PIO</type>
|
||||
<base>INVALID_COM_BASE</base>
|
||||
<irq>COM1_IRQ</irq>
|
||||
</legacy_vuart>
|
||||
<legacy_vuart id="1">
|
||||
<type>VUART_LEGACY_PIO</type>
|
||||
<base>INVALID_COM_BASE</base>
|
||||
<irq>COM2_IRQ</irq>
|
||||
<target_vm_id>0</target_vm_id>
|
||||
<target_uart_id>0</target_uart_id>
|
||||
</legacy_vuart>
|
||||
<console_vuart id="0">
|
||||
<base>INVALID_PCI_BASE</base>
|
||||
</console_vuart>
|
||||
<communication_vuart id="1">
|
||||
<base>INVALID_PCI_BASE</base>
|
||||
<target_vm_id>1</target_vm_id>
|
||||
<target_uart_id>1</target_uart_id>
|
||||
</communication_vuart>
|
||||
<PTM>n</PTM>
|
||||
</vm>
|
||||
</acrn-config>
|
||||
|
@ -61,7 +61,7 @@
|
||||
</hv>
|
||||
<vm id="0">
|
||||
<vm_type>SAFETY_VM</vm_type>
|
||||
<name>ACRN PRE-LAUNCHED VM0</name>
|
||||
<name>SAFETY_VM0</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -119,7 +119,7 @@
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<vm_type>SERVICE_VM</vm_type>
|
||||
<name>ACRN Service VM</name>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -175,6 +175,7 @@
|
||||
</vm>
|
||||
<vm id="2">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -212,6 +213,7 @@
|
||||
</vm>
|
||||
<vm id="3">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM2</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
|
@ -127,7 +127,7 @@
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<vm_type>SERVICE_VM</vm_type>
|
||||
<name>ACRN Service VM</name>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
|
@ -61,7 +61,7 @@
|
||||
</hv>
|
||||
<vm id="0">
|
||||
<vm_type>PRE_STD_VM</vm_type>
|
||||
<name>ACRN PRE-LAUNCHED VM0</name>
|
||||
<name>PRE_STD_VM0</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -122,7 +122,7 @@
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<vm_type>PRE_STD_VM</vm_type>
|
||||
<name>ACRN PRE-LAUNCHED VM1</name>
|
||||
<name>PRE_STD_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
|
@ -61,7 +61,7 @@
|
||||
</hv>
|
||||
<vm id="0">
|
||||
<vm_type>SERVICE_VM</vm_type>
|
||||
<name>ACRN Service VM</name>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -111,6 +111,7 @@
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -150,6 +151,7 @@
|
||||
</vm>
|
||||
<vm id="2">
|
||||
<vm_type>POST_RT_VM</vm_type>
|
||||
<name>POST_RT_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>GUEST_FLAG_LAPIC_PASSTHROUGH</guest_flag>
|
||||
<guest_flag>GUEST_FLAG_RT</guest_flag>
|
||||
@ -190,6 +192,7 @@
|
||||
</vm>
|
||||
<vm id="3">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM2</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -229,6 +232,7 @@
|
||||
</vm>
|
||||
<vm id="4">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM3</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -268,6 +272,7 @@
|
||||
</vm>
|
||||
<vm id="5">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM4</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -307,6 +312,7 @@
|
||||
</vm>
|
||||
<vm id="6">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM5</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -344,40 +350,4 @@
|
||||
</communication_vuart>
|
||||
<PTM>n</PTM>
|
||||
</vm>
|
||||
<vm id="7">
|
||||
<vm_type>KATA_VM</vm_type>
|
||||
<cpu_affinity>
|
||||
<pcpu_id>0</pcpu_id>
|
||||
<pcpu_id>1</pcpu_id>
|
||||
</cpu_affinity>
|
||||
<clos>
|
||||
<vcpu_clos>0</vcpu_clos>
|
||||
<vcpu_clos>0</vcpu_clos>
|
||||
</clos>
|
||||
<epc_section>
|
||||
<base>0</base>
|
||||
<size>0</size>
|
||||
</epc_section>
|
||||
<legacy_vuart id="0">
|
||||
<type>VUART_LEGACY_PIO</type>
|
||||
<base>INVALID_COM_BASE</base>
|
||||
<irq>COM1_IRQ</irq>
|
||||
</legacy_vuart>
|
||||
<legacy_vuart id="1">
|
||||
<type>VUART_LEGACY_PIO</type>
|
||||
<base>INVALID_COM_BASE</base>
|
||||
<irq>COM2_IRQ</irq>
|
||||
<target_vm_id>0</target_vm_id>
|
||||
<target_uart_id>0</target_uart_id>
|
||||
</legacy_vuart>
|
||||
<console_vuart id="0">
|
||||
<base>INVALID_PCI_BASE</base>
|
||||
</console_vuart>
|
||||
<communication_vuart id="1">
|
||||
<base>INVALID_PCI_BASE</base>
|
||||
<target_vm_id>1</target_vm_id>
|
||||
<target_uart_id>1</target_uart_id>
|
||||
</communication_vuart>
|
||||
<PTM>n</PTM>
|
||||
</vm>
|
||||
</acrn-config>
|
||||
|
@ -61,7 +61,7 @@
|
||||
</hv>
|
||||
<vm id="0">
|
||||
<vm_type>SAFETY_VM</vm_type>
|
||||
<name>ACRN PRE-LAUNCHED VM0</name>
|
||||
<name>SAFETY_VM0</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -119,7 +119,7 @@
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<vm_type>SERVICE_VM</vm_type>
|
||||
<name>ACRN Service VM</name>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -175,6 +175,7 @@
|
||||
</vm>
|
||||
<vm id="2">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -212,6 +213,7 @@
|
||||
</vm>
|
||||
<vm id="3">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM2</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
|
@ -61,7 +61,7 @@
|
||||
</hv>
|
||||
<vm id="0">
|
||||
<vm_type>PRE_STD_VM</vm_type>
|
||||
<name>ACRN PRE-LAUNCHED VM0</name>
|
||||
<name>PRE_STD_VM0</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -122,7 +122,7 @@
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<vm_type>PRE_STD_VM</vm_type>
|
||||
<name>ACRN PRE-LAUNCHED VM1</name>
|
||||
<name>PRE_STD_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
|
@ -61,7 +61,7 @@
|
||||
</hv>
|
||||
<vm id="0">
|
||||
<vm_type>SERVICE_VM</vm_type>
|
||||
<name>ACRN Service VM</name>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -111,6 +111,7 @@
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -150,6 +151,7 @@
|
||||
</vm>
|
||||
<vm id="2">
|
||||
<vm_type>POST_RT_VM</vm_type>
|
||||
<name>POST_RT_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>GUEST_FLAG_LAPIC_PASSTHROUGH</guest_flag>
|
||||
<guest_flag>GUEST_FLAG_RT</guest_flag>
|
||||
@ -190,6 +192,7 @@
|
||||
</vm>
|
||||
<vm id="3">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM2</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -229,6 +232,7 @@
|
||||
</vm>
|
||||
<vm id="4">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM3</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -268,6 +272,7 @@
|
||||
</vm>
|
||||
<vm id="5">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM4</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -307,6 +312,7 @@
|
||||
</vm>
|
||||
<vm id="6">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM5</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -344,40 +350,4 @@
|
||||
</communication_vuart>
|
||||
<PTM>n</PTM>
|
||||
</vm>
|
||||
<vm id="7">
|
||||
<vm_type>KATA_VM</vm_type>
|
||||
<cpu_affinity>
|
||||
<pcpu_id>0</pcpu_id>
|
||||
<pcpu_id>1</pcpu_id>
|
||||
</cpu_affinity>
|
||||
<clos>
|
||||
<vcpu_clos>0</vcpu_clos>
|
||||
<vcpu_clos>0</vcpu_clos>
|
||||
</clos>
|
||||
<epc_section>
|
||||
<base>0</base>
|
||||
<size>0</size>
|
||||
</epc_section>
|
||||
<legacy_vuart id="0">
|
||||
<type>VUART_LEGACY_PIO</type>
|
||||
<base>INVALID_COM_BASE</base>
|
||||
<irq>COM1_IRQ</irq>
|
||||
</legacy_vuart>
|
||||
<legacy_vuart id="1">
|
||||
<type>VUART_LEGACY_PIO</type>
|
||||
<base>INVALID_COM_BASE</base>
|
||||
<irq>COM2_IRQ</irq>
|
||||
<target_vm_id>0</target_vm_id>
|
||||
<target_uart_id>0</target_uart_id>
|
||||
</legacy_vuart>
|
||||
<console_vuart id="0">
|
||||
<base>INVALID_PCI_BASE</base>
|
||||
</console_vuart>
|
||||
<communication_vuart id="1">
|
||||
<base>INVALID_PCI_BASE</base>
|
||||
<target_vm_id>1</target_vm_id>
|
||||
<target_uart_id>1</target_uart_id>
|
||||
</communication_vuart>
|
||||
<PTM>n</PTM>
|
||||
</vm>
|
||||
</acrn-config>
|
||||
|
@ -60,7 +60,7 @@
|
||||
|
||||
<vm id="0">
|
||||
<vm_type>SERVICE_VM</vm_type>
|
||||
<name>ACRN Service VM</name>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -110,6 +110,7 @@
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
|
@ -59,7 +59,7 @@
|
||||
|
||||
<vm id="0">
|
||||
<vm_type>SAFETY_VM</vm_type>
|
||||
<name>ACRN PRE-LAUNCHED VM0</name>
|
||||
<name>SAFETY_VM0</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -115,7 +115,7 @@
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<vm_type>SERVICE_VM</vm_type>
|
||||
<name>ACRN Service VM</name>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -172,6 +172,7 @@
|
||||
</vm>
|
||||
<vm id="2">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
|
@ -59,7 +59,7 @@
|
||||
|
||||
<vm id="0">
|
||||
<vm_type>PRE_RT_VM</vm_type>
|
||||
<name>ACRN PRE-LAUNCHED VM0</name>
|
||||
<name>PRE_RT_VM0</name>
|
||||
<guest_flags>
|
||||
<guest_flag>GUEST_FLAG_LAPIC_PASSTHROUGH</guest_flag>
|
||||
<guest_flag>GUEST_FLAG_RT</guest_flag>
|
||||
@ -122,7 +122,7 @@
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<vm_type>SERVICE_VM</vm_type>
|
||||
<name>ACRN Service VM</name>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -177,6 +177,7 @@
|
||||
</vm>
|
||||
<vm id="2">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -216,6 +217,7 @@
|
||||
</vm>
|
||||
<vm id="3">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM2</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
|
@ -59,7 +59,7 @@
|
||||
|
||||
<vm id="0">
|
||||
<vm_type>PRE_STD_VM</vm_type>
|
||||
<name>ACRN PRE-LAUNCHED VM0</name>
|
||||
<name>PRE_STD_VM0</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -121,7 +121,7 @@
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<vm_type>PRE_STD_VM</vm_type>
|
||||
<name>ACRN PRE-LAUNCHED VM1</name>
|
||||
<name>PRE_STD_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
|
@ -59,7 +59,7 @@
|
||||
|
||||
<vm id="0">
|
||||
<vm_type>SERVICE_VM</vm_type>
|
||||
<name>ACRN Service VM</name>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -109,6 +109,7 @@
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -146,38 +147,4 @@
|
||||
</communication_vuart>
|
||||
<PTM>n</PTM>
|
||||
</vm>
|
||||
<vm id="2">
|
||||
<vm_type>KATA_VM</vm_type>
|
||||
<cpu_affinity>
|
||||
<pcpu_id>3</pcpu_id>
|
||||
</cpu_affinity>
|
||||
<clos>
|
||||
<vcpu_clos>0</vcpu_clos>
|
||||
</clos>
|
||||
<epc_section>
|
||||
<base>0</base>
|
||||
<size>0</size>
|
||||
</epc_section>
|
||||
<legacy_vuart id="0">
|
||||
<type>VUART_LEGACY_PIO</type>
|
||||
<base>INVALID_COM_BASE</base>
|
||||
<irq>COM1_IRQ</irq>
|
||||
</legacy_vuart>
|
||||
<legacy_vuart id="1">
|
||||
<type>VUART_LEGACY_PIO</type>
|
||||
<base>INVALID_COM_BASE</base>
|
||||
<irq>COM2_IRQ</irq>
|
||||
<target_vm_id>0</target_vm_id>
|
||||
<target_uart_id>0</target_uart_id>
|
||||
</legacy_vuart>
|
||||
<console_vuart id="0">
|
||||
<base>INVALID_PCI_BASE</base>
|
||||
</console_vuart>
|
||||
<communication_vuart id="1">
|
||||
<base>INVALID_PCI_BASE</base>
|
||||
<target_vm_id>1</target_vm_id>
|
||||
<target_uart_id>1</target_uart_id>
|
||||
</communication_vuart>
|
||||
<PTM>n</PTM>
|
||||
</vm>
|
||||
</acrn-config>
|
||||
|
@ -59,7 +59,7 @@
|
||||
|
||||
<vm id="0">
|
||||
<vm_type>SERVICE_VM</vm_type>
|
||||
<name>ACRN Service VM</name>
|
||||
<name>ACRN_Service_VM</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -110,6 +110,7 @@
|
||||
</vm>
|
||||
<vm id="1">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -148,6 +149,7 @@
|
||||
</vm>
|
||||
<vm id="2">
|
||||
<vm_type>POST_RT_VM</vm_type>
|
||||
<name>POST_RT_VM1</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -187,6 +189,7 @@
|
||||
</vm>
|
||||
<vm id="3">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM2</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -226,6 +229,7 @@
|
||||
</vm>
|
||||
<vm id="4">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM3</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -265,6 +269,7 @@
|
||||
</vm>
|
||||
<vm id="5">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM4</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -304,6 +309,7 @@
|
||||
</vm>
|
||||
<vm id="6">
|
||||
<vm_type>POST_STD_VM</vm_type>
|
||||
<name>POST_STD_VM5</name>
|
||||
<guest_flags>
|
||||
<guest_flag>0</guest_flag>
|
||||
</guest_flags>
|
||||
@ -341,40 +347,4 @@
|
||||
</communication_vuart>
|
||||
<PTM>n</PTM>
|
||||
</vm>
|
||||
<vm id="7">
|
||||
<vm_type>KATA_VM</vm_type>
|
||||
<cpu_affinity>
|
||||
<pcpu_id>0</pcpu_id>
|
||||
<pcpu_id>1</pcpu_id>
|
||||
</cpu_affinity>
|
||||
<clos>
|
||||
<vcpu_clos>0</vcpu_clos>
|
||||
<vcpu_clos>0</vcpu_clos>
|
||||
</clos>
|
||||
<epc_section>
|
||||
<base>0</base>
|
||||
<size>0</size>
|
||||
</epc_section>
|
||||
<legacy_vuart id="0">
|
||||
<type>VUART_LEGACY_PIO</type>
|
||||
<base>INVALID_COM_BASE</base>
|
||||
<irq>COM1_IRQ</irq>
|
||||
</legacy_vuart>
|
||||
<legacy_vuart id="1">
|
||||
<type>VUART_LEGACY_PIO</type>
|
||||
<base>INVALID_COM_BASE</base>
|
||||
<irq>COM2_IRQ</irq>
|
||||
<target_vm_id>0</target_vm_id>
|
||||
<target_uart_id>0</target_uart_id>
|
||||
</legacy_vuart>
|
||||
<console_vuart id="0">
|
||||
<base>INVALID_PCI_BASE</base>
|
||||
</console_vuart>
|
||||
<communication_vuart id="1">
|
||||
<base>INVALID_PCI_BASE</base>
|
||||
<target_vm_id>1</target_vm_id>
|
||||
<target_uart_id>1</target_uart_id>
|
||||
</communication_vuart>
|
||||
<PTM>n</PTM>
|
||||
</vm>
|
||||
</acrn-config>
|
||||
|
@ -558,12 +558,10 @@ def dm_arg_set(names, sel, virt_io, dm, sriov, vmid, config):
|
||||
|
||||
boot_image_type(dm, vmid, config)
|
||||
|
||||
# uuid get
|
||||
sos_vmid = launch_cfg_lib.get_sos_vmid()
|
||||
scenario_uuid = launch_cfg_lib.get_scenario_uuid(vmid, sos_vmid)
|
||||
|
||||
# clearlinux/android/alios
|
||||
print('acrn-dm -A -m $mem_size -s 0:0,hostbridge -U {} \\'.format(scenario_uuid), file=config)
|
||||
print('acrn-dm -A -m $mem_size -s 0:0,hostbridge \\', file=config)
|
||||
if launch_cfg_lib.is_linux_like(user_vm_type) or user_vm_type in ("ANDROID", "ALIOS"):
|
||||
if user_vm_type in ("ANDROID", "ALIOS"):
|
||||
print(' $npk_virt \\', file=config)
|
||||
|
@ -38,7 +38,7 @@ BOARD_INFO_FILE = ""
|
||||
SCENARIO_INFO_FILE = ""
|
||||
LAUNCH_INFO_FILE = ""
|
||||
VM_TYPES = {}
|
||||
MAX_VM_NUM = 8
|
||||
MAX_VM_NUM = 32
|
||||
|
||||
MAX_VUART_NUM = 8
|
||||
|
||||
|
@ -208,28 +208,6 @@ def is_config_file_match():
|
||||
return (err_dic, match)
|
||||
|
||||
|
||||
def get_vm_uuid_idx(vm_type, user_vmid):
|
||||
|
||||
i_cnt = 0
|
||||
for vm_i,vm_t in common.VM_TYPES.items():
|
||||
if vm_t == vm_type and vm_i <= user_vmid:
|
||||
i_cnt += 1
|
||||
if i_cnt > 0:
|
||||
i_cnt -= 1
|
||||
|
||||
return i_cnt
|
||||
|
||||
|
||||
def get_scenario_uuid(user_vmid, sos_vmid):
|
||||
# {id_num:uuid} (id_num:0~max)
|
||||
scenario_uuid = ''
|
||||
vm_id = user_vmid + sos_vmid
|
||||
i_cnt = get_vm_uuid_idx(common.VM_TYPES[vm_id], vm_id)
|
||||
scenario_uuid = scenario_cfg_lib.VM_DB[common.VM_TYPES[vm_id]]['uuid'][i_cnt]
|
||||
return scenario_uuid
|
||||
|
||||
|
||||
|
||||
def get_sos_vmid():
|
||||
|
||||
sos_id = ''
|
||||
@ -627,7 +605,7 @@ def set_shm_regions(launch_item_values, scenario_info):
|
||||
for vm_id, vm_type in vm_types.items():
|
||||
if vm_type in ['SERVICE_VM']:
|
||||
sos_vm_id = vm_id
|
||||
elif vm_type in ['POST_STD_VM', 'POST_RT_VM', 'KATA_VM']:
|
||||
elif vm_type in ['POST_STD_VM', 'POST_RT_VM']:
|
||||
user_vmid = vm_id - sos_vm_id
|
||||
shm_region_key = 'user_vm:id={},shm_regions,shm_region'.format(user_vmid)
|
||||
launch_item_values[shm_region_key] = ['']
|
||||
|
@ -38,33 +38,20 @@ COMMUNICATE_VM_ID = []
|
||||
|
||||
ERR_LIST = {}
|
||||
|
||||
KATA_VM_COUNT = 0
|
||||
PT_SUB_PCI = {}
|
||||
PT_SUB_PCI['ethernet'] = ['Ethernet controller', 'Network controller', '802.1a controller',
|
||||
'802.1b controller', 'Wireless controller']
|
||||
PT_SUB_PCI['sata'] = ['SATA controller']
|
||||
PT_SUB_PCI['nvme'] = ['Non-Volatile memory controller']
|
||||
PT_SUB_PCI['usb'] = ['USB controller']
|
||||
UUID_DB = {
|
||||
'SERVICE_VM':['dbbbd434-7a57-4216-a12c-2201f1ab0240'],
|
||||
'SAFETY_VM':['fc836901-8685-4bc0-8b71-6e31dc36fa47'],
|
||||
'PRE_STD_VM':['26c5e0d8-8f8a-47d8-8109-f201ebd61a5e', 'dd87ce08-66f9-473d-bc58-7605837f935e'],
|
||||
'POST_STD_VM':['d2795438-25d6-11e8-864e-cb7a18b34643', '615db82a-e189-4b4f-8dbb-d321343e4ab3',
|
||||
'38158821-5208-4005-b72a-8a609e4190d0', 'a6750180-f87a-48d2-91d9-4e7f62b6519e', 'd1816e4a-a9bb-4cb4-a066-3f1a8a5ce73f'],
|
||||
'POST_RT_VM':['495ae2e5-2603-4d64-af76-d4bc5a8ec0e5'],
|
||||
'KATA_VM':['a7ada506-1ab0-4b6b-a0da-e513ca9b8c2f'],
|
||||
'PRE_RT_VM':['b2a92bec-ca6b-11ea-b106-3716a8ba0bb9'],
|
||||
}
|
||||
|
||||
VM_DB = {
|
||||
'SERVICE_VM':{'load_type':'SERVICE_VM', 'severity':'SEVERITY_SERVICE_VM', 'uuid':UUID_DB['SERVICE_VM']},
|
||||
'SAFETY_VM':{'load_type':'PRE_LAUNCHED_VM', 'severity':'SEVERITY_SAFETY_VM', 'uuid':UUID_DB['SAFETY_VM']},
|
||||
'PRE_RT_VM':{'load_type':'PRE_LAUNCHED_VM', 'severity':'SEVERITY_RTVM', 'uuid':UUID_DB['PRE_RT_VM']},
|
||||
'PRE_STD_VM':{'load_type':'PRE_LAUNCHED_VM', 'severity':'SEVERITY_STANDARD_VM', 'uuid':UUID_DB['PRE_STD_VM']},
|
||||
'POST_STD_VM':{'load_type':'POST_LAUNCHED_VM', 'severity':'SEVERITY_STANDARD_VM', 'uuid':UUID_DB['POST_STD_VM']},
|
||||
'POST_RT_VM':{'load_type':'POST_LAUNCHED_VM', 'severity':'SEVERITY_RTVM', 'uuid':UUID_DB['POST_RT_VM']},
|
||||
'KATA_VM':{'load_type':'POST_LAUNCHED_VM', 'severity':'SEVERITY_STANDARD_VM', 'uuid':UUID_DB['KATA_VM']},
|
||||
'PRE_RT_VM':{'load_type':'PRE_LAUNCHED_VM', 'severity':'SEVERITY_RTVM', 'uuid':UUID_DB['PRE_RT_VM']},
|
||||
'SERVICE_VM':{'load_type':'SERVICE_VM', 'severity':'SEVERITY_SERVICE_VM'},
|
||||
'SAFETY_VM':{'load_type':'PRE_LAUNCHED_VM', 'severity':'SEVERITY_SAFETY_VM'},
|
||||
'PRE_RT_VM':{'load_type':'PRE_LAUNCHED_VM', 'severity':'SEVERITY_RTVM'},
|
||||
'PRE_STD_VM':{'load_type':'PRE_LAUNCHED_VM', 'severity':'SEVERITY_STANDARD_VM'},
|
||||
'POST_STD_VM':{'load_type':'POST_LAUNCHED_VM', 'severity':'SEVERITY_STANDARD_VM'},
|
||||
'POST_RT_VM':{'load_type':'POST_LAUNCHED_VM', 'severity':'SEVERITY_RTVM'},
|
||||
'PRE_RT_VM':{'load_type':'PRE_LAUNCHED_VM', 'severity':'SEVERITY_RTVM'},
|
||||
}
|
||||
LOAD_VM_TYPE = list(VM_DB.keys())
|
||||
|
||||
@ -246,11 +233,9 @@ def load_vm_check(load_vms, item):
|
||||
:param item: vm name item in xml
|
||||
:return: None
|
||||
"""
|
||||
global KATA_VM_COUNT
|
||||
sos_vm_ids = []
|
||||
pre_vm_ids = []
|
||||
post_vm_ids = []
|
||||
kata_vm_ids = []
|
||||
rt_vm_ids = []
|
||||
for order_i, load_str in load_vms.items():
|
||||
if not load_str:
|
||||
@ -271,39 +256,14 @@ def load_vm_check(load_vms, item):
|
||||
if "POST_STD_VM" == load_str:
|
||||
post_vm_ids.append(order_i)
|
||||
|
||||
if "KATA_VM" == load_str:
|
||||
kata_vm_ids.append(order_i)
|
||||
|
||||
if "POST_RT_VM" == load_str:
|
||||
rt_vm_ids.append(order_i)
|
||||
|
||||
KATA_VM_COUNT = len(kata_vm_ids)
|
||||
if len(kata_vm_ids) > len(UUID_DB["KATA_VM"]):
|
||||
key = "vm:id={},{}".format(kata_vm_ids[0], item)
|
||||
ERR_LIST[key] = "KATA VM number should not be greater than {}".format(len(UUID_DB["KATA_VM"]))
|
||||
return
|
||||
|
||||
if len(rt_vm_ids) > len(UUID_DB["POST_RT_VM"]):
|
||||
key = "vm:id={},{}".format(rt_vm_ids[0], item)
|
||||
ERR_LIST[key] = "POST RT VM number should not be greater than {}".format(len(UUID_DB["POST_RT_VM"]))
|
||||
return
|
||||
|
||||
if len(sos_vm_ids) > 1:
|
||||
key = "vm:id={},{}".format(sos_vm_ids[0], item)
|
||||
ERR_LIST[key] = "Service VM number should not be greater than 1"
|
||||
return
|
||||
|
||||
if len(post_vm_ids) > len(UUID_DB["POST_STD_VM"]):
|
||||
key = "vm:id={},{}".format(post_vm_ids[0], item)
|
||||
ERR_LIST[key] = "POST Standard vm number should not be greater than {}".format(len(UUID_DB["POST_STD_VM"]))
|
||||
return
|
||||
|
||||
max_pre_launch_vms = len(UUID_DB["PRE_STD_VM"]) + len(UUID_DB["SAFETY_VM"]) + len(UUID_DB["PRE_RT_VM"])
|
||||
if len(pre_vm_ids) > max_pre_launch_vms:
|
||||
key = "vm:id={},{}".format(pre_vm_ids[0], item)
|
||||
ERR_LIST[key] = "PRE Launched VM number should not be greater than {}".format(max_pre_launch_vms)
|
||||
return
|
||||
|
||||
if post_vm_ids and sos_vm_ids:
|
||||
if post_vm_ids[0] < sos_vm_ids[-1]:
|
||||
key = "vm:id={},{}".format(post_vm_ids[0], item)
|
||||
|
@ -31,9 +31,6 @@ def get_pre_vm_type(vm_type, vm_i):
|
||||
|
||||
def get_post_vm_type(vm_type, vm_i):
|
||||
|
||||
if vm_type == "KATA_VM":
|
||||
return "CONFIG_KATA_VM(1)"
|
||||
|
||||
if vm_type == "POST_RT_VM":
|
||||
return "CONFIG_POST_RT_VM(1)"
|
||||
|
||||
|
@ -28,14 +28,12 @@ def scenario_vm_num(scenario_items, config):
|
||||
print("", file=config)
|
||||
print("/* SERVICE_VM_NUM can only be 0U or 1U;", file=config)
|
||||
print(" * When SERVICE_VM_NUM is 0U, MAX_POST_VM_NUM must be 0U too;", file=config)
|
||||
print(" * MAX_POST_VM_NUM must be bigger than CONFIG_MAX_KATA_VM_NUM;", file=config)
|
||||
print(" */", file=config)
|
||||
|
||||
load_type_cnt = scenario_items['vm'].load_order_cnt
|
||||
print("#define PRE_VM_NUM\t\t\t{}U".format(load_type_cnt.pre_vm), file=config)
|
||||
print("#define SERVICE_VM_NUM\t\t\t{}U".format(load_type_cnt.sos_vm), file=config)
|
||||
print("#define MAX_POST_VM_NUM\t\t\t{}U".format(load_type_cnt.post_vm), file=config)
|
||||
print("#define CONFIG_MAX_KATA_VM_NUM\t\t{}U".format(scenario_cfg_lib.KATA_VM_COUNT), file=config)
|
||||
|
||||
|
||||
def gen_pre_launch_vm(scenario_items, config):
|
||||
|
@ -12,8 +12,7 @@
|
||||
- ``PRE_RT_VM`` pre-launched real-time capable VM
|
||||
- ``SERVICE_VM`` pre-launched Service VM
|
||||
- ``POST_STD_VM`` post-launched Standard VM
|
||||
- ``POST_RT_VM`` post-launched real-time capable VM
|
||||
- ``KATA_VM`` post-launched Kata Container VM</xs:documentation>
|
||||
- ``POST_RT_VM`` post-launched real-time capable VM</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="SERVICE_VM" />
|
||||
@ -22,7 +21,6 @@
|
||||
<xs:enumeration value="PRE_STD_VM" />
|
||||
<xs:enumeration value="POST_STD_VM" />
|
||||
<xs:enumeration value="POST_RT_VM" />
|
||||
<xs:enumeration value="KATA_VM" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
|
@ -247,11 +247,6 @@ initialization.</xs:documentation>
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="MAX_KATA_VM_NUM" type="xs:integer" minOccurs="0" default="0">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Maximum number of KATA VM.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="MAX_PCI_DEV_NUM" default="96">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Maximum number of PCI devices.</xs:documentation>
|
||||
@ -349,7 +344,7 @@ If this value is empty, then the default value will be calculated from informati
|
||||
<xs:documentation>Specify the VM type.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="name" minOccurs="0">
|
||||
<xs:element name="name">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Specify the VM name shown in the
|
||||
hypervisor console ``vm_list`` command.</xs:documentation>
|
||||
@ -360,7 +355,8 @@ hypervisor console ``vm_list`` command.</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:minLength value="1" />
|
||||
<xs:maxLength value="32" />
|
||||
<xs:maxLength value="15" />
|
||||
<xs:pattern value="\S+" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
@ -557,6 +553,11 @@ to launch post-launched User VMs.</xs:documentation>
|
||||
|
||||
</xs:complexType>
|
||||
|
||||
<xs:element name="acrn-config" type="ACRNConfigType" />
|
||||
<xs:element name="acrn-config" type="ACRNConfigType">
|
||||
<xs:unique name="vmNameUnique">
|
||||
<xs:selector xpath="vm"/>
|
||||
<xs:field xpath="name"/>
|
||||
</xs:unique>
|
||||
</xs:element>
|
||||
|
||||
</xs:schema>
|
||||
|
@ -12,7 +12,7 @@ import common, board_cfg_lib
|
||||
from collections import namedtuple
|
||||
|
||||
PRE_LAUNCHED_VMS_TYPE = ["SAFETY_VM", "PRE_RT_VM", "PRE_STD_VM"]
|
||||
POST_LAUNCHED_VMS_TYPE = ["POST_STD_VM", "POST_RT_VM", "KATA_VM"]
|
||||
POST_LAUNCHED_VMS_TYPE = ["POST_STD_VM", "POST_RT_VM"]
|
||||
SERVICE_VM_TYPE = ["SERVICE_VM"]
|
||||
|
||||
class BusDevFunc(namedtuple(
|
||||
|
@ -471,21 +471,6 @@
|
||||
<xsl:when test="$vm_type = 'POST_RT_VM'">
|
||||
<func:result select="true()" />
|
||||
</xsl:when>
|
||||
<xsl:when test="$vm_type = 'KATA_VM'">
|
||||
<func:result select="true()" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<func:result select="false()" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</func:function>
|
||||
|
||||
<func:function name="acrn:is-kata-vm">
|
||||
<xsl:param name="vm_type" />
|
||||
<xsl:choose>
|
||||
<xsl:when test="$vm_type = 'KATA_VM'">
|
||||
<func:result select="true()" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<func:result select="false()" />
|
||||
</xsl:otherwise>
|
||||
|
@ -37,12 +37,11 @@
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name ="vm_count">
|
||||
<xsl:value-of select="acrn:comment('SERVICE_VM_NUM can only be 0U or 1U; When SERVICE_VM_NUM is 0U, MAX_POST_VM_NUM must be 0U too; MAX_POST_VM_NUM must be bigger than CONFIG_MAX_KATA_VM_NUM.')" />
|
||||
<xsl:value-of select="acrn:comment('SERVICE_VM_NUM can only be 0 or 1; When SERVICE_VM_NUM is 1, MAX_POST_VM_NUM must be 0 too.')" />
|
||||
<xsl:value-of select="$newline" />
|
||||
<xsl:value-of select="acrn:define('PRE_VM_NUM', count(vm[acrn:is-pre-launched-vm(vm_type)]), 'U')" />
|
||||
<xsl:value-of select="acrn:define('SERVICE_VM_NUM', count(vm[acrn:is-sos-vm(vm_type)]), 'U')" />
|
||||
<xsl:value-of select="acrn:define('MAX_POST_VM_NUM', count(vm[acrn:is-post-launched-vm(vm_type)]), 'U')" />
|
||||
<xsl:value-of select="acrn:define('CONFIG_MAX_KATA_VM_NUM', count(vm[acrn:is-kata-vm(vm_type)]), 'U')" />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name ="dm_guest_flag">
|
||||
|
Loading…
Reference in New Issue
Block a user