config_tools: add ivshmem providers

A shared memory region can be provided either by the hypervisor or by the
device model. Before recent schema changes this is telled by the "hv:/" or
"dm:/" prefix.

This patch adds another node under an IVSHMEM region to represent the
provider, following the practice that information in the old-school
encodings is split and put as separate XML nodes.

Tracked-On: #6690
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Junjie Mao
2022-03-02 17:13:12 +08:00
committed by acrnsi-robot
parent 609e09cf37
commit f392164b40
10 changed files with 73 additions and 35 deletions

View File

@@ -97,7 +97,10 @@ def get_ivshmem_regions_by_tree(etree):
ivshmem_regions = etree.xpath("//IVSHMEM_REGION")
shmem_regions = {}
for idx in range(len(ivshmem_regions)):
shm_name = ivshmem_regions[idx].get('name')
provided_by = common.get_node("./PROVIDED_BY/text()", ivshmem_regions[idx])
if provided_by != "Hypervisor":
continue
shm_name = common.get_node("./NAME/text()", ivshmem_regions[idx])
if shm_name is None:
continue
shm_size = common.get_node("./IVSHMEM_SIZE/text()", ivshmem_regions[idx])
@@ -117,7 +120,7 @@ def get_ivshmem_enabled_by_tree(etree):
if len(ivshmem_vms) != 0:
shmem_enabled = 'y'
return shmem_enabled
def is_pre_launched_vm(vm_type):
if vm_type == 'PRE_LAUNCHED_VM':
return True