mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-21 21:19:35 +00:00
acrn-config: remove the same parameters and functions from scenario_cfg_lib
Scenario config should relay on library/common.py and scenario_cfg_lib, then remove the duplicate parameters and functions. Tracked-On: #3854 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
8e3ede1adc
commit
7d827c4d35
@ -267,7 +267,6 @@ def get_vm_num(config_file):
|
|||||||
if item.tag == "vm":
|
if item.tag == "vm":
|
||||||
vm_count += 1
|
vm_count += 1
|
||||||
VM_COUNT = vm_count
|
VM_COUNT = vm_count
|
||||||
return vm_count
|
|
||||||
|
|
||||||
|
|
||||||
# TODO: This will be abandonment in future
|
# TODO: This will be abandonment in future
|
||||||
@ -382,7 +381,7 @@ def get_sub_value(tmp, tag_str, vm_id):
|
|||||||
tmp.tag[vm_id] = tmp.multi.vir_network
|
tmp.tag[vm_id] = tmp.multi.vir_network
|
||||||
|
|
||||||
|
|
||||||
def get_leaf_tag_map(config_file, branch_tag, tag_str):
|
def get_leaf_tag_map(config_file, branch_tag, tag_str=''):
|
||||||
"""
|
"""
|
||||||
This is get tag value by tag_str from config file
|
This is get tag value by tag_str from config file
|
||||||
:param config_file: it is a file what contains information for script to read from
|
:param config_file: it is a file what contains information for script to read from
|
||||||
|
@ -6,10 +6,7 @@
|
|||||||
import common
|
import common
|
||||||
import board_cfg_lib
|
import board_cfg_lib
|
||||||
|
|
||||||
SOURCE_ROOT_DIR = common.SOURCE_ROOT_DIR
|
|
||||||
HEADER_LICENSE = common.open_license()
|
HEADER_LICENSE = common.open_license()
|
||||||
BOARD_INFO_FILE = "board_info.txt"
|
|
||||||
SCENARIO_INFO_FILE = ""
|
|
||||||
|
|
||||||
LOAD_ORDER_TYPE = ['PRE_LAUNCHED_VM', 'SOS_VM', 'POST_LAUNCHED_VM']
|
LOAD_ORDER_TYPE = ['PRE_LAUNCHED_VM', 'SOS_VM', 'POST_LAUNCHED_VM']
|
||||||
START_HPA_LIST = ['0', '0x100000000', '0x120000000']
|
START_HPA_LIST = ['0', '0x100000000', '0x120000000']
|
||||||
@ -39,7 +36,6 @@ COMMUNICATE_VM_ID = []
|
|||||||
|
|
||||||
ERR_LIST = {}
|
ERR_LIST = {}
|
||||||
|
|
||||||
VM_COUNT = 0
|
|
||||||
DEFAULT_VM_COUNT = {
|
DEFAULT_VM_COUNT = {
|
||||||
'sdc':2,
|
'sdc':2,
|
||||||
'sdc2':4,
|
'sdc2':4,
|
||||||
@ -49,152 +45,10 @@ DEFAULT_VM_COUNT = {
|
|||||||
}
|
}
|
||||||
KATA_VM_COUNT = 0
|
KATA_VM_COUNT = 0
|
||||||
|
|
||||||
LEGACY_TTYS = {
|
|
||||||
'ttyS0':'0x3F8',
|
|
||||||
'ttyS1':'0x2F8',
|
|
||||||
'ttyS2':'0x3E8',
|
|
||||||
'ttyS3':'0x2E8',
|
|
||||||
}
|
|
||||||
|
|
||||||
def prepare():
|
|
||||||
""" Check environment """
|
|
||||||
return common.prepare()
|
|
||||||
|
|
||||||
|
|
||||||
def print_yel(msg, warn=False):
|
|
||||||
"""
|
|
||||||
Print the message with color of yellow
|
|
||||||
:param msg: the stings which will be output to STDOUT
|
|
||||||
:param warn: the condition if needs to be output the color of yellow with 'Warning'
|
|
||||||
"""
|
|
||||||
common.print_yel(msg, warn)
|
|
||||||
|
|
||||||
|
|
||||||
def print_red(msg, err=False):
|
|
||||||
"""
|
|
||||||
Print the message with color of red
|
|
||||||
:param msg: the stings which will be output to STDOUT
|
|
||||||
:param err: the condition if needs to be output the color of red with 'Error'
|
|
||||||
"""
|
|
||||||
common.print_red(msg, err)
|
|
||||||
|
|
||||||
|
|
||||||
def usage(file_name):
|
|
||||||
""" This is usage for how to use this tool """
|
|
||||||
common.usage(file_name)
|
|
||||||
|
|
||||||
|
|
||||||
def get_param(args):
|
|
||||||
"""
|
|
||||||
Get the script parameters from command line
|
|
||||||
:param args: this the command line of string for the script without script name
|
|
||||||
"""
|
|
||||||
return common.get_param(args)
|
|
||||||
|
|
||||||
|
|
||||||
def get_scenario_name():
|
|
||||||
"""
|
|
||||||
Get board name from scenario.xml at fist line
|
|
||||||
:param scenario_file: it is a file what contains scenario information for script to read from
|
|
||||||
"""
|
|
||||||
return common.get_scenario_name()
|
|
||||||
|
|
||||||
|
|
||||||
def is_config_file_match():
|
|
||||||
|
|
||||||
return common.is_config_file_match()
|
|
||||||
|
|
||||||
|
|
||||||
def get_info(board_info, msg_s, msg_e):
|
|
||||||
"""
|
|
||||||
Get information which specify by argument
|
|
||||||
:param board_info: it is a file what contains board information for script to read from
|
|
||||||
:param msg_s: it is a pattern of key stings what start to match from board information
|
|
||||||
:param msg_e: it is a pattern of key stings what end to match from board information
|
|
||||||
"""
|
|
||||||
info_lines = board_cfg_lib.get_info(board_info, msg_s, msg_e)
|
|
||||||
return info_lines
|
|
||||||
|
|
||||||
|
|
||||||
def get_processor_info(board_info):
|
|
||||||
"""
|
|
||||||
Get cpu core list
|
|
||||||
:param board_info: it is a file what contains board information for script to read from
|
|
||||||
:return: cpu processor which one cpu has
|
|
||||||
"""
|
|
||||||
processor_list = []
|
|
||||||
tmp_list = []
|
|
||||||
processor_info = board_cfg_lib.get_info(board_info, "<CPU_PROCESSOR_INFO>", "</CPU_PROCESSOR_INFO>")
|
|
||||||
|
|
||||||
if not processor_info:
|
|
||||||
key = "vm:id=0,vcpu_affinity"
|
|
||||||
ERR_LIST[key] = "CPU core is not exists"
|
|
||||||
return processor_list
|
|
||||||
|
|
||||||
for processor_line in processor_info:
|
|
||||||
if not processor_line:
|
|
||||||
break
|
|
||||||
|
|
||||||
processor_list = processor_line.strip().split(',')
|
|
||||||
for processor in processor_list:
|
|
||||||
tmp_list.append(processor.strip())
|
|
||||||
break
|
|
||||||
|
|
||||||
return tmp_list
|
|
||||||
|
|
||||||
|
|
||||||
def get_rootdev_info(board_info):
|
|
||||||
"""
|
|
||||||
Get root devices from board info
|
|
||||||
:param board_info: it is a file what contains board information for script to read from
|
|
||||||
:return: root devices list
|
|
||||||
"""
|
|
||||||
rootdev_list = []
|
|
||||||
rootdev_info = board_cfg_lib.get_info(board_info, "<BLOCK_DEVICE_INFO>", "</BLOCK_DEVICE_INFO>")
|
|
||||||
|
|
||||||
# none 'BLOCK_DEVICE_INFO' tag
|
|
||||||
if rootdev_info == None:
|
|
||||||
return rootdev_list
|
|
||||||
|
|
||||||
for rootdev_line in rootdev_info:
|
|
||||||
if not rootdev_line:
|
|
||||||
break
|
|
||||||
|
|
||||||
if not board_cfg_lib.handle_root_dev(rootdev_line):
|
|
||||||
continue
|
|
||||||
|
|
||||||
root_dev = rootdev_line.strip().split(':')[0]
|
|
||||||
rootdev_list.append(root_dev)
|
|
||||||
|
|
||||||
return rootdev_list
|
|
||||||
|
|
||||||
|
|
||||||
def get_ttys_info(board_info):
|
|
||||||
"""
|
|
||||||
Get ttySn from board info
|
|
||||||
:param board_info: it is a file what contains board information for script to read from
|
|
||||||
:return: serial console list
|
|
||||||
"""
|
|
||||||
ttys_list = []
|
|
||||||
ttys_info = board_cfg_lib.get_info(board_info, "<TTYS_INFO>", "</TTYS_INFO>")
|
|
||||||
|
|
||||||
for ttys_line in ttys_info:
|
|
||||||
if not ttys_line:
|
|
||||||
break
|
|
||||||
|
|
||||||
ttys_dev = ttys_line.split()[0].split(':')[1]
|
|
||||||
ttysn = ttys_dev.split('/')[-1]
|
|
||||||
# currently SOS console can only support legacy serial port
|
|
||||||
if ttysn not in list(LEGACY_TTYS.keys()):
|
|
||||||
continue
|
|
||||||
ttys_list.append(ttys_dev)
|
|
||||||
|
|
||||||
return ttys_list
|
|
||||||
|
|
||||||
|
|
||||||
def get_board_private_info(config_file):
|
def get_board_private_info(config_file):
|
||||||
|
|
||||||
(err_dic, scenario_name) = get_scenario_name()
|
(err_dic, scenario_name) = common.get_scenario_name()
|
||||||
|
|
||||||
if scenario_name == "logical_partition":
|
if scenario_name == "logical_partition":
|
||||||
branch_tag = "os_config"
|
branch_tag = "os_config"
|
||||||
@ -204,7 +58,7 @@ def get_board_private_info(config_file):
|
|||||||
private_info = {}
|
private_info = {}
|
||||||
dev_private_tags = ['rootfs', 'console']
|
dev_private_tags = ['rootfs', 'console']
|
||||||
for tag_str in dev_private_tags:
|
for tag_str in dev_private_tags:
|
||||||
dev_setting = get_sub_leaf_tag(config_file, branch_tag, tag_str)
|
dev_setting = common.get_sub_leaf_tag(config_file, branch_tag, tag_str)
|
||||||
if not dev_setting and tag_str == "console":
|
if not dev_setting and tag_str == "console":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -215,33 +69,13 @@ def get_board_private_info(config_file):
|
|||||||
|
|
||||||
def check_board_private_info():
|
def check_board_private_info():
|
||||||
|
|
||||||
(err_dic, private_info) = get_board_private_info(SCENARIO_INFO_FILE)
|
(err_dic, private_info) = get_board_private_info(common.SCENARIO_INFO_FILE)
|
||||||
|
|
||||||
if not private_info['rootfs'] and err_dic:
|
if not private_info['rootfs'] and err_dic:
|
||||||
ERR_LIST['vm:id=0,boot_private,rootfs'] = "The board have to chose one rootfs partition"
|
ERR_LIST['vm:id=0,boot_private,rootfs'] = "The board have to chose one rootfs partition"
|
||||||
ERR_LIST.update(err_dic)
|
ERR_LIST.update(err_dic)
|
||||||
|
|
||||||
|
|
||||||
def get_vm_num(config_file):
|
|
||||||
"""
|
|
||||||
This is get vm count
|
|
||||||
:param config_file: it is a file what contains vm information for script to read from
|
|
||||||
:return: number of vm
|
|
||||||
"""
|
|
||||||
return common.get_vm_num(config_file)
|
|
||||||
|
|
||||||
|
|
||||||
def get_sub_leaf_tag(config_file, branch_tag, tag_str=''):
|
|
||||||
"""
|
|
||||||
This is get tag value by tag_str from config file
|
|
||||||
:param config_file: it is a file what contains information for script to read from
|
|
||||||
:param branch_tag: it is key of patter to config file branch tag item
|
|
||||||
:param tag_str: it is key of pattern to config file leaf tag item
|
|
||||||
:return: value of tag_str item
|
|
||||||
"""
|
|
||||||
return common.get_sub_leaf_tag(config_file, branch_tag, tag_str)
|
|
||||||
|
|
||||||
|
|
||||||
def get_order_type_by_vmid(idx):
|
def get_order_type_by_vmid(idx):
|
||||||
"""
|
"""
|
||||||
Get load order by vm id
|
Get load order by vm id
|
||||||
@ -249,7 +83,7 @@ def get_order_type_by_vmid(idx):
|
|||||||
:param idx: index of vm id
|
:param idx: index of vm id
|
||||||
:return: load order type of index to vmid
|
:return: load order type of index to vmid
|
||||||
"""
|
"""
|
||||||
(err_dic, order_type) = common.get_load_order_by_vmid(SCENARIO_INFO_FILE, VM_COUNT, idx)
|
(err_dic, order_type) = common.get_load_order_by_vmid(common.SCENARIO_INFO_FILE, common.VM_COUNT, idx)
|
||||||
if err_dic:
|
if err_dic:
|
||||||
ERR_LIST.update(err_dic)
|
ERR_LIST.update(err_dic)
|
||||||
|
|
||||||
@ -375,17 +209,6 @@ def uuid_format_check(uuid_dic, item):
|
|||||||
ERR_LIST[key] = "VM uuid format unknown"
|
ERR_LIST[key] = "VM uuid format unknown"
|
||||||
|
|
||||||
|
|
||||||
def get_leaf_tag_map(info_file, prime_item, item=''):
|
|
||||||
"""
|
|
||||||
:param info_file: some configurations in the info file
|
|
||||||
:param prime_item: the prime item in xml file
|
|
||||||
:param item: the item in xml file
|
|
||||||
:return: dictionary which item value could be indexed by vmid
|
|
||||||
"""
|
|
||||||
vmid_item_dic = common.get_leaf_tag_map(info_file, prime_item, item)
|
|
||||||
return vmid_item_dic
|
|
||||||
|
|
||||||
|
|
||||||
def cpus_per_vm_check(id_cpus_per_vm_dic, item):
|
def cpus_per_vm_check(id_cpus_per_vm_dic, item):
|
||||||
"""
|
"""
|
||||||
Check cpu number of per vm
|
Check cpu number of per vm
|
||||||
@ -618,7 +441,7 @@ def get_vuart1_vmid(vm_vuart1):
|
|||||||
:return: dictionary of vmid:vuart1
|
:return: dictionary of vmid:vuart1
|
||||||
"""
|
"""
|
||||||
vm_id_dic = {}
|
vm_id_dic = {}
|
||||||
for i in range(VM_COUNT):
|
for i in range(common.VM_COUNT):
|
||||||
for key in vm_vuart1[i].keys():
|
for key in vm_vuart1[i].keys():
|
||||||
if key == "target_vm_id":
|
if key == "target_vm_id":
|
||||||
vm_id_dic[i] = vm_vuart1[i][key]
|
vm_id_dic[i] = vm_vuart1[i][key]
|
||||||
@ -685,21 +508,10 @@ def clos_assignment(clos_per_vm, index):
|
|||||||
vm_clos_bmp['clos_map'] = clos_str
|
vm_clos_bmp['clos_map'] = clos_str
|
||||||
return vm_clos_bmp
|
return vm_clos_bmp
|
||||||
|
|
||||||
def get_vuart_info_id(config_file, idx):
|
|
||||||
"""
|
|
||||||
Get vuart information by vuart id indexx
|
|
||||||
:param config_file: it is a file what contains information for script to read from
|
|
||||||
:param idx: vuart index in range: [0,1]
|
|
||||||
:return: dictionary which stored the vuart-id
|
|
||||||
"""
|
|
||||||
tmp_tag = board_cfg_lib.get_vuart_info_id(config_file, idx)
|
|
||||||
return tmp_tag
|
|
||||||
|
|
||||||
|
|
||||||
def avl_vuart_ui_select(scenario_info):
|
def avl_vuart_ui_select(scenario_info):
|
||||||
vm_num = get_vm_num(scenario_info)
|
|
||||||
tmp_vuart = {}
|
tmp_vuart = {}
|
||||||
for vm_i in range(vm_num):
|
for vm_i in range(common.VM_COUNT):
|
||||||
vm_type = get_order_type_by_vmid(vm_i)
|
vm_type = get_order_type_by_vmid(vm_i)
|
||||||
|
|
||||||
if vm_type == "SOS_VM":
|
if vm_type == "SOS_VM":
|
||||||
@ -718,14 +530,9 @@ def avl_vuart_ui_select(scenario_info):
|
|||||||
|
|
||||||
def get_first_post_vm():
|
def get_first_post_vm():
|
||||||
|
|
||||||
for i in range(VM_COUNT):
|
for i in range(common.VM_COUNT):
|
||||||
(err_dic, vm_type) = common.get_load_order_by_vmid(SCENARIO_INFO_FILE, VM_COUNT, i)
|
(err_dic, vm_type) = common.get_load_order_by_vmid(common.SCENARIO_INFO_FILE, common.VM_COUNT, i)
|
||||||
if vm_type == "POST_LAUNCHED_VM":
|
if vm_type == "POST_LAUNCHED_VM":
|
||||||
break
|
break
|
||||||
|
|
||||||
return (err_dic, i)
|
return (err_dic, i)
|
||||||
|
|
||||||
|
|
||||||
def mkdir(path):
|
|
||||||
|
|
||||||
common.mkdir(path)
|
|
||||||
|
@ -3,7 +3,9 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import common
|
||||||
import scenario_cfg_lib
|
import scenario_cfg_lib
|
||||||
|
|
||||||
PCI_DEV_TYPE = ['PCI_DEV_TYPE_HVEMUL', 'PCI_DEV_TYPE_PTDEV']
|
PCI_DEV_TYPE = ['PCI_DEV_TYPE_HVEMUL', 'PCI_DEV_TYPE_PTDEV']
|
||||||
|
|
||||||
|
|
||||||
@ -27,7 +29,7 @@ def generate_file(config):
|
|||||||
print(" * The memory range of vBAR should exactly match with the e820 layout of VM.",
|
print(" * The memory range of vBAR should exactly match with the e820 layout of VM.",
|
||||||
file=config)
|
file=config)
|
||||||
print(" */", file=config)
|
print(" */", file=config)
|
||||||
for i in range(scenario_cfg_lib.VM_COUNT):
|
for i in range(common.VM_COUNT):
|
||||||
print("", file=config)
|
print("", file=config)
|
||||||
print("struct acrn_vm_pci_dev_config " +
|
print("struct acrn_vm_pci_dev_config " +
|
||||||
"vm{}_pci_devs[VM{}_CONFIG_PCI_DEV_NUM] = {{".format(i, i), file=config)
|
"vm{}_pci_devs[VM{}_CONFIG_PCI_DEV_NUM] = {{".format(i, i), file=config)
|
||||||
|
@ -8,14 +8,15 @@ import sys
|
|||||||
import copy
|
import copy
|
||||||
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'library'))
|
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'library'))
|
||||||
from scenario_item import HwInfo, VmInfo
|
from scenario_item import HwInfo, VmInfo
|
||||||
|
import board_cfg_lib
|
||||||
import scenario_cfg_lib
|
import scenario_cfg_lib
|
||||||
import vm_configurations_c
|
import vm_configurations_c
|
||||||
import vm_configurations_h
|
import vm_configurations_h
|
||||||
import pci_dev_c
|
import pci_dev_c
|
||||||
import common
|
import common
|
||||||
|
|
||||||
ACRN_PATH = scenario_cfg_lib.SOURCE_ROOT_DIR
|
ACRN_PATH = common.SOURCE_ROOT_DIR
|
||||||
ACRN_CONFIG_TARGET = ACRN_PATH + 'hypervisor/scenarios/'
|
ACRN_CONFIG_DEF = ACRN_PATH + 'hypervisor/scenarios/'
|
||||||
GEN_FILE = ["vm_configurations.h", "vm_configurations.c", "pci_dev.c"]
|
GEN_FILE = ["vm_configurations.h", "vm_configurations.c", "pci_dev.c"]
|
||||||
|
|
||||||
|
|
||||||
@ -30,9 +31,7 @@ def get_scenario_item_values(board_info, scenario_info):
|
|||||||
# get vm count
|
# get vm count
|
||||||
common.BOARD_INFO_FILE = board_info
|
common.BOARD_INFO_FILE = board_info
|
||||||
common.SCENARIO_INFO_FILE = scenario_info
|
common.SCENARIO_INFO_FILE = scenario_info
|
||||||
scenario_cfg_lib.SCENARIO_INFO_FILE = scenario_info
|
common.get_vm_num(scenario_info)
|
||||||
scenario_cfg_lib.BOARD_INFO_FILE = board_info
|
|
||||||
scenario_cfg_lib.VM_COUNT = scenario_cfg_lib.get_vm_num(scenario_info)
|
|
||||||
|
|
||||||
# pre scenario
|
# pre scenario
|
||||||
guest_flags = copy.deepcopy(scenario_cfg_lib.GUEST_FLAG)
|
guest_flags = copy.deepcopy(scenario_cfg_lib.GUEST_FLAG)
|
||||||
@ -45,11 +44,11 @@ def get_scenario_item_values(board_info, scenario_info):
|
|||||||
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))
|
||||||
|
|
||||||
# pre board_private
|
# pre board_private
|
||||||
scenario_item_values["vm,board_private,rootfs"] = scenario_cfg_lib.get_rootdev_info(board_info)
|
scenario_item_values["vm,board_private,rootfs"] = board_cfg_lib.get_rootfs(board_info)
|
||||||
scenario_item_values["vm,board_private,console"] = scenario_cfg_lib.get_ttys_info(board_info)
|
scenario_item_values["vm,board_private,console"] = board_cfg_lib.get_ttys_info(board_info)
|
||||||
|
|
||||||
# os config
|
# os config
|
||||||
scenario_item_values["vm,os_config,rootfs"] = scenario_cfg_lib.get_rootdev_info(board_info)
|
scenario_item_values["vm,os_config,rootfs"] = board_cfg_lib.get_rootfs(board_info)
|
||||||
|
|
||||||
return scenario_item_values
|
return scenario_item_values
|
||||||
|
|
||||||
@ -64,8 +63,6 @@ def validate_scenario_setting(board_info, scenario_info):
|
|||||||
scenario_cfg_lib.ERR_LIST = {}
|
scenario_cfg_lib.ERR_LIST = {}
|
||||||
common.BOARD_INFO_FILE = board_info
|
common.BOARD_INFO_FILE = board_info
|
||||||
common.SCENARIO_INFO_FILE = scenario_info
|
common.SCENARIO_INFO_FILE = scenario_info
|
||||||
scenario_cfg_lib.BOARD_INFO_FILE = board_info
|
|
||||||
scenario_cfg_lib.SCENARIO_INFO_FILE = scenario_info
|
|
||||||
|
|
||||||
vm_info = VmInfo(board_info, scenario_info)
|
vm_info = VmInfo(board_info, scenario_info)
|
||||||
|
|
||||||
@ -81,39 +78,39 @@ def main(args):
|
|||||||
This is main function to start generate source code related with board
|
This is main function to start generate source code related with board
|
||||||
:param args: it is a command line args for the script
|
:param args: it is a command line args for the script
|
||||||
"""
|
"""
|
||||||
global ACRN_CONFIG_TARGET
|
|
||||||
err_dic = {}
|
err_dic = {}
|
||||||
|
|
||||||
(err_dic, board_info_file, scenario_info_file, output_folder) = scenario_cfg_lib.get_param(args)
|
(err_dic, board_info_file, scenario_info_file, output_folder) = common.get_param(args)
|
||||||
if err_dic:
|
if err_dic:
|
||||||
return err_dic
|
return err_dic
|
||||||
|
|
||||||
if output_folder:
|
if output_folder:
|
||||||
ACRN_CONFIG_TARGET = os.path.abspath(output_folder) + '/'
|
common.ACRN_CONFIG_TARGET = os.path.abspath(output_folder) + '/'
|
||||||
|
|
||||||
# check env
|
# check env
|
||||||
err_dic = scenario_cfg_lib.prepare()
|
err_dic = common.prepare()
|
||||||
if err_dic:
|
if err_dic:
|
||||||
return err_dic
|
return err_dic
|
||||||
|
|
||||||
common.BOARD_INFO_FILE = board_info_file
|
common.BOARD_INFO_FILE = board_info_file
|
||||||
common.SCENARIO_INFO_FILE = scenario_info_file
|
common.SCENARIO_INFO_FILE = scenario_info_file
|
||||||
scenario_cfg_lib.BOARD_INFO_FILE = board_info_file
|
|
||||||
scenario_cfg_lib.SCENARIO_INFO_FILE = scenario_info_file
|
|
||||||
|
|
||||||
# get scenario name
|
# get scenario name
|
||||||
(err_dic, scenario) = scenario_cfg_lib.get_scenario_name()
|
(err_dic, scenario) = common.get_scenario_name()
|
||||||
if err_dic:
|
if err_dic:
|
||||||
return err_dic
|
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) = scenario_cfg_lib.is_config_file_match()
|
(err_dic, status) = common.is_config_file_match()
|
||||||
if not status:
|
if not status:
|
||||||
err_dic['scenario config: Not match'] = "The board xml and scenario xml should be matched!"
|
err_dic['scenario config: Not match'] = "The board xml and scenario xml should be matched!"
|
||||||
return err_dic
|
return err_dic
|
||||||
|
|
||||||
scenario_dir = ACRN_CONFIG_TARGET + scenario + '/'
|
if common.ACRN_CONFIG_TARGET:
|
||||||
scenario_cfg_lib.mkdir(scenario_dir)
|
scenario_dir = common.ACRN_CONFIG_TARGET + scenario + '/'
|
||||||
|
else:
|
||||||
|
scenario_dir = ACRN_CONFIG_DEF + scenario + '/'
|
||||||
|
common.mkdir(scenario_dir)
|
||||||
|
|
||||||
vm_config_h = scenario_dir + GEN_FILE[0]
|
vm_config_h = scenario_dir + GEN_FILE[0]
|
||||||
vm_config_c = scenario_dir + GEN_FILE[1]
|
vm_config_c = scenario_dir + GEN_FILE[1]
|
||||||
@ -123,12 +120,12 @@ def main(args):
|
|||||||
get_scenario_item_values(board_info_file, scenario_info_file)
|
get_scenario_item_values(board_info_file, scenario_info_file)
|
||||||
(err_dic, vm_info) = validate_scenario_setting(board_info_file, scenario_info_file)
|
(err_dic, vm_info) = validate_scenario_setting(board_info_file, scenario_info_file)
|
||||||
if err_dic:
|
if err_dic:
|
||||||
scenario_cfg_lib.print_red("Validate the scenario item failue", err=True)
|
common.print_red("Validate the scenario item failue", err=True)
|
||||||
return err_dic
|
return err_dic
|
||||||
|
|
||||||
# get kata vm count
|
# get kata vm count
|
||||||
if scenario != "logical_partition":
|
if scenario != "logical_partition":
|
||||||
scenario_cfg_lib.KATA_VM_COUNT = scenario_cfg_lib.VM_COUNT - scenario_cfg_lib.DEFAULT_VM_COUNT[scenario]
|
scenario_cfg_lib.KATA_VM_COUNT = common.VM_COUNT - scenario_cfg_lib.DEFAULT_VM_COUNT[scenario]
|
||||||
if scenario_cfg_lib.KATA_VM_COUNT > 1:
|
if scenario_cfg_lib.KATA_VM_COUNT > 1:
|
||||||
err_dic['scenario config: kata vm count err'] = "Only one kata vm is supported!"
|
err_dic['scenario config: kata vm count err'] = "Only one kata vm is supported!"
|
||||||
return err_dic
|
return err_dic
|
||||||
@ -160,7 +157,7 @@ def ui_entry_api(board_info, scenario_info):
|
|||||||
|
|
||||||
arg_list = ['board_cfg_gen.py', '--board', board_info, '--scenario', scenario_info]
|
arg_list = ['board_cfg_gen.py', '--board', board_info, '--scenario', scenario_info]
|
||||||
|
|
||||||
err_dic = scenario_cfg_lib.prepare()
|
err_dic = common.prepare()
|
||||||
if err_dic:
|
if err_dic:
|
||||||
return err_dic
|
return err_dic
|
||||||
|
|
||||||
@ -175,5 +172,5 @@ if __name__ == '__main__':
|
|||||||
err_dic = main(ARGS)
|
err_dic = main(ARGS)
|
||||||
if err_dic:
|
if err_dic:
|
||||||
for err_k, err_v in err_dic.items():
|
for err_k, err_v in err_dic.items():
|
||||||
scenario_cfg_lib.print_red("{}: {}".format(err_k, err_v), err=True)
|
common.print_red("{}: {}".format(err_k, err_v), err=True)
|
||||||
|
|
||||||
|
@ -3,8 +3,9 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
|
||||||
import scenario_cfg_lib
|
import common
|
||||||
import board_cfg_lib
|
import board_cfg_lib
|
||||||
|
import scenario_cfg_lib
|
||||||
|
|
||||||
|
|
||||||
class HwInfo:
|
class HwInfo:
|
||||||
@ -22,7 +23,7 @@ class HwInfo:
|
|||||||
Get cpu core list
|
Get cpu core list
|
||||||
:return: cpu processor which one cpu has
|
:return: cpu processor which one cpu has
|
||||||
"""
|
"""
|
||||||
self.processor_val = scenario_cfg_lib.get_processor_info(self.board_info)
|
self.processor_val = board_cfg_lib.get_processor_info()
|
||||||
return self.processor_val
|
return self.processor_val
|
||||||
|
|
||||||
def get_rootdev_val(self):
|
def get_rootdev_val(self):
|
||||||
@ -30,7 +31,7 @@ class HwInfo:
|
|||||||
Get root devices from board info
|
Get root devices from board info
|
||||||
:return: root devices list
|
:return: root devices list
|
||||||
"""
|
"""
|
||||||
self.root_dev_val = scenario_cfg_lib.get_rootdev_info(self.board_info)
|
self.root_dev_val = common.get_rootfs(self.board_info)
|
||||||
return self.root_dev_val
|
return self.root_dev_val
|
||||||
|
|
||||||
def get_ttys_val(self):
|
def get_ttys_val(self):
|
||||||
@ -38,7 +39,7 @@ class HwInfo:
|
|||||||
Get ttySn from board info
|
Get ttySn from board info
|
||||||
:return: serial console list
|
:return: serial console list
|
||||||
"""
|
"""
|
||||||
self.ttys_val = scenario_cfg_lib.get_ttys_info(self.board_info)
|
self.ttys_val = board_cfg_lib.get_ttys_info(self.board_info)
|
||||||
return self.ttys_val
|
return self.ttys_val
|
||||||
|
|
||||||
def get_clos_val(self):
|
def get_clos_val(self):
|
||||||
@ -87,24 +88,24 @@ class CfgOsKern:
|
|||||||
Get all items which belong to this class
|
Get all items which belong to this class
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
self.kern_name = scenario_cfg_lib.get_leaf_tag_map(self.scenario_info, "os_config", "name")
|
self.kern_name = common.get_leaf_tag_map(self.scenario_info, "os_config", "name")
|
||||||
self.kern_type = scenario_cfg_lib.get_leaf_tag_map(
|
self.kern_type = common.get_leaf_tag_map(
|
||||||
self.scenario_info, "os_config", "kern_type")
|
self.scenario_info, "os_config", "kern_type")
|
||||||
self.kern_mod = scenario_cfg_lib.get_leaf_tag_map(
|
self.kern_mod = common.get_leaf_tag_map(
|
||||||
self.scenario_info, "os_config", "kern_mod")
|
self.scenario_info, "os_config", "kern_mod")
|
||||||
self.kern_args = scenario_cfg_lib.get_leaf_tag_map(
|
self.kern_args = common.get_leaf_tag_map(
|
||||||
self.scenario_info, "os_config", "bootargs")
|
self.scenario_info, "os_config", "bootargs")
|
||||||
self.kern_console = scenario_cfg_lib.get_leaf_tag_map(
|
self.kern_console = common.get_leaf_tag_map(
|
||||||
self.scenario_info, "os_config", "console")
|
self.scenario_info, "os_config", "console")
|
||||||
self.kern_load_addr = scenario_cfg_lib.get_leaf_tag_map(
|
self.kern_load_addr = common.get_leaf_tag_map(
|
||||||
self.scenario_info, "os_config", "kern_load_addr")
|
self.scenario_info, "os_config", "kern_load_addr")
|
||||||
self.kern_entry_addr = scenario_cfg_lib.get_leaf_tag_map(
|
self.kern_entry_addr = common.get_leaf_tag_map(
|
||||||
self.scenario_info, "os_config", "kern_entry_addr")
|
self.scenario_info, "os_config", "kern_entry_addr")
|
||||||
self.kern_root_dev = scenario_cfg_lib.get_leaf_tag_map(
|
self.kern_root_dev = common.get_leaf_tag_map(
|
||||||
self.scenario_info, "os_config", "rootfs")
|
self.scenario_info, "os_config", "rootfs")
|
||||||
self.ramdisk_mod = scenario_cfg_lib.get_leaf_tag_map(
|
self.ramdisk_mod = common.get_leaf_tag_map(
|
||||||
self.scenario_info, "os_config", "ramdisk_mod")
|
self.scenario_info, "os_config", "ramdisk_mod")
|
||||||
self.kern_args_append = scenario_cfg_lib.get_leaf_tag_map(
|
self.kern_args_append = common.get_leaf_tag_map(
|
||||||
self.scenario_info, "boot_private", "bootargs")
|
self.scenario_info, "boot_private", "bootargs")
|
||||||
|
|
||||||
def check_item(self):
|
def check_item(self):
|
||||||
@ -171,8 +172,8 @@ class VuartInfo:
|
|||||||
Get all items which belong to this class
|
Get all items which belong to this class
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
self.v0_vuart = scenario_cfg_lib.get_vuart_info_id(self.scenario_info, 0)
|
self.v0_vuart = board_cfg_lib.get_vuart_info_id(self.scenario_info, 0)
|
||||||
self.v1_vuart = scenario_cfg_lib.get_vuart_info_id(self.scenario_info, 1)
|
self.v1_vuart = board_cfg_lib.get_vuart_info_id(self.scenario_info, 1)
|
||||||
scenario_cfg_lib.check_board_private_info()
|
scenario_cfg_lib.check_board_private_info()
|
||||||
|
|
||||||
|
|
||||||
@ -191,13 +192,13 @@ class MemInfo:
|
|||||||
Get all items which belong to this class
|
Get all items which belong to this class
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
self.mem_start_hpa = scenario_cfg_lib.get_leaf_tag_map(
|
self.mem_start_hpa = common.get_leaf_tag_map(
|
||||||
self.scenario_info, "memory", "start_hpa")
|
self.scenario_info, "memory", "start_hpa")
|
||||||
self.mem_size = scenario_cfg_lib.get_leaf_tag_map(
|
self.mem_size = common.get_leaf_tag_map(
|
||||||
self.scenario_info, "memory", "size")
|
self.scenario_info, "memory", "size")
|
||||||
self.mem_start_hpa2 = scenario_cfg_lib.get_leaf_tag_map(
|
self.mem_start_hpa2 = common.get_leaf_tag_map(
|
||||||
self.scenario_info, "memory", "start_hpa2")
|
self.scenario_info, "memory", "start_hpa2")
|
||||||
self.mem_size_hpa2 = scenario_cfg_lib.get_leaf_tag_map(
|
self.mem_size_hpa2 = common.get_leaf_tag_map(
|
||||||
self.scenario_info, "memory", "size_hpa2")
|
self.scenario_info, "memory", "size_hpa2")
|
||||||
|
|
||||||
def check_item(self):
|
def check_item(self):
|
||||||
@ -224,14 +225,15 @@ class CfgPci:
|
|||||||
Get pci device number items
|
Get pci device number items
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
self.pci_dev_num = scenario_cfg_lib.get_leaf_tag_map(self.scenario_info, "pci_dev_num")
|
self.pci_dev_num = common.get_leaf_tag_map(self.scenario_info, "pci_dev_num")
|
||||||
|
|
||||||
def get_pci_devs(self):
|
def get_pci_devs(self):
|
||||||
"""
|
"""
|
||||||
Get pci devices items
|
Get pci devices items
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
self.pci_devs = scenario_cfg_lib.get_leaf_tag_map(self.scenario_info, "pci_devs")
|
self.pci_devs = common.get_leaf_tag_map(self.scenario_info, "pci_devs")
|
||||||
|
|
||||||
|
|
||||||
def get_info(self):
|
def get_info(self):
|
||||||
"""
|
"""
|
||||||
@ -257,8 +259,8 @@ class EpcSection:
|
|||||||
self.scenario_info = scenario_info
|
self.scenario_info = scenario_info
|
||||||
|
|
||||||
def get_info(self):
|
def get_info(self):
|
||||||
self.base = scenario_cfg_lib.get_leaf_tag_map(self.scenario_info, "epc_section", "base")
|
self.base = common.get_leaf_tag_map(self.scenario_info, "epc_section", "base")
|
||||||
self.size = scenario_cfg_lib.get_leaf_tag_map(self.scenario_info, "epc_section", "size")
|
self.size = common.get_leaf_tag_map(self.scenario_info, "epc_section", "size")
|
||||||
|
|
||||||
|
|
||||||
class LoadOrderNum:
|
class LoadOrderNum:
|
||||||
@ -286,7 +288,7 @@ class VmInfo:
|
|||||||
def __init__(self, board_file, scenario_file):
|
def __init__(self, board_file, scenario_file):
|
||||||
self.board_info = board_file
|
self.board_info = board_file
|
||||||
self.scenario_info = scenario_file
|
self.scenario_info = scenario_file
|
||||||
scenario_cfg_lib.VM_COUNT = scenario_cfg_lib.get_vm_num(self.scenario_info)
|
common.get_vm_num(self.scenario_info)
|
||||||
|
|
||||||
self.epc_section = EpcSection(self.scenario_info)
|
self.epc_section = EpcSection(self.scenario_info)
|
||||||
self.mem_info = MemInfo(self.scenario_info)
|
self.mem_info = MemInfo(self.scenario_info)
|
||||||
@ -300,17 +302,17 @@ class VmInfo:
|
|||||||
Get all items which belong to this class
|
Get all items which belong to this class
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
self.name = scenario_cfg_lib.get_leaf_tag_map(self.scenario_info, "name")
|
self.name = common.get_leaf_tag_map(self.scenario_info, "name")
|
||||||
self.load_order = scenario_cfg_lib.get_leaf_tag_map(self.scenario_info, "load_order")
|
self.load_order = common.get_leaf_tag_map(self.scenario_info, "load_order")
|
||||||
self.uuid = scenario_cfg_lib.get_leaf_tag_map(self.scenario_info, "uuid")
|
self.uuid = common.get_leaf_tag_map(self.scenario_info, "uuid")
|
||||||
self.guest_flag_idx = scenario_cfg_lib.get_sub_leaf_tag(
|
self.guest_flag_idx = common.get_sub_leaf_tag(
|
||||||
self.scenario_info, "guest_flags", "guest_flag")
|
self.scenario_info, "guest_flags", "guest_flag")
|
||||||
self.cpus_per_vm = scenario_cfg_lib.get_leaf_tag_map(
|
self.cpus_per_vm = common.get_leaf_tag_map(
|
||||||
self.scenario_info, "vcpu_affinity", "pcpu_id")
|
self.scenario_info, "vcpu_affinity", "pcpu_id")
|
||||||
self.clos_per_vm = scenario_cfg_lib.get_leaf_tag_map(
|
self.clos_per_vm = common.get_leaf_tag_map(
|
||||||
self.scenario_info, "clos", "vcpu_clos")
|
self.scenario_info, "clos", "vcpu_clos")
|
||||||
|
|
||||||
self.severity = scenario_cfg_lib.get_leaf_tag_map(self.scenario_info, "severity")
|
self.severity = common.get_leaf_tag_map(self.scenario_info, "severity")
|
||||||
self.epc_section.get_info()
|
self.epc_section.get_info()
|
||||||
self.mem_info.get_info()
|
self.mem_info.get_info()
|
||||||
self.os_cfg.get_info()
|
self.os_cfg.get_info()
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import scenario_cfg_lib
|
|
||||||
import board_cfg_lib
|
|
||||||
import common
|
import common
|
||||||
|
import board_cfg_lib
|
||||||
|
import scenario_cfg_lib
|
||||||
|
|
||||||
C_HEADER = scenario_cfg_lib.HEADER_LICENSE + r"""
|
C_HEADER = scenario_cfg_lib.HEADER_LICENSE + r"""
|
||||||
#include <vm_config.h>
|
#include <vm_config.h>
|
||||||
@ -75,7 +75,7 @@ def vuart0_output(i, vm_type, vm_info, config):
|
|||||||
def vuart_map_enable(vm_info):
|
def vuart_map_enable(vm_info):
|
||||||
|
|
||||||
map_dic = {}
|
map_dic = {}
|
||||||
for i in range(scenario_cfg_lib.VM_COUNT):
|
for i in range(common.VM_COUNT):
|
||||||
base_i = vm_info.vuart.v1_vuart[i]['base']
|
base_i = vm_info.vuart.v1_vuart[i]['base']
|
||||||
src_t_vm_i = vm_info.vuart.v1_vuart[i]['target_vm_id']
|
src_t_vm_i = vm_info.vuart.v1_vuart[i]['target_vm_id']
|
||||||
src_t_vuart_i = vm_info.vuart.v1_vuart[i]['target_uart_id']
|
src_t_vuart_i = vm_info.vuart.v1_vuart[i]['target_uart_id']
|
||||||
@ -196,7 +196,7 @@ def clos_output(vm_info, i, config):
|
|||||||
:param config: it is the pointer which file write to
|
:param config: it is the pointer which file write to
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
(rdt_res, rdt_res_clos_max, _) = board_cfg_lib.clos_info_parser(scenario_cfg_lib.BOARD_INFO_FILE)
|
(rdt_res, rdt_res_clos_max, _) = board_cfg_lib.clos_info_parser(common.BOARD_INFO_FILE)
|
||||||
if len(rdt_res_clos_max) != 0:
|
if len(rdt_res_clos_max) != 0:
|
||||||
common_clos_max = min(rdt_res_clos_max)
|
common_clos_max = min(rdt_res_clos_max)
|
||||||
else:
|
else:
|
||||||
@ -468,13 +468,13 @@ def gen_logical_partition_source(vm_info, config):
|
|||||||
"""
|
"""
|
||||||
err_dic = {}
|
err_dic = {}
|
||||||
gen_source_header(config)
|
gen_source_header(config)
|
||||||
for i in range(scenario_cfg_lib.VM_COUNT):
|
for i in range(common.VM_COUNT):
|
||||||
print("extern struct acrn_vm_pci_dev_config " +
|
print("extern struct acrn_vm_pci_dev_config " +
|
||||||
"vm{0}_pci_devs[VM{1}_CONFIG_PCI_DEV_NUM];".format(i, i), file=config)
|
"vm{0}_pci_devs[VM{1}_CONFIG_PCI_DEV_NUM];".format(i, i), file=config)
|
||||||
print("", file=config)
|
print("", file=config)
|
||||||
print("struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {", file=config)
|
print("struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {", file=config)
|
||||||
|
|
||||||
for i in range(scenario_cfg_lib.VM_COUNT):
|
for i in range(common.VM_COUNT):
|
||||||
uuid = uuid2str(vm_info.uuid[i])
|
uuid = uuid2str(vm_info.uuid[i])
|
||||||
print("\t{{\t/* VM{0} */".format(i), file=config)
|
print("\t{{\t/* VM{0} */".format(i), file=config)
|
||||||
print("\t\t.load_order = {0},".format(vm_info.load_order[i]), file=config)
|
print("\t\t.load_order = {0},".format(vm_info.load_order[i]), file=config)
|
||||||
@ -533,7 +533,7 @@ def gen_industry_source(vm_info, config):
|
|||||||
err_dic = {}
|
err_dic = {}
|
||||||
gen_source_header(config)
|
gen_source_header(config)
|
||||||
print("struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {", file=config)
|
print("struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {", file=config)
|
||||||
for i in range(scenario_cfg_lib.VM_COUNT):
|
for i in range(common.VM_COUNT):
|
||||||
uuid = uuid2str(vm_info.uuid[i])
|
uuid = uuid2str(vm_info.uuid[i])
|
||||||
print("\t{", file=config)
|
print("\t{", file=config)
|
||||||
print("\t\t.load_order = {0},".format(vm_info.load_order[i]), file=config)
|
print("\t\t.load_order = {0},".format(vm_info.load_order[i]), file=config)
|
||||||
@ -604,7 +604,7 @@ def gen_hybrid_source(vm_info, config):
|
|||||||
gen_source_header(config)
|
gen_source_header(config)
|
||||||
print("struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {", file=config)
|
print("struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = {", file=config)
|
||||||
|
|
||||||
for i in range(scenario_cfg_lib.VM_COUNT):
|
for i in range(common.VM_COUNT):
|
||||||
uuid = uuid2str(vm_info.uuid[i])
|
uuid = uuid2str(vm_info.uuid[i])
|
||||||
print("\t{{\t/* VM{0} */".format(i), file=config)
|
print("\t{{\t/* VM{0} */".format(i), file=config)
|
||||||
print("\t\t.load_order = {0},".format(vm_info.load_order[i]), file=config)
|
print("\t\t.load_order = {0},".format(vm_info.load_order[i]), file=config)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
#
|
#
|
||||||
|
|
||||||
|
import common
|
||||||
import scenario_cfg_lib
|
import scenario_cfg_lib
|
||||||
import board_cfg_lib
|
import board_cfg_lib
|
||||||
|
|
||||||
@ -43,7 +44,7 @@ def clos_config_output(vm_info, i, config):
|
|||||||
:param i: the index of vm id
|
:param i: the index of vm id
|
||||||
:param config: file pointor to store the information
|
:param config: file pointor to store the information
|
||||||
"""
|
"""
|
||||||
(rdt_res, rdt_res_clos_max, _) = board_cfg_lib.clos_info_parser(scenario_cfg_lib.BOARD_INFO_FILE)
|
(rdt_res, rdt_res_clos_max, _) = board_cfg_lib.clos_info_parser(common.BOARD_INFO_FILE)
|
||||||
if len(rdt_res_clos_max) != 0:
|
if len(rdt_res_clos_max) != 0:
|
||||||
common_clos_max = min(rdt_res_clos_max)
|
common_clos_max = min(rdt_res_clos_max)
|
||||||
else:
|
else:
|
||||||
@ -128,7 +129,7 @@ def gen_sdc2_header(vm_info, config):
|
|||||||
print("\t\t\t\t\tSOS_BOOTARGS_DIFF", file=config)
|
print("\t\t\t\t\tSOS_BOOTARGS_DIFF", file=config)
|
||||||
|
|
||||||
print("", file=config)
|
print("", file=config)
|
||||||
for i in range(scenario_cfg_lib.VM_COUNT):
|
for i in range(common.VM_COUNT):
|
||||||
cpu_affinity_output(vm_info, i, config)
|
cpu_affinity_output(vm_info, i, config)
|
||||||
clos_config_output(vm_info, i, config)
|
clos_config_output(vm_info, i, config)
|
||||||
print("", file=config)
|
print("", file=config)
|
||||||
@ -164,7 +165,6 @@ def gen_logical_partition_header(vm_info, config):
|
|||||||
:param config: it is the pointer which file write to
|
:param config: it is the pointer which file write to
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
scenario_cfg_lib.vms_count = scenario_cfg_lib.VM_COUNT
|
|
||||||
gen_common_header(config)
|
gen_common_header(config)
|
||||||
# map all the needed pci sub class
|
# map all the needed pci sub class
|
||||||
print("#include <pci_devices.h>", file=config)
|
print("#include <pci_devices.h>", file=config)
|
||||||
@ -176,7 +176,7 @@ def gen_logical_partition_header(vm_info, config):
|
|||||||
|
|
||||||
logic_max_vm_num(vm_info, config)
|
logic_max_vm_num(vm_info, config)
|
||||||
|
|
||||||
for i in range(scenario_cfg_lib.VM_COUNT):
|
for i in range(common.VM_COUNT):
|
||||||
|
|
||||||
cpu_bits = vm_info.get_cpu_bitmap(i)
|
cpu_bits = vm_info.get_cpu_bitmap(i)
|
||||||
cpu_affinity_output(vm_info, i, config)
|
cpu_affinity_output(vm_info, i, config)
|
||||||
@ -247,7 +247,7 @@ def gen_industry_header(vm_info, config):
|
|||||||
print("\t\t\t\t\tSOS_CONSOLE\t\\", file=config)
|
print("\t\t\t\t\tSOS_CONSOLE\t\\", file=config)
|
||||||
print("\t\t\t\t\tSOS_BOOTARGS_DIFF", file=config)
|
print("\t\t\t\t\tSOS_BOOTARGS_DIFF", file=config)
|
||||||
print("", file=config)
|
print("", file=config)
|
||||||
for i in range(scenario_cfg_lib.VM_COUNT):
|
for i in range(common.VM_COUNT):
|
||||||
cpu_affinity_output(vm_info, i, config)
|
cpu_affinity_output(vm_info, i, config)
|
||||||
clos_config_output(vm_info, i, config)
|
clos_config_output(vm_info, i, config)
|
||||||
print("", file=config)
|
print("", file=config)
|
||||||
@ -272,7 +272,7 @@ def gen_hybrid_header(vm_info, config):
|
|||||||
print("", file=config)
|
print("", file=config)
|
||||||
scenario_vm_num(vm_info.load_order_cnt, config)
|
scenario_vm_num(vm_info.load_order_cnt, config)
|
||||||
print("", file=config)
|
print("", file=config)
|
||||||
for i in range(scenario_cfg_lib.VM_COUNT):
|
for i in range(common.VM_COUNT):
|
||||||
cpu_affinity_output(vm_info, i, config)
|
cpu_affinity_output(vm_info, i, config)
|
||||||
clos_config_output(vm_info, i, config)
|
clos_config_output(vm_info, i, config)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user