config tool: remove guest_flags in user interface

The concept of guest_flags is hard to understand for users.
So turn guest_flags into several parameters in config tool
user interface, list as below:

GUEST_FLAG_LAPIC_PASSTHROUGH ---> lapic_passthrough
GUEST_FLAG_IO_COMPLETION_POLLING ---> io_completion_polling
GUEST_FLAG_VCAT_ENABLED ---> virtual_cat_support
GUEST_FLAG_SECURE_WORLD_ENABLED ---> secure_world_support
GUEST_FLAG_HIDE_MTRR ---> hide_mtrr_support
GUEST_FLAG_NVMX_ENABLED ---> nested_virtualization_support
GUEST_FLAG_SECURITY_VM ---> security_vm
GUEST_FLAG_RT ---> vm_type(RTVM)
GUEST_FLAG_TEE ---> vm_type(TEE_VM)
GUEST_FLAG_REE ---> vm_type(REE_VM)

In addition, HV global parameter NVMX_ENABLE is removed
from user interface, when config tool detects more than
one VM with nested_virtualization_support, NVMX_ENABLE is
assigned as 'y' automatically.

v1->v2:
*Rebase on the latest xml schema checking change
*Remove "all rights reserved" from the license header in guest_flags.py

v2->v3:
*Change the name of the new config items to CAPITAL_CASE style
*Combine guest flag policy to an XPATH in guest_flags.py
*Use count() to directly deduce NVMX_ENABLED in config_common.xsl and
update `boolean-by-key-value` to process 'true'

v3->v4:
*Change the name of the new config items to lower_case style
*Change guest_flag_node to allocation_vm_node in guest_flags.py
*Separate value case and key case for boolean-by-key-value

Tracked-On: #6690
Signed-off-by: hangliu1 <hang1.liu@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
hangliu1
2022-02-20 20:52:11 -05:00
committed by acrnsi-robot
parent 1034443796
commit 0068d4e826
8 changed files with 100 additions and 98 deletions

View File

@@ -54,11 +54,17 @@
<xsl:param name="value" />
<xsl:choose>
<xsl:when test="($value = 'y') or ($key = 'RELEASE')">
<xsl:when test="($value = 'true') or ($value = 'y')">
<xsl:call-template name="entry-by-key-value">
<xsl:with-param name="key" select="$key" />
<xsl:with-param name="value" select="'y'" />
</xsl:call-template>
</xsl:when>
<xsl:when test="($key = 'RELEASE')">
<xsl:call-template name="entry-by-key-value">
<xsl:with-param name="key" select="$key" />
<xsl:with-param name="value" select="$value" />
</xsl:call-template>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:text># CONFIG_</xsl:text>

View File

@@ -116,8 +116,9 @@
<xsl:with-param name="key" select="'HYPERV_ENABLED'" />
</xsl:call-template>
<xsl:call-template name="boolean-by-key">
<xsl:call-template name="boolean-by-key-value">
<xsl:with-param name="key" select="'NVMX_ENABLED'" />
<xsl:with-param name="value" select="count(//vm[nested_virtualization_support = 'y']) > 0" />
</xsl:call-template>
<xsl:call-template name="boolean-by-key">

View File

@@ -91,7 +91,7 @@
</xsl:if>
<xsl:value-of select="acrn:initializer('vm_prio', priority)" />
<xsl:value-of select="acrn:initializer('companion_vm_id', concat(companion_vmid, 'U'))" />
<xsl:apply-templates select="guest_flags" />
<xsl:call-template name="guest_flags" />
<xsl:if test="acrn:is-rdt-enabled()">
<xsl:apply-templates select="clos" />
@@ -156,17 +156,9 @@
</xsl:choose>
</xsl:template>
<xsl:template match="guest_flags">
<xsl:if test="guest_flag">
<xsl:choose>
<xsl:when test="guest_flag = '' or guest_flag = '0' or guest_flag = '0UL'">
<xsl:value-of select="acrn:initializer('guest_flags', 'GUEST_FLAG_STATIC_VM')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="acrn:initializer('guest_flags', concat('(GUEST_FLAG_STATIC_VM|', acrn:string-join(guest_flag, '|', '', ''),')'))" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:template name="guest_flags">
<xsl:variable name="vm_id" select="@id" />
<xsl:value-of select="acrn:initializer('guest_flags', concat('(', acrn:string-join(//allocation-data/acrn-config/vm[@id=$vm_id]/guest_flags/guest_flag, '|', '', ''),')'))" />
</xsl:template>
<xsl:template match="clos">
@@ -175,7 +167,7 @@
<xsl:value-of select="acrn:initializer('num_pclosids', concat(count(vcpu_clos), 'U'))" />
<xsl:if test="acrn:is-vcat-enabled() and ../guest_flags[guest_flag = 'GUEST_FLAG_VCAT_ENABLED']">
<xsl:if test="acrn:is-vcat-enabled() and ../virtual_cat_support[text() = 'y']">
<xsl:variable name="rdt_res_str" select="acrn:get-normalized-closinfo-rdt-res-str()" />
<xsl:variable name="closid" select="vcpu_clos[1]" />