config_tools: refine Virtio devices in the schema

We have redesigned Virtio and UI for user, so this patch updates the schema
for the new design.

Tracked-On: #6690
Signed-off-by: Kunhui-Li <kunhuix.li@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Kunhui-Li 2022-03-14 21:33:23 +08:00 committed by acrnsi-robot
parent cb5d245d9e
commit 76dc2b3a5e
2 changed files with 123 additions and 21 deletions

View File

@ -253,6 +253,108 @@ CLOSID 0 and the second is mapped to virtual CLOSID 1, etc.</xs:documentation>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
<xs:simpleType name="VirtioNetworkFrameworkType">
<xs:restriction base="xs:string">
<xs:enumeration value="Kernel based (Virtual Host)" />
<xs:enumeration value="User space based (VBSU)" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="VirtioNetworkConfiguration">
<xs:sequence>
<xs:element name="virtio_framework" type="VirtioNetworkFrameworkType" default="User space based (VBSU)" minOccurs="0">
<xs:annotation acrn:title="Virtio framework">
<xs:documentation>Specify the virtio framework for specific virtio network device implemented in the Service VM.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="interface_name" minOccurs="0">
<xs:annotation acrn:title="Network interface name">
<xs:documentation>Specify the network interface name that will appear in the Service VM. Use the `ip a` command in the Service VM to display the network interface names.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z0-9_\-]+" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="VirtioConsoleUseType">
<xs:restriction base="xs:string">
<xs:enumeration value="Virtio console" />
<xs:enumeration value="Virtio serial port" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="VirtioConsoleBackendType">
<xs:restriction base="xs:string">
<xs:enumeration value="pty" />
<xs:enumeration value="stdio" />
<xs:enumeration value="file" />
<xs:enumeration value="sock client">
<xs:annotation acrn:views="" />
</xs:enumeration>
<xs:enumeration value="sock server">
<xs:annotation acrn:views="" />
</xs:enumeration>
<xs:enumeration value="tty" >
<xs:annotation acrn:views="" />
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="VirtioConsoleConfiguration">
<xs:sequence>
<xs:element name="use_type" type="VirtioConsoleUseType" minOccurs="0">
<xs:annotation acrn:title="Use type">
<xs:documentation>Specify device type in guest, ether HVC console when user config it as virtio console or /dev/vportXpY
device file when user config it as virtio serial port, which can be read and written from the user space.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="backend_type" type="VirtioConsoleBackendType" minOccurs="0">
<xs:annotation acrn:title="Backend type">
<xs:documentation>Specify backend device type in service VM.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="output_file_path" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation acrn:title="Output file path">
<xs:documentation>The output file path for the file backend type.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="sock_file_path" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation acrn:title="Sock file path">
<xs:documentation>The sock file path for the sock server or client backend type.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="tty_device_path" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation acrn:title="TTY device path">
<xs:documentation>The device path for the tty backend type.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="VirtioInputConfiguration">
<xs:sequence>
<xs:element name="backend_device_file" type="xs:string" minOccurs="0">
<xs:annotation acrn:title="Backend device file">
<xs:documentation>Specifying backend device in service vm with device description.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="id" minOccurs="0">
<xs:annotation acrn:title="Guest virtio input device unique identifier">
<xs:documentation>Specifying unique identifier to distinguish same devices in guest.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z0-9_\-]*" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="OSType"> <xs:simpleType name="OSType">
<xs:restriction base="xs:string"> <xs:restriction base="xs:string">
<xs:enumeration value="Non-Windows OS" /> <xs:enumeration value="Non-Windows OS" />

View File

@ -438,31 +438,31 @@ argument and memory.</xs:documentation>
</xs:annotation> </xs:annotation>
<xs:complexType> <xs:complexType>
<xs:all> <xs:all>
<xs:element name="console" type="xs:string" minOccurs="0"> <xs:element name="console" type="VirtioConsoleConfiguration" minOccurs="0">
<xs:annotation acrn:views="basic"> <xs:annotation acrn:title="Virtio console device" acrn:views="basic">
<xs:documentation>The virtio console device setting. Input format: <xs:documentation>Virtio console device for data input and output.
``[@]stdio|tty|pty|sock:portname[=portpath][,[@]stdio|tty|pty:portname[=portpath]]``</xs:documentation> The virtio console BE driver copies data from the frontend's transmitting virtqueue when it receives a kick on virtqueue (implemented as a vmexit).
The BE driver then writes the data to backend, and can be implemented as PTY, TTY, STDIO, and regular file.
For details, reference to https://projectacrn.github.io/latest/developer-guides/hld/virtio-console.html.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:element> </xs:element>
<xs:element name="network" type="xs:string" minOccurs="0"> <xs:element name="network" type="VirtioNetworkConfiguration" minOccurs="0" maxOccurs="unbounded">
<xs:annotation acrn:views="basic"> <xs:annotation acrn:title="Virtio network device" acrn:views="basic">
<xs:documentation>The virtio network device setting. <xs:documentation>The virtio network device emulates a virtual network interface card (NIC) for the VM.
Input format: ``device_name[,vhost][,mac=XX:XX:XX:XX:XX:XX]``. The frontend is the virtio network driver, simulating the virtual NIC. The backend could be:
The ``device_name`` is the name of the TAP (or MacVTap) device. 1. ``tap`` device /dev/net/tun; 2. ``MacVTap`` device (/dev/tapx); 3. ``vhost`` device /dev/vhost-net.</xs:documentation>
It must include the keyword ``tap``. ``vhost`` specifies the
vhost backend; otherwise, the VBSU backend is used. The ``mac``
address is optional.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:element> </xs:element>
<xs:element name="input" type="xs:string" minOccurs="0"> <xs:element name="input" type="VirtioInputConfiguration" minOccurs="0" maxOccurs="unbounded">
<xs:annotation acrn:views="basic"> <xs:annotation acrn:title="Virtio input device" acrn:views="basic">
<xs:documentation>The virtio input device setting.</xs:documentation> <xs:documentation>The virtio input device creates a virtual human interface device such as a keyboard, mouse, and tablet.
It sends Linux input layer events over virtio.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:element> </xs:element>
<xs:element name="block" type="xs:string" minOccurs="0" maxOccurs="unbounded"> <xs:element name="block" type="xs:string" minOccurs="0" maxOccurs="unbounded">
<xs:annotation acrn:views="basic"> <xs:annotation acrn:title="Virtio block device" acrn:views="basic">
<xs:documentation>The virtio block device setting. <xs:documentation>The virtio-blk device presents a block device to the VM.
Format: ``[blk partition:][img path]``. Example: ``/dev/sda3:./a/b.img``.</xs:documentation> Each virtio-blk device appears as a disk inside the VM.</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:element> </xs:element>
</xs:all> </xs:all>