acrn-config: modify the get_scenario_uuid function to use the right vmid

Fail to launch waag by the script generated by launch config on
hybrid_rt scenario, the get_scenario_uuid function should use the
vmid instad of the uosid to get the correct uuid.

Tracked-On: #5336

Signed-off-by: Shixiong Zhang <shixiongx.zhang@intel.com>
This commit is contained in:
Shixiong Zhang 2020-09-17 21:30:06 -04:00 committed by wenlingz
parent 5289a3eb97
commit 4d65064fd6
2 changed files with 5 additions and 4 deletions

View File

@ -551,8 +551,8 @@ def dm_arg_set(names, sel, virt_io, dm, vmid, config):
boot_image_type(dm, vmid, config)
# uuid get
scenario_uuid = launch_cfg_lib.get_scenario_uuid(vmid)
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)

View File

@ -214,11 +214,12 @@ def get_vm_uuid_idx(vm_type, uosid):
return i_cnt
def get_scenario_uuid(uosid):
def get_scenario_uuid(uosid, sos_vmid):
# {id_num:uuid} (id_num:0~max)
scenario_uuid = ''
i_cnt = get_vm_uuid_idx(common.VM_TYPES[uosid], uosid)
scenario_uuid = scenario_cfg_lib.VM_DB[common.VM_TYPES[uosid]]['uuid'][i_cnt]
vm_id = uosid + 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