Esempio n. 1
0
def validate_launch_setting(board_info, scenario_info, launch_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
    """
    common.SCENARIO_INFO_FILE = scenario_info
    common.get_vm_types()

    launch_cfg_lib.ERR_LIST = {}
    common.BOARD_INFO_FILE = board_info
    common.SCENARIO_INFO_FILE = scenario_info
    common.LAUNCH_INFO_FILE = launch_info

    # init available pt devices and get selected pt devices
    pt_avl = AvailablePthru(board_info)
    pt_sel = PthruSelected(launch_info, pt_avl.bdf_desc_map,
                           pt_avl.bdf_vpid_map)
    pt_sel.get_bdf()
    pt_sel.get_vpid()
    pt_sel.get_slot()
    pt_sel.check_item()

    # virt-io devices
    virtio = VirtioDeviceSelect(launch_info)
    virtio.get_virtio()
    virtio.check_virtio()

    # acrn dm arguments
    dm = AcrnDmArgs(board_info, scenario_info, launch_info)
    dm.get_args()
    dm.check_item()

    return (launch_cfg_lib.ERR_LIST, pt_sel, virtio, dm)
def validate_launch_setting(board_info, scenario_info, launch_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
    """
    launch_cfg_lib.ERR_LIST = {}
    launch_cfg_lib.BOARD_INFO_FILE = board_info
    launch_cfg_lib.SCENARIO_INFO_FILE = scenario_info
    launch_cfg_lib.LAUNCH_INFO_FILE = launch_info

    # init available pt devices and get selected pt devices
    pt_avl = AvailablePthru(board_info)
    pt_sel = PthruSelected(launch_info, pt_avl.bdf_desc_map,
                           pt_avl.bdf_vpid_map)
    dm = AcrnDmArgs(board_info, scenario_info, launch_info)

    # get bdf/vpid list from config xml
    pt_sel.get_bdf()
    pt_sel.get_vpid()
    pt_sel.get_slot()
    dm.get_args()

    # check items in config xml
    pt_sel.check_item()
    dm.check_item()

    return (launch_cfg_lib.ERR_LIST, pt_sel, dm)