mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-22 05:30:24 +00:00
acrn-config: add max VM count check when generating scenario XML file
Add max VM count check when generating scenario XML file. Tracked-On: #4641 Signed-off-by: Wei Liu <weix.w.liu@intel.com> Acked-by: Victor Sun <victor.sun@intel.com> Acked-by: Terry Zou <terry.zou@intel.com>
This commit is contained in:
parent
1d4b7ab89a
commit
3799b95be5
@ -42,6 +42,11 @@ def main(args):
|
|||||||
common.get_vm_num(params['--scenario'])
|
common.get_vm_num(params['--scenario'])
|
||||||
common.get_vm_types()
|
common.get_vm_types()
|
||||||
|
|
||||||
|
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)
|
||||||
|
return err_dic
|
||||||
|
|
||||||
|
# check if this is the scenario config which matched board info
|
||||||
# get board name
|
# get board name
|
||||||
(err_dic, board) = common.get_board_name()
|
(err_dic, board) = common.get_board_name()
|
||||||
if err_dic:
|
if err_dic:
|
||||||
@ -99,7 +104,7 @@ def main(args):
|
|||||||
return err_dic
|
return err_dic
|
||||||
|
|
||||||
|
|
||||||
def ui_entry_api(board_info, scenario_info, out):
|
def ui_entry_api(board_info, scenario_info, out=''):
|
||||||
|
|
||||||
arg_list = ['board_cfg_gen.py', '--board', board_info, '--scenario', scenario_info, '--out', out]
|
arg_list = ['board_cfg_gen.py', '--board', board_info, '--scenario', scenario_info, '--out', out]
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ def sos_bootarg_diff(sos_cmdlines, config):
|
|||||||
i += 1
|
i += 1
|
||||||
if i == 1:
|
if i == 1:
|
||||||
if sos_len == 1:
|
if sos_len == 1:
|
||||||
print('#define SOS_BOOTARGS_DIFF\t{}'.format(sos_cmdline), file=config)
|
print('#define SOS_BOOTARGS_DIFF\t"{}"'.format(sos_cmdline.strip('"')), file=config)
|
||||||
else:
|
else:
|
||||||
print('#define SOS_BOOTARGS_DIFF\t"{} " \\'.format(sos_cmdline), file=config)
|
print('#define SOS_BOOTARGS_DIFF\t"{} " \\'.format(sos_cmdline), file=config)
|
||||||
else:
|
else:
|
||||||
|
@ -86,7 +86,7 @@ def validate_launch_setting(board_info, scenario_info, launch_info):
|
|||||||
return (launch_cfg_lib.ERR_LIST, pt_sel, virtio, dm)
|
return (launch_cfg_lib.ERR_LIST, pt_sel, virtio, dm)
|
||||||
|
|
||||||
|
|
||||||
def ui_entry_api(board_info, scenario_info, launch_info, out):
|
def ui_entry_api(board_info, scenario_info, launch_info, out=''):
|
||||||
|
|
||||||
err_dic = {}
|
err_dic = {}
|
||||||
arg_list = ['launch_cfg_gen.py', '--board', board_info, '--scenario', scenario_info, '--launch', launch_info, '--uosid', '0', '--out', out]
|
arg_list = ['launch_cfg_gen.py', '--board', board_info, '--scenario', scenario_info, '--launch', launch_info, '--uosid', '0', '--out', out]
|
||||||
|
@ -32,6 +32,7 @@ BOARD_INFO_FILE = ""
|
|||||||
SCENARIO_INFO_FILE = ""
|
SCENARIO_INFO_FILE = ""
|
||||||
LAUNCH_INFO_FILE = ""
|
LAUNCH_INFO_FILE = ""
|
||||||
VM_TYPES = {}
|
VM_TYPES = {}
|
||||||
|
MAX_VM_NUM = 8
|
||||||
|
|
||||||
class MultiItem():
|
class MultiItem():
|
||||||
|
|
||||||
@ -352,7 +353,7 @@ def get_leaf_tag_map(config_file, branch_tag, tag_str=''):
|
|||||||
|
|
||||||
get_sub_value(tmp, tag_str, vm_id)
|
get_sub_value(tmp, tag_str, vm_id)
|
||||||
|
|
||||||
return tmp.tag
|
return dict(sorted(tmp.tag.items()))
|
||||||
|
|
||||||
|
|
||||||
def get_hv_item_tag(config_file, branch_tag, tag_str=''):
|
def get_hv_item_tag(config_file, branch_tag, tag_str=''):
|
||||||
|
@ -47,7 +47,7 @@ def get_scenario_item_values(board_info, scenario_info):
|
|||||||
scenario_item_values["vm,vcpu_affinity"] = hw_info.get_processor_val()
|
scenario_item_values["vm,vcpu_affinity"] = hw_info.get_processor_val()
|
||||||
scenario_item_values["vm,guest_flags"] = guest_flags
|
scenario_item_values["vm,guest_flags"] = guest_flags
|
||||||
scenario_item_values["vm,clos"] = hw_info.get_clos_val()
|
scenario_item_values["vm,clos"] = hw_info.get_clos_val()
|
||||||
scenario_item_values["vm,pci_devs,pci_dev"] = scenario_cfg_lib.avl_pci_devs()
|
scenario_item_values["vm,pci_devs"] = scenario_cfg_lib.avl_pci_devs()
|
||||||
scenario_item_values["vm,os_config,kern_type"] = scenario_cfg_lib.KERN_TYPE_LIST
|
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))
|
scenario_item_values.update(scenario_cfg_lib.avl_vuart_ui_select(scenario_info))
|
||||||
|
|
||||||
@ -136,6 +136,10 @@ def main(args):
|
|||||||
if err_dic:
|
if err_dic:
|
||||||
return err_dic
|
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)
|
||||||
|
return err_dic
|
||||||
|
|
||||||
# check if this is the scenario config which matched board info
|
# check if this is the scenario config which matched board info
|
||||||
(err_dic, status) = common.is_config_file_match()
|
(err_dic, status) = common.is_config_file_match()
|
||||||
if not status:
|
if not status:
|
||||||
@ -203,7 +207,7 @@ def main(args):
|
|||||||
return err_dic
|
return err_dic
|
||||||
|
|
||||||
|
|
||||||
def ui_entry_api(board_info, scenario_info, out):
|
def ui_entry_api(board_info, scenario_info, out=''):
|
||||||
|
|
||||||
arg_list = ['board_cfg_gen.py', '--board', board_info, '--scenario', scenario_info, '--out', out]
|
arg_list = ['board_cfg_gen.py', '--board', board_info, '--scenario', scenario_info, '--out', out]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user