config_tools: add assert to check if the scenario is valid

Add assert for below invalid scenario:

1. Two or more pre-launched RTVM
2. One pre-launched RTVM and one or more post-launched RTVM

Tracked-On: #6685
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
This commit is contained in:
Kunhui-Li 2021-11-02 11:02:52 +08:00 committed by wenlingz
parent 29b8da2a51
commit 3b4d3a3ceb

View File

@ -52,4 +52,20 @@ https://github.com/projectacrn/acrn-hypervisor/issues if you meet this.</xs:docu
</xs:annotation> </xs:annotation>
</xs:assert> </xs:assert>
<xs:assert test="(count(vm[vm_type = 'PRE_RT_VM']) = 1 and count(vm[vm_type='POST_RT_VM']) = 0)
or (count(vm[vm_type='PRE_RT_VM']) = 0 and count(vm[vm_type='POST_RT_VM']) &gt;= 0)">
<xs:annotation acrn:severity="error">
<xs:documentation>There should not be both pre-launched RTVM and post-launched RTVM.
And two or more pre-launched RTVM are not allowed.
This assertion checks below invalid scenario:
- Two or more pre-launched RTVM
- One pre-launched RTVM and one or more post-launched RTVM
To fix this error, please check the RTVM number to ensure the scenario configuration is valid.</xs:documentation>
</xs:annotation>
</xs:assert>
</xs:schema> </xs:schema>