Skip to content

Commit bcfbc13

Browse files
szhen11wenlingz
authored andcommitted
acrn-config: add attributes for scenario and launch setting
There are no board/scenario/uos_launcher attributes for created scenario and launch settings, which causes xml mismatch error when generating configuration files or launch scripts. This patch is to add the attributes for scearnio and launch settings. Tracked-On: #4641 Signed-off-by: Shuang Zheng <shuang.zheng@intel.com> Acked-by: Terry Zou <terry.zou@intel.com>
1 parent 3799b95 commit bcfbc13

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

misc/acrn-config/config_app/views.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def save_scenario():
204204
break
205205
for vm in generic_scenario_config_root.getchildren():
206206
if vm.tag == 'vm':
207-
for i in range(0, 7):
207+
for i in range(0, 8):
208208
if str(i) not in vm_list:
209209
break
210210
vm.attrib['id'] = str(i)
@@ -216,6 +216,9 @@ def save_scenario():
216216
remove_vm_id = generator.split(':')[1]
217217
scenario_config.delete_curr_key('vm:id='+remove_vm_id.strip())
218218

219+
scenario_config.set_curr_attr('board', board_type)
220+
scenario_config.set_curr_attr('scenario', scenario_config_data['new_scenario_name'])
221+
219222
tmp_scenario_file = os.path.join(scenario_path, 'user_defined',
220223
'tmp_'+scenario_config_data['new_scenario_name']+'.xml')
221224
# if os.path.isfile(tmp_scenario_file):
@@ -305,12 +308,7 @@ def save_launch():
305308
break
306309
vm.attrib['id'] = str(i)
307310
vm_to_add.append(vm)
308-
# print('-'*100)
309-
# print(generator)
310-
# print(vm_list)
311-
# print(curr_vm_id)
312-
# print(curr_vm_index)
313-
# print(i)
311+
314312
for vm in vm_to_add:
315313
launch_config.insert_curr_elem(curr_vm_index, vm)
316314
elif generator.startswith('remove_vm:'):
@@ -322,6 +320,9 @@ def save_launch():
322320
current_app.config.get('BOARD_TYPE'),
323321
'user_defined', scenario_name + '.xml')
324322
launch_config.set_curr_attr('scenario', scenario_name)
323+
launch_config.set_curr_attr('board', current_app.config.get('BOARD_TYPE'))
324+
325+
launch_config.set_curr_attr('uos_launcher', str(len(launch_config.get_curr_root().getchildren())))
325326

326327
tmp_launch_file = os.path.join(current_app.config.get('CONFIG_PATH'), xml_configs[1],
327328
'user_defined',

0 commit comments

Comments
 (0)