Date
1 - 3 of 3
[PATCH] misc: add assert for vUART connection
chenli.wei
The current UI have no live-check to check whether a VM connect to
itself. So we add an assert to the schema and return error when user connect a VM to itself. Signed-off-by: Chenli Wei <chenli.wei@...> --- .../config_tools/schema/checks/vuart_config.xsd | 17 +++++++++++++++++ misc/config_tools/schema/datachecks.xsd | 1 + 2 files changed, 18 insertions(+) create mode 100644 misc/config_tools/schema/checks/vuart_config.xsd diff --git a/misc/config_tools/schema/checks/vuart_config.xsd b/misc/config_tools/schema/checks/vuart_config.xsd new file mode 100644 index 000000000..511075d92 --- /dev/null +++ b/misc/config_tools/schema/checks/vuart_config.xsd @@ -0,0 +1,17 @@ +<?xml version="1.0"?> +<!-- Copyright (C) 2022 Intel Corporation. --> +<!-- SPDX-License-Identifier: BSD-3-Clause --> + +<xs:schema xml:id="root" + xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:acrn="https://projectacrn.org"> + + <xs:assert test="every $vuart_connection in /acrn-config//vuart_connection satisfies + every $vm_name in $vuart_connection/endpoint/vm_name/text() satisfies + count($vuart_connection/endpoint[./vm_name/text()=$vm_name]) = 1"> + <xs:annotation acrn:severity="error" acrn:report-on="$vuart_connection/name"> + <xs:documentation>vuart_connection "{$vm_name}" can't connected to itself</xs:documentation> + </xs:annotation> + </xs:assert> + +</xs:schema> diff --git a/misc/config_tools/schema/datachecks.xsd b/misc/config_tools/schema/datachecks.xsd index f8c934eda..fc9badf53 100644 --- a/misc/config_tools/schema/datachecks.xsd +++ b/misc/config_tools/schema/datachecks.xsd @@ -14,6 +14,7 @@ <xi:include href="checks/vbdf_assignment.xsd" xpointer="xpointer(id('root')/*)" /> <xi:include href="checks/vm_types.xsd" xpointer="xpointer(id('root')/*)" /> <xi:include href="checks/passthrough_devices.xsd" xpointer="xpointer(id('root')/*)" /> + <xi:include href="checks/vuart_config.xsd" xpointer="xpointer(id('root')/*)" /> </xs:complexType> </xs:element> -- 2.17.1
|
|
Junjie Mao
Chenli Wei <chenli.wei@...> writes:
The current UI have no live-check to check whether a VM connect to`vm_name` is not the name of the vUART connection. -- Best Regards Junjie Mao + </xs:annotation>
|
|
chenli.wei
On 5/17/2022 8:14 AM, Junjie Mao wrote:
Chenli Wei <chenli.wei@...> writes:This message want to remind user the VM connected to it self, so I change the report-on to make it clear:The current UI have no live-check to check whether a VM connect to`vm_name` is not the name of the vUART connection. 12 <xs:annotation acrn:severity="error" acrn:report-on="$vuart_connection/endpoint"> 13 <xs:documentation>"{$vm_name}" can't connected to itself</xs:documentation> Now the message is: "ERROR:root:/acrn-config/hv/vuart_connections/vuart_connection[2]/endpoint[1], /acrn-config/hv/vuart_connections/vuart_connection[2]/endpoint[2]: "POST_RT_VM1" can't connected to itself"
|
|