acrn-config: fix build issue for mrb board

Add missing IVSHMEM tag in mrb board xml file to fix build issue

Correct misspelled function name

Use better error messages

Tracked-On: #5221
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
This commit is contained in:
dongshen 2020-08-23 17:05:46 -07:00 committed by wenlingz
parent 58a71b67ab
commit 678d8c1665
4 changed files with 26 additions and 20 deletions

View File

@ -30,10 +30,10 @@ def empty_check(val, prime_item, item, sub_item=''):
if not val or val == None:
if sub_item:
key = 'hv,{},{},{}'.format(prime_item, item, sub_item)
ERR_LIST[key] = "{} should not empty".format(sub_item)
ERR_LIST[key] = "{} should not be empty".format(sub_item)
else:
key = 'hv,{},{}'.format(prime_item, item)
ERR_LIST[key] = "{} should not empty".format(item)
ERR_LIST[key] = "{} should not be empty".format(item)
return True
return False

View File

@ -27,8 +27,10 @@ GEN_FILE = ["vm_configurations.h", "vm_configurations.c", "pci_dev.c", ".config"
def get_scenario_item_values(board_info, scenario_info):
"""
Get items which capable multi select for user
:param board_info: it is a file what contains board information for script to read from
Glue code to provide user selectable options to config UI tool.
Return a dictionary of key-value pairs containing features and corresponding lists of
user selectable values to the config UI tool.
:param board_info: file that contains board information
"""
hv_cfg_lib.ERR_LIST = {}
scenario_item_values = {}
@ -41,7 +43,7 @@ def get_scenario_item_values(board_info, scenario_info):
common.get_vm_num(scenario_info)
common.get_vm_types()
# pre scenario
# per scenario
guest_flags = copy.deepcopy(common.GUEST_FLAG)
guest_flags.remove('0UL')
scenario_item_values['vm,vm_type'] = scenario_cfg_lib.LOAD_VM_TYPE
@ -52,7 +54,7 @@ def get_scenario_item_values(board_info, scenario_info):
scenario_item_values["vm,os_config,kern_type"] = scenario_cfg_lib.KERN_TYPE_LIST
scenario_item_values.update(scenario_cfg_lib.avl_vuart_ui_select(scenario_info))
# pre board_private
# board
(scenario_item_values["vm,board_private,rootfs"], num) = board_cfg_lib.get_rootfs(board_info)
scenario_item_values["hv,DEBUG_OPTIONS,RELEASE"] = hv_cfg_lib.N_Y
@ -82,10 +84,10 @@ def get_scenario_item_values(board_info, scenario_info):
def validate_scenario_setting(board_info, scenario_info):
"""
This is validate the data setting from scenario xml
:param board_info: it is a file what contains board information for script to read from
:param scenario_info: it is a file what user have already setting to
:return: return a dictionary contain errors
Validate settings in scenario xml
:param board_info: board file
:param scenario_info: scenario file
:return: return a dictionary that contains errors
"""
hv_cfg_lib.ERR_LIST = {}
scenario_cfg_lib.ERR_LIST = {}
@ -111,8 +113,8 @@ def validate_scenario_setting(board_info, scenario_info):
def main(args):
"""
This is main function to start generate source code related with board
:param args: it is a command line args for the script
Generate board related source code
:param args: command line args
"""
err_dic = {}
@ -139,13 +141,13 @@ def main(args):
return err_dic
if common.VM_COUNT > common.MAX_VM_NUM:
err_dic['vm count'] = "The vm count in config xml should be less or equal {}!".format(common.MAX_VM_NUM)
err_dic['vm count'] = "Number of VMs in scenario xml file should be no greater than {}!".format(common.MAX_VM_NUM)
return err_dic
# check if this is the scenario config which matched board info
# check if this is the scenario config which matches board info
(err_dic, status) = common.is_config_file_match()
if not status:
err_dic['scenario config'] = "The board xml and scenario xml should be matched!"
err_dic['scenario config'] = "The board xml file does not match scenario xml file!"
return err_dic
if params['--out']:
@ -170,7 +172,7 @@ def main(args):
get_scenario_item_values(params['--board'], params['--scenario'])
(err_dic, scenario_items) = validate_scenario_setting(params['--board'], params['--scenario'])
if err_dic:
common.print_red("Validate the scenario item failure", err=True)
common.print_red("Scenario xml file validation failed:", err=True)
return err_dic
# generate board defconfig
@ -199,9 +201,9 @@ def main(args):
pci_dev_c.generate_file(scenario_items['vm'], config)
if not err_dic:
print("Scenario configurations for {} is generated successfully.".format(scenario))
print("Scenario configuration files were created successfully.")
else:
print("Scenario configurations for {} is generated failed.".format(scenario))
print("Failed to create scenario configuration files.")
return err_dic

View File

@ -382,7 +382,7 @@ def gen_post_launch_vm(vm_type, vm_i, scenario_items, config):
print("\t},", file=config)
def pre_launch_definiation(vm_info, config):
def pre_launch_definition(vm_info, config):
for vm_i,vm_type in common.VM_TYPES.items():
if scenario_cfg_lib.VM_DB[vm_type]['load_type'] not in ["PRE_LAUNCHED_VM", "POST_LAUNCHED_VM"]:
@ -404,7 +404,7 @@ def generate_file(scenario_items, config):
gen_source_header(config)
for vm_i,pci_dev_num in vm_info.cfg_pci.pci_dev_num.items():
if pci_dev_num >= 2:
pre_launch_definiation(vm_info, config)
pre_launch_definition(vm_info, config)
break
print("struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {", file=config)

View File

@ -27,6 +27,10 @@
<ACPI_PARSE_ENABLED desc="Enable ACPI runtime parsing.">y</ACPI_PARSE_ENABLED>
<L1D_VMENTRY_ENABLED desc="Enable L1 cache flush before VM entry.">n</L1D_VMENTRY_ENABLED>
<MCE_ON_PSC_DISABLED desc="Force to disable software workaround for Machine Check Error on Page Size Change.">n</MCE_ON_PSC_DISABLED>
<IVSHMEM desc="IVSHMEM configuration">
<IVSHMEM_ENABLED desc="Enable Share Memory between VMs by IVSHMEM.">n</IVSHMEM_ENABLED>
<IVSHMEM_REGION desc="the name, size, colon separated IDs of communication VMs of share memory region, separated by comma like this: hv:/shm_region_0, 0x200000, 0:2"></IVSHMEM_REGION>
</IVSHMEM>
</FEATURES>
<MEMORY>