Files
acrn-hypervisor/misc/config_tools/schema/checks/pci_config.xsd
Chenli Wei 6ac196d982 misc: add assert to check the duplicate devices
The current ACRN-Configurator allow user add duplicate PCI devices to
passthrough which it is not correct.

This patch add an assert to check the duplicate of PCI devices.

Tracked-On: #6690
Signed-off-by: Chenli Wei <chenli.wei@linux.intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-08-03 15:34:06 +08:00

17 lines
719 B
XML

<?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 $pci_device in /acrn-config//pci_dev satisfies
count(/acrn-config//pci_dev[./text()=$pci_device]) = 1">
<xs:annotation acrn:severity="error" acrn:report-on="//vm[./pci_devs/pci_dev/text()=$pci_device]">
<xs:documentation>The PCI device '{$pci_device}' has been assigned multiple times to VM(s) '{//vm[./pci_devs/pci_dev/text()=$pci_device]/name}' </xs:documentation>
</xs:annotation>
</xs:assert>
</xs:schema>