mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
domain.rng vs. formatdomain.html#elementsUSB
The Relax-NG schema for domains regarding <hostdev> doesn't match what's implemented in src/conf/domain_conf.c#virDomainHostdevDefFormat(): The implementation only requires @type, but the schema currently either required none or all three attributes (@mode, @type, and @managed) to be defined together, because they are declared in the same <optional)-section. (@managed is currently even undocumented on <http://libvirt.org/formatdomain.html#elementsUSB>). Thus the following minimal <hostdev>-example fails to validate: <domain type='test'> <name>N</name> <memory>4096</memory> <bootloader>/bin/false</bootloader> <os> <type arch='x86_64' machine='xenpv'>linux</type> </os> <devices> <hostdev type='pci'> <source> <address bus='0x06' slot='0x00' function='0x0'/> </source> </hostdev> </devices> </domain> The schema is changed to match the current implementation: 1. @mode is optional (which defaults to 'subsystem') 2. @type is required 3. @managed is optional (which defaults to 'no') The documentation is updated to mention @managed. Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
parent
de6b8a0800
commit
a757e60a07
@ -954,7 +954,7 @@
|
|||||||
<pre>
|
<pre>
|
||||||
...
|
...
|
||||||
<devices>
|
<devices>
|
||||||
<hostdev mode='subsystem' type='pci'>
|
<hostdev mode='subsystem' type='pci' managed='yes'>
|
||||||
<source>
|
<source>
|
||||||
<address bus='0x06' slot='0x02' function='0x0'/>
|
<address bus='0x06' slot='0x02' function='0x0'/>
|
||||||
</source>
|
</source>
|
||||||
@ -967,8 +967,10 @@
|
|||||||
<dt><code>hostdev</code></dt>
|
<dt><code>hostdev</code></dt>
|
||||||
<dd>The <code>hostdev</code> element is the main container for describing
|
<dd>The <code>hostdev</code> element is the main container for describing
|
||||||
host devices. For usb device passthrough <code>mode</code> is always
|
host devices. For usb device passthrough <code>mode</code> is always
|
||||||
"subsystem" and <code>type</code> is "usb" for an USB device and "pci"
|
"subsystem" and <code>type</code> is "usb" for a USB device and "pci"
|
||||||
for a PCI device..
|
for a PCI device. When <code>managed</code> is "yes" for a PIC
|
||||||
|
device, it is detached from the host before being passed on to
|
||||||
|
the guest.</dd>
|
||||||
<dt><code>source</code></dt>
|
<dt><code>source</code></dt>
|
||||||
<dd>The source element describes the device as seen from the host.
|
<dd>The source element describes the device as seen from the host.
|
||||||
The USB device can either be addressed by vendor / product id using the
|
The USB device can either be addressed by vendor / product id using the
|
||||||
|
@ -1731,12 +1731,14 @@
|
|||||||
<value>capabilities</value>
|
<value>capabilities</value>
|
||||||
</choice>
|
</choice>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
</optional>
|
||||||
<attribute name="type">
|
<attribute name="type">
|
||||||
<choice>
|
<choice>
|
||||||
<value>usb</value>
|
<value>usb</value>
|
||||||
<value>pci</value>
|
<value>pci</value>
|
||||||
</choice>
|
</choice>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
<optional>
|
||||||
<attribute name="managed">
|
<attribute name="managed">
|
||||||
<choice>
|
<choice>
|
||||||
<value>yes</value>
|
<value>yes</value>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user