mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-10-20 19:58:43 +00:00
Fix the following issues: 1. <gpu> and <displays> elements are added to scenario XML when they are not configured. 2. Virtio GPU components disappears after switching to another tab and switching back to previous tab. 3. Wrong error message of vertical offset checking. Improve the error check in virtio_devices.xsd: 1. Every window virtual display need to configure window resolution, horizontal offset and vertical offset. 2. Any display's elements need to be configured. The existing code only check the first window resolution, horizontal offset, vertical offset and monitor id. Tracked-On: #8292 Signed-off-by: yuchuyang <yu-chu.yang@intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com>
88 lines
4.6 KiB
XML
88 lines
4.6 KiB
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 $vm in /acrn-config/vm satisfies
|
|
every $vsock in $vm/virtio_devices/vsock satisfies
|
|
count(//virtio_devices/vsock[text()=$vsock]) = 1
|
|
">
|
|
<xs:annotation acrn:severity="error" acrn:report-on="$vm">
|
|
<xs:documentation>VM "{$vm/name}" repeats a vsock CID assignment: {$vsock}, used in this VM or another VM. Make all vsock CID values unique.</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:assert>
|
|
|
|
<xs:assert test="every $vm in /acrn-config/vm[./virtio_devices/gpu[display_type = 'Full screen']] satisfies
|
|
$vm/virtio_devices/gpu/displays/display/monitor_id/text() != ''
|
|
">
|
|
<xs:annotation acrn:severity="error" acrn:report-on="$vm">
|
|
<xs:documentation>VM "{$vm/name}": monitor ID is required for "full screen" virtual display.</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:assert>
|
|
|
|
<xs:assert test="every $vm in /acrn-config/vm[./virtio_devices/gpu[display_type = 'Window']] satisfies
|
|
(count($vm//window_resolutions) = count($vm//horizontal_offset)
|
|
and count($vm//window_resolutions) = count($vm//vertical_offset)
|
|
and count($vm//horizontal_offset) = count($vm//vertical_offset))
|
|
">
|
|
<xs:annotation acrn:severity="error" acrn:report-on="$vm">
|
|
<xs:documentation>VM "{$vm/name}": every display's window resolution, horizontal offset and vertical offset are required.</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:assert>
|
|
|
|
<xs:assert test="every $vm in /acrn-config/vm[./virtio_devices/gpu[display_type = 'Window']] satisfies
|
|
$vm/virtio_devices/gpu/displays/display//window_resolutions/text() != ''
|
|
">
|
|
<xs:annotation acrn:severity="error" acrn:report-on="$vm">
|
|
<xs:documentation>VM "{$vm/name}": window resolution is required for "window" virtual display.</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:assert>
|
|
|
|
<xs:assert test="every $vm in /acrn-config/vm[./virtio_devices/gpu[display_type = 'Window']] satisfies
|
|
$vm/virtio_devices/gpu/displays/display//horizontal_offset/text() != ''
|
|
">
|
|
<xs:annotation acrn:severity="error" acrn:report-on="$vm">
|
|
<xs:documentation>VM "{$vm/name}": horizontal offset (pixels) is required for "window" virtual displays.</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:assert>
|
|
|
|
<xs:assert test="every $vm in /acrn-config/vm[./virtio_devices/gpu[display_type = 'Window']] satisfies
|
|
$vm/virtio_devices/gpu/displays/display//vertical_offset/text() != ''
|
|
">
|
|
<xs:annotation acrn:severity="error" acrn:report-on="$vm">
|
|
<xs:documentation>VM "{$vm/name}": vertical offset (pixels) is required for "window" virtual displays.</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:assert>
|
|
|
|
<xs:assert test="every $vm in /acrn-config/vm[./virtio_devices/gpu[display_type = 'Full screen']] satisfies
|
|
every $monitor_id in $vm/virtio_devices/gpu/displays/display/monitor_id satisfies
|
|
count(//gpu[display_type = 'Full screen']//monitor_id[./text()=$monitor_id]) = 1
|
|
">
|
|
<xs:annotation acrn:severity="error" acrn:report-on="$vm">
|
|
<xs:documentation>The monitor id "{$monitor_id}" has been assigned multiple times to VM "{$vm/name}".
|
|
Choose a different monitor id or remove some of the virtual displays which have the same monitor id.</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:assert>
|
|
|
|
<xs:assert test="every $vm in /acrn-config/vm satisfies
|
|
count($vm/virtio_devices/gpu[display_type = 'Full screen']/displays/display) < 5
|
|
">
|
|
<xs:annotation acrn:severity="error" acrn:report-on="$vm">
|
|
<xs:documentation>VM "{$vm/name}" support 4 virtual displays at most in the full screen mode.
|
|
Remove some of the virtual displays so that the total number does not exceed that limit.</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:assert>
|
|
|
|
<xs:assert test="every $vm in /acrn-config/vm satisfies
|
|
count($vm/virtio_devices/gpu[display_type = 'Window']/displays/display) < 3
|
|
">
|
|
<xs:annotation acrn:severity="error" acrn:report-on="$vm">
|
|
<xs:documentation>VM "{$vm/name}" support 2 virtual windows at most.
|
|
Remove some of the virtual displays so that the total number does not exceed that limit.</xs:documentation>
|
|
</xs:annotation>
|
|
</xs:assert>
|
|
|
|
</xs:schema>
|