config_tools: check VM number before filling with dynamic configured VM

check VM number before filling with dynamic configured VM

Tracked-On: #6907
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
This commit is contained in:
Shiqing Gao 2021-11-29 14:16:58 +08:00 committed by wenlingz
parent ee2eb2e8e3
commit c5741db091

View File

@ -70,7 +70,9 @@
<!-- Definition of vm_configs -->
<xsl:value-of select="acrn:array-initializer('struct acrn_vm_config', 'vm_configs', 'CONFIG_MAX_VM_NUM')" />
<xsl:apply-templates select="vm"/>
<xsl:value-of select="acrn:vm_fill(count(vm), hv/CAPACITIES/MAX_VM_NUM)"/>
<xsl:if test="count(vm) &lt; hv/CAPACITIES/MAX_VM_NUM">
<xsl:value-of select="acrn:vm_fill(count(vm), hv/CAPACITIES/MAX_VM_NUM)"/>
</xsl:if>
<xsl:value-of select="$newline"/>
<xsl:value-of select="$end_of_array_initializer" />
</xsl:template>