mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-03 15:43:51 +00:00
docs: Emphasize that devices have to be inside the <devices> element
Also cleanup indentation of domain XML examples.
This commit is contained in:
parent
0b907122b7
commit
ce71bfa817
@ -28,8 +28,8 @@
|
||||
|
||||
<h3><a name="elementsMetadata">General metadata</a></h3>
|
||||
|
||||
<pre>
|
||||
<domain type='xen' id='3'>
|
||||
<pre>
|
||||
<domain type='xen' id='3'>
|
||||
<name>fv0</name>
|
||||
<uuid>4dea22b31d52d8f32516782e98ab3fa0</uuid>
|
||||
...</pre>
|
||||
@ -66,7 +66,7 @@
|
||||
to obtain/find the boot image.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<os>
|
||||
<type>hvm</type>
|
||||
@ -109,7 +109,7 @@
|
||||
An example is <code>pygrub</code> with Xen.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<bootloader>/usr/bin/pygrub</bootloader>
|
||||
<bootloader_args>--append single</bootloader_args>
|
||||
@ -139,7 +139,7 @@
|
||||
is usually available for both para and full virtualized guests.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<os>
|
||||
<type>hvm</type>
|
||||
@ -172,7 +172,7 @@
|
||||
|
||||
<h3><a name="elementsResources">Basic resources</a></h3>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<memory>524288</memory>
|
||||
<currentMemory>524288</currentMemory>
|
||||
@ -209,7 +209,7 @@
|
||||
<span class="since">Since 0.7.5</span>
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<cpu match='exact'>
|
||||
<model>core2duo</model>
|
||||
@ -224,7 +224,7 @@
|
||||
<span class="since">Since 0.7.6</span>
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<cpu>
|
||||
<topology sockets='1' cores='2' threads='1'/>
|
||||
@ -305,7 +305,7 @@
|
||||
re-configured for the first post-install bootup.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
@ -350,7 +350,7 @@
|
||||
toggled on/off.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<features>
|
||||
<pae/>
|
||||
@ -386,7 +386,7 @@
|
||||
it to be in so called 'localtime'.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<clock offset="localtime"/>
|
||||
...</pre>
|
||||
@ -408,10 +408,11 @@
|
||||
<span class="since">Since 0.1.3</span>
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<emulator>/usr/lib/xen/bin/qemu-dm</emulator>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<dl>
|
||||
@ -433,8 +434,9 @@
|
||||
element.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<disk type='file'>
|
||||
<driver name="tap" type="aio" cache="default">
|
||||
<source file='/var/lib/xen/images/fv0'/>
|
||||
@ -444,6 +446,7 @@
|
||||
</encryption>
|
||||
<shareable/>
|
||||
</disk>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<dl>
|
||||
@ -500,23 +503,29 @@
|
||||
0.4.4 for USB and 0.6.0 for PCI (KVM only)</span>:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<hostdev mode='subsystem' type='usb'>
|
||||
<source>
|
||||
<vendor id='0x1234'/>
|
||||
<product id='0xbeef'/>
|
||||
</source>
|
||||
</hostdev>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<p>or:</p>
|
||||
<pre>
|
||||
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<hostdev mode='subsystem' type='pci'>
|
||||
<source>
|
||||
<address bus='0x06' slot='0x02' function='0x0'/>
|
||||
</source>
|
||||
</hostdev>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<dl>
|
||||
@ -556,13 +565,15 @@
|
||||
|
||||
<h4><a name="elementsNICS">Network interfaces</a></h4>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<interface type='bridge'>
|
||||
<source bridge='xenbr0'/>
|
||||
<mac address='00:16:3e:5d:c7:9e'/>
|
||||
<script path='vif-bridge'/>
|
||||
</interface>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<h5><a name="elementsNICSVirtual">Virtual network</a></h5>
|
||||
@ -589,8 +600,9 @@
|
||||
<a href="#elementsNICSTargetOverride">overriding the target element</a>).
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
</interface>
|
||||
@ -600,6 +612,7 @@
|
||||
<target dev='vnet7'/>
|
||||
<mac address="11:22:33:44:55:66"/>
|
||||
</interface>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<h5><a name="elementsNICSBridge">Bridge to LAN</a></h5>
|
||||
@ -623,17 +636,19 @@
|
||||
full incoming & outgoing net access just like a physical machine.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<interface type='bridge'>
|
||||
<source bridge='br0'/>
|
||||
</interface>
|
||||
|
||||
...
|
||||
<interface type='bridge'>
|
||||
<source bridge='br0'/>
|
||||
<target dev='vnet7'/>
|
||||
<mac address="11:22:33:44:55:66"/>
|
||||
</interface>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<h5><a name="elementsNICSSlirp">Userspace SLIRP stack</a></h5>
|
||||
@ -647,13 +662,15 @@
|
||||
VMs to have outgoing access.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<interface type='user'/>
|
||||
...
|
||||
<interface type='user'>
|
||||
<mac address="11:22:33:44:55:66"/>
|
||||
</interface>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
|
||||
@ -669,14 +686,16 @@
|
||||
overridden.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<interface type='ethernet'/>
|
||||
...
|
||||
<interface type='ethernet'>
|
||||
<target dev='vnet7'/>
|
||||
<script path='/etc/qemu-ifup-mynet'/>
|
||||
</interface>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<h5><a name="elementsNICSMulticast">Multicast tunnel</a></h5>
|
||||
@ -693,11 +712,13 @@
|
||||
multicast address block.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<interface type='mcast'>
|
||||
<source address='230.0.0.1' port='5558'/>
|
||||
</interface>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<h5><a name="elementsNICSTCP">TCP tunnel</a></h5>
|
||||
@ -711,8 +732,9 @@
|
||||
network access, one of the VMs should have a 2nd NIC which is connected
|
||||
to one of the first 4 network types and do the appropriate routing.</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<interface type='server'>
|
||||
<source address='192.168.0.1' port='5558'/>
|
||||
</interface>
|
||||
@ -720,17 +742,20 @@
|
||||
<interface type='client'>
|
||||
<source address='192.168.0.1' port='5558'/>
|
||||
</interface>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<h5><a name="elementsNICSModel">Setting the NIC model</a></h5>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
<target dev='vnet1'/>
|
||||
<b><model type='ne2k_pci'/></b>
|
||||
</interface>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<p>
|
||||
@ -757,12 +782,14 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
|
||||
<h5><a name="elementsNICSTargetOverride">Overriding the target element</a></h5>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
<b><target dev='vnet1'/></b>
|
||||
</interface>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<p>
|
||||
@ -783,9 +810,11 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
to provide a graphics tablet for absolute cursor movement.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<input type='mouse' bus='usb'/>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<dl>
|
||||
@ -807,12 +836,14 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
admin.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<graphics type='sdl' display=':0.0'/>
|
||||
<graphics type='vnc' port='5904'/>
|
||||
<graphics type='rdp' autoport='yes' multiUser='yes' />
|
||||
<graphics type='desktop' fullscreen='yes'/>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<dl>
|
||||
@ -867,13 +898,15 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
A video device.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<video>
|
||||
<model type='vga' vram='8192' heads='1'>
|
||||
<acceleration accel3d='yes' accel3d='yes'/>
|
||||
</model>
|
||||
</video>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<dl>
|
||||
@ -907,8 +940,9 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
all classed as character devices and so represented using the same syntax.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<parallel type='pty'>
|
||||
<source path='/dev/pts/2'/>
|
||||
<target port='0'/>
|
||||
@ -926,7 +960,7 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
<target type='guestfwd' address='10.0.2.1' port='4600'/>
|
||||
</channel>
|
||||
</devices>
|
||||
</domain></pre>
|
||||
...</pre>
|
||||
|
||||
<p>
|
||||
In each of these directives, the top-level element name (parallel, serial,
|
||||
@ -949,12 +983,14 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
|
||||
<h6><a name="elementCharParallel">Parallel port</a></h6>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<parallel type='pty'>
|
||||
<source path='/dev/pts/2'/>
|
||||
<target port='0'/>
|
||||
</parallel>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<p>
|
||||
@ -965,12 +1001,14 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
|
||||
<h6><a name="elementCharSerial">Serial port</a></h6>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<serial type='pty'>
|
||||
<source path='/dev/pts/3'/>
|
||||
<target port='0'/>
|
||||
</serial>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<p>
|
||||
@ -987,12 +1025,14 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
virtualized guests without a paravirtualized console.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<console type='pty'>
|
||||
<source path='/dev/pts/4'/>
|
||||
<target port='0'/>
|
||||
</console>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<p>
|
||||
@ -1008,12 +1048,14 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
guest.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<channel type='unix'>
|
||||
<source mode='bind' path='/tmp/guestfwd'/>
|
||||
<target type='guestfwd' address='10.0.2.1' port='4600'/>
|
||||
</channel>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<p>
|
||||
@ -1045,11 +1087,13 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
into the virtual machine's logfile
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<console type='stdio'>
|
||||
<target port='1'>
|
||||
</console>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
|
||||
@ -1060,12 +1104,14 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
device is written to the file.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<serial type="file">
|
||||
<source path="/var/log/vm/vm-serial.log"/>
|
||||
<target port="1"/>
|
||||
</serial>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<h6><a name="elementsCharVC">Virtual console</a></h6>
|
||||
@ -1076,11 +1122,13 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
hotkey sequence such as "ctrl+alt+3"
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<serial type='vc'>
|
||||
<target port="1"/>
|
||||
</serial>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<h6><a name="elementsCharNull">Null device</a></h6>
|
||||
@ -1090,11 +1138,13 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
provided to the input. All data written is discarded.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<serial type='null'>
|
||||
<target port="1"/>
|
||||
</serial>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<h6><a name="elementsCharPTY">Pseudo TTY</a></h6>
|
||||
@ -1105,12 +1155,14 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
serial port locally.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<serial type="pty">
|
||||
<source path="/dev/pts/3"/>
|
||||
<target port="1"/>
|
||||
</serial>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<p>
|
||||
@ -1130,12 +1182,14 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
port.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<serial type="dev">
|
||||
<source path="/dev/ttyS0"/>
|
||||
<target port="1"/>
|
||||
</serial>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<h6><a name="elementsCharPipe">Named pipe</a></h6>
|
||||
@ -1145,12 +1199,14 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
more info.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<serial type="pipe">
|
||||
<source path="/tmp/mypipe"/>
|
||||
<target port="1"/>
|
||||
</serial>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<h6><a name="elementsCharTCP">TCP client/server</a></h6>
|
||||
@ -1160,34 +1216,39 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
remote server.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<serial type="tcp">
|
||||
<source mode="connect" host="0.0.0.0" service="2445"/>
|
||||
<protocol type="raw"/>
|
||||
<target port="1"/>
|
||||
</serial>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<p>
|
||||
Or as a TCP server waiting for a client connection.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<serial type="tcp">
|
||||
<source mode="bind" host="127.0.0.1" service="2445"/>
|
||||
<protocol type="raw"/>
|
||||
<target port="1"/>
|
||||
</serial>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<p>
|
||||
Alternatively you can use telnet instead of raw TCP.
|
||||
<p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<serial type="tcp">
|
||||
<source mode="connect" host="0.0.0.0" service="2445"/>
|
||||
<protocol type="telnet"/>
|
||||
@ -1199,6 +1260,7 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
<protocol type="telnet"/>
|
||||
<target port="1"/>
|
||||
</serial>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<h6><a name="elementsCharUDP">UDP network console</a></h6>
|
||||
@ -1208,13 +1270,15 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
sending and receiving packets. This is a lossy service.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<serial type="udp">
|
||||
<source mode="bind" host="0.0.0.0" service="2445"/>
|
||||
<source mode="connect" host="0.0.0.0" service="2445"/>
|
||||
<target port="1"/>
|
||||
</serial>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<h6><a name="elementsCharUNIX">UNIX domain socket client/server</a></h6>
|
||||
@ -1224,12 +1288,14 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
accepting connections from local clients.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<serial type="unix">
|
||||
<source mode="bind" path="/tmp/foo"/>
|
||||
<target port="1"/>
|
||||
</serial>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
|
||||
@ -1240,9 +1306,11 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
<code>sound</code> element. <span class="since">Since 0.4.3</span>
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<sound model='es1370'/>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<dl>
|
||||
@ -1276,15 +1344,19 @@ qemu-kvm -net nic,model=? /dev/null
|
||||
libvirt.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<watchdog model='i6300esb'/>
|
||||
</devices>
|
||||
...</pre>
|
||||
|
||||
<pre>
|
||||
<pre>
|
||||
...
|
||||
<devices>
|
||||
<watchdog model='i6300esb' action='poweroff'/>
|
||||
...</pre>
|
||||
</devices>
|
||||
</domain></pre>
|
||||
|
||||
<dl>
|
||||
<dt><code>model</code></dt>
|
||||
|
Loading…
x
Reference in New Issue
Block a user