acrn-config: add virtio-input support for launch

config

Add support to parse and get 'virtio-input' item value from launch config
files, these values are editable by user.

Tracked-On: #4163
Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
Wei Liu
2019-11-26 19:28:35 +08:00
committed by wenlingz
parent 9fc32043aa
commit bc9b6d1b0c
5 changed files with 54 additions and 20 deletions

View File

@@ -23,7 +23,7 @@ GUEST_FLAG = ["0UL", "GUEST_FLAG_SECURE_WORLD_ENABLED", "GUEST_FLAG_LAPIC_PASSTH
START_HPA_SIZE_LIST = ['0x20000000', '0x40000000', '0x80000000', 'CONFIG_SOS_RAM_SIZE', 'VM0_MEM_SIZE']
MULTI_ITEM = ["guest_flag", "pcpu_id"]
MULTI_ITEM = ["guest_flag", "pcpu_id", "input"]
class MultiItem():
@@ -31,6 +31,7 @@ class MultiItem():
def __init__(self):
self.guest_flag = []
self.pcpu_id = []
self.vir_input = []
self.vir_console = []
self.vir_net = []
@@ -38,7 +39,7 @@ class TmpItem():
def __init__(self):
self.tag = {}
self.multi = MultiItem
self.multi = MultiItem()
def open_license():
""" Get the license """
@@ -410,6 +411,10 @@ def get_leaf_value(tmp, tag_str, leaf):
if leaf.tag == "pcpu_id" and tag_str == "pcpu_id":
tmp.multi.pcpu_id.append(leaf.text)
# get virtio-input for vm
if leaf.tag == "input" and tag_str == "input":
tmp.multi.vir_input.append(leaf.text)
def get_sub_value(tmp, tag_str, vm_id):
@@ -422,6 +427,10 @@ def get_sub_value(tmp, tag_str, vm_id):
if tmp.multi.pcpu_id and tag_str == "pcpu_id":
tmp.tag[vm_id] = tmp.multi.pcpu_id
# append input for vm
if tmp.multi.vir_input and tag_str == "input":
tmp.tag[vm_id] = tmp.multi.vir_input
def get_leaf_tag_map(config_file, branch_tag, tag_str):
"""