acrn-config: dynamic configuration for scenario setting and launch setting

config app implements interfaces to dynamically:
    create new scenario settings based on tempaltes;
    create new launch settings based on templates;
    add or delete VMs for scenario settings;
    add or delete VMs for launch settings;
    load default scenario or launch settings

Tracked-On: #4641

Signed-off-by: Shuang Zheng <shuang.zheng@intel.com
Reviewed-by: Victor Sun <victor.sun@intel.com>
Acked-by: Terry Zou <terry.zou@intel.com>
This commit is contained in:
Shuang Zheng
2020-04-16 15:46:07 +08:00
committed by wenlingz
parent ccef1af1f0
commit b9ce7617cd
7 changed files with 1036 additions and 348 deletions

View File

@@ -221,6 +221,20 @@ class XmlConfig:
dest_node = self._get_dest_node(*args)
dest_node.append(elem)
def insert_curr_elem(self, index, elem, *args):
"""
insert elements for current path.
:param index: the location for the element to insert.
:param elem: the element to insert.
:param args: the path of the element.
:return: None.
"""
if self._curr_xml_tree is None:
return
dest_node = self._get_dest_node(*args)
dest_node.insert(index, elem)
def delete_curr_key(self, *args):
"""
delete the element by its path.