From: Matthias Bolte Date: Thu, 4 Feb 2010 14:27:52 +0000 (+0100) Subject: docs: Emphasize that devices have to be inside the element X-Git-Tag: v0.7.7~247 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce71bfa817f75af99834c11f1b60d0269e5be1ca;p=thirdparty%2Flibvirt.git docs: Emphasize that devices have to be inside the element Also cleanup indentation of domain XML examples. --- diff --git a/docs/drvxen.html.in b/docs/drvxen.html.in index a6f0e5728d..4e35afa30a 100644 --- a/docs/drvxen.html.in +++ b/docs/drvxen.html.in @@ -234,9 +234,9 @@ vif = [ "mac=00:16:3e:60:36:ba,bridge=virbr0,script=vif-bridge,vifname=vif5.0" ] <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <features> - <pae/> - <acpi/> - <apic/> + <pae/> + <acpi/> + <apic/> </features> <clock sync="localtime"/> <devices> @@ -288,9 +288,9 @@ vif = [ "mac=00:16:3e:60:36:ba,bridge=virbr0,script=vif-bridge,vifname=vif5.0" ] <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <features> - <pae/> - <acpi/> - <apic/> + <pae/> + <acpi/> + <apic/> </features> <clock sync="localtime"/> <devices> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index ce49f7d493..083a80af53 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -28,11 +28,11 @@

General metadata

-
-      <domain type='xen' id='3'>
-        <name>fv0</name>
-        <uuid>4dea22b31d52d8f32516782e98ab3fa0</uuid>
-        ...
+
+<domain type='xen' id='3'>
+  <name>fv0</name>
+  <uuid>4dea22b31d52d8f32516782e98ab3fa0</uuid>
+  ...
name
@@ -66,14 +66,14 @@ to obtain/find the boot image.

-
-        ...
-        <os>
-          <type>hvm</type>
-          <loader>/usr/lib/xen/boot/hvmloader</loader>
-          <boot dev='hd'/>
-        </os>
-        ...
+
+  ...
+  <os>
+    <type>hvm</type>
+    <loader>/usr/lib/xen/boot/hvmloader</loader>
+    <boot dev='hd'/>
+  </os>
+  ...
type
@@ -109,11 +109,11 @@ An example is pygrub with Xen.

-
-        ...
-        <bootloader>/usr/bin/pygrub</bootloader>
-        <bootloader_args>--append single</bootloader_args>
-        ...
+
+  ...
+  <bootloader>/usr/bin/pygrub</bootloader>
+  <bootloader_args>--append single</bootloader_args>
+  ...
bootloader
@@ -139,16 +139,16 @@ is usually available for both para and full virtualized guests.

-
-        ...
-        <os>
-          <type>hvm</type>
-          <loader>/usr/lib/xen/boot/hvmloader</loader>
-          <kernel>/root/f8-i386-vmlinuz</kernel>
-          <initrd>/root/f8-i386-initrd</initrd>
-          <cmdline>console=ttyS0 ks=http://example.com/f8-i386/os/</cmdline>
-        </os>
-        ...
+
+  ...
+  <os>
+    <type>hvm</type>
+    <loader>/usr/lib/xen/boot/hvmloader</loader>
+    <kernel>/root/f8-i386-vmlinuz</kernel>
+    <initrd>/root/f8-i386-initrd</initrd>
+    <cmdline>console=ttyS0 ks=http://example.com/f8-i386/os/</cmdline>
+  </os>
+  ...
type
@@ -172,15 +172,15 @@

Basic resources

-
-        ...
-        <memory>524288</memory>
-        <currentMemory>524288</currentMemory>
-        <memoryBacking>
-          <hugepages/>
-        </memoryBacking>
-        <vcpu>1</vcpu>
-        ...
+
+  ...
+  <memory>524288</memory>
+  <currentMemory>524288</currentMemory>
+  <memoryBacking>
+    <hugepages/>
+  </memoryBacking>
+  <vcpu>1</vcpu>
+  ...
memory
@@ -209,14 +209,14 @@ Since 0.7.5

-
-        ...
-        <cpu match='exact'>
-          <model>core2duo</model>
-          <topology sockets='1' cores='2' threads='1'/>
-          <feature policy='disable' name='lahf_lm'/>
-        </cpu>
-        ...
+
+  ...
+  <cpu match='exact'>
+    <model>core2duo</model>
+    <topology sockets='1' cores='2' threads='1'/>
+    <feature policy='disable' name='lahf_lm'/>
+  </cpu>
+  ...

In case no restrictions need to be put on CPU model and its features, a @@ -224,12 +224,12 @@ Since 0.7.6

-
-        ...
-        <cpu>
-          <topology sockets='1' cores='2' threads='1'/>
-        </cpu>
-        ...
+
+  ...
+  <cpu>
+    <topology sockets='1' cores='2' threads='1'/>
+  </cpu>
+  ...
cpu
@@ -305,12 +305,12 @@ re-configured for the first post-install bootup.

-
-        ...
-        <on_poweroff>destroy</on_poweroff>
-        <on_reboot>restart</on_reboot>
-        <on_crash>restart</on_crash>
-        ...
+
+  ...
+  <on_poweroff>destroy</on_poweroff>
+  <on_reboot>restart</on_reboot>
+  <on_crash>restart</on_crash>
+  ...
on_poweroff
@@ -350,14 +350,14 @@ toggled on/off.

-
-        ...
-        <features>
-          <pae/>
-          <acpi/>
-          <apic/>
-        </features>
-        ...
+
+  ...
+  <features>
+    <pae/>
+    <acpi/>
+    <apic/>
+  </features>
+  ...

All features are listed within the features @@ -386,10 +386,10 @@ it to be in so called 'localtime'.

-
-        ...
-        <clock offset="localtime"/>
-        ...
+
+  ...
+  <clock offset="localtime"/>
+  ...
clock
@@ -408,11 +408,12 @@ Since 0.1.3

-
-        ...
-        <devices>
-          <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
-          ...
+
+  ...
+  <devices>
+    <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
+  </devices>
+  ...
emulator
@@ -433,18 +434,20 @@ element.

-
-          ...
-          <disk type='file'>
-            <driver name="tap" type="aio" cache="default">
-            <source file='/var/lib/xen/images/fv0'/>
-            <target dev='hda' bus='ide'/>
-            <encryption type='...'>
-              ...
-            </encryption>
-            <shareable/>
-          </disk>
-          ...
+
+  ...
+  <devices>
+    <disk type='file'>
+      <driver name="tap" type="aio" cache="default">
+      <source file='/var/lib/xen/images/fv0'/>
+      <target dev='hda' bus='ide'/>
+      <encryption type='...'>
+        ...
+      </encryption>
+      <shareable/>
+    </disk>
+  </devices>
+  ...
disk
@@ -500,24 +503,30 @@ 0.4.4 for USB and 0.6.0 for PCI (KVM only):

-
-          ...
-          <hostdev mode='subsystem' type='usb'>
-            <source>
-              <vendor id='0x1234'/>
-              <product id='0xbeef'/>
-            </source>
-          </hostdev>
-          ...
+
+  ...
+  <devices>
+    <hostdev mode='subsystem' type='usb'>
+      <source>
+        <vendor id='0x1234'/>
+        <product id='0xbeef'/>
+      </source>
+    </hostdev>
+  </devices>
+  ...
+

or:

-
-          ...
-          <hostdev mode='subsystem' type='pci'>
-            <source>
-              <address bus='0x06' slot='0x02' function='0x0'/>
-            </source>
-          </hostdev>
-          ...
+ +
+  ...
+  <devices>
+    <hostdev mode='subsystem' type='pci'>
+      <source>
+        <address bus='0x06' slot='0x02' function='0x0'/>
+      </source>
+    </hostdev>
+  </devices>
+  ...
hostdev
@@ -556,14 +565,16 @@

Network interfaces

-
-          ...
-          <interface type='bridge'>
-            <source bridge='xenbr0'/>
-            <mac address='00:16:3e:5d:c7:9e'/>
-            <script path='vif-bridge'/>
-          </interface>
-          ...
+
+  ...
+  <devices>
+    <interface type='bridge'>
+      <source bridge='xenbr0'/>
+      <mac address='00:16:3e:5d:c7:9e'/>
+      <script path='vif-bridge'/>
+    </interface>
+  </devices>
+  ...
Virtual network
@@ -589,18 +600,20 @@ overriding the target element).

-
-      ...
-      <interface type='network'>
-        <source network='default'/>
-      </interface>
-      ...
-      <interface type='network'>
-        <source network='default'/>
-        <target dev='vnet7'/>
-        <mac address="11:22:33:44:55:66"/>
-      </interface>
-      ...
+
+  ...
+  <devices>
+    <interface type='network'>
+      <source network='default'/>
+    </interface>
+    ...
+    <interface type='network'>
+      <source network='default'/>
+      <target dev='vnet7'/>
+      <mac address="11:22:33:44:55:66"/>
+    </interface>
+  </devices>
+  ...
Bridge to LAN
@@ -623,18 +636,20 @@ full incoming & outgoing net access just like a physical machine.

-
-      ...
-      <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>
+    <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>
+  ...
Userspace SLIRP stack
@@ -647,14 +662,16 @@ VMs to have outgoing access.

-
-      ...
-      <interface type='user'/>
-      ...
-      <interface type='user'>
-        <mac address="11:22:33:44:55:66"/>
-      </interface>
-      ...
+
+  ...
+  <devices>
+    <interface type='user'/>
+    ...
+    <interface type='user'>
+      <mac address="11:22:33:44:55:66"/>
+    </interface>
+  </devices>
+  ...
Generic ethernet connection
@@ -669,15 +686,17 @@ overridden.

-
-      ...
-      <interface type='ethernet'/>
-      ...
-      <interface type='ethernet'>
-        <target dev='vnet7'/>
-        <script path='/etc/qemu-ifup-mynet'/>
-      </interface>
-      ...
+
+  ...
+  <devices>
+    <interface type='ethernet'/>
+    ...
+    <interface type='ethernet'>
+      <target dev='vnet7'/>
+      <script path='/etc/qemu-ifup-mynet'/>
+    </interface>
+  </devices>
+  ...
Multicast tunnel
@@ -693,12 +712,14 @@ multicast address block.

-
-      ...
-      <interface type='mcast'>
-        <source address='230.0.0.1' port='5558'/>
-      </interface>
-      ...
+
+  ...
+  <devices>
+    <interface type='mcast'>
+      <source address='230.0.0.1' port='5558'/>
+    </interface>
+  </devices>
+  ...
TCP tunnel
@@ -711,27 +732,31 @@ 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.

-
-      ...
-      <interface type='server'>
-        <source address='192.168.0.1' port='5558'/>
-      </interface>
-      ...
-      <interface type='client'>
+
+  ...
+  <devices>
+    <interface type='server'>
       <source address='192.168.0.1' port='5558'/>
-      </interface>
-      ...
+ </interface> + ... + <interface type='client'> + <source address='192.168.0.1' port='5558'/> + </interface> + </devices> + ...
Setting the NIC model
-
-      ...
-      <interface type='network'>
-        <source network='default'/>
-        <target dev='vnet1'/>
-        <model type='ne2k_pci'/>
-      </interface>
-      ...
+
+  ...
+  <devices>
+    <interface type='network'>
+      <source network='default'/>
+      <target dev='vnet1'/>
+      <model type='ne2k_pci'/>
+    </interface>
+  </devices>
+  ...

For hypervisors which support this, you can set the model of @@ -757,13 +782,15 @@ qemu-kvm -net nic,model=? /dev/null

Overriding the target element
-
-      ...
-      <interface type='network'>
-        <source network='default'/>
-        <target dev='vnet1'/>
-      </interface>
-      ...
+
+  ...
+  <devices>
+    <interface type='network'>
+      <source network='default'/>
+      <target dev='vnet1'/>
+    </interface>
+  </devices>
+  ...

If no target is specified, certain hypervisors will automatically @@ -783,10 +810,12 @@ qemu-kvm -net nic,model=? /dev/null to provide a graphics tablet for absolute cursor movement.

-
-          ...
-          <input type='mouse' bus='usb'/>
-          ...
+
+  ...
+  <devices>
+    <input type='mouse' bus='usb'/>
+  </devices>
+  ...
input
@@ -807,13 +836,15 @@ qemu-kvm -net nic,model=? /dev/null admin.

-
-          ...
-          <graphics type='sdl' display=':0.0'/>
-          <graphics type='vnc' port='5904'/>
-          <graphics type='rdp' autoport='yes' multiUser='yes' />
-          <graphics type='desktop' fullscreen='yes'/>
-          ...
+
+  ...
+  <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>
+  ...
graphics
@@ -867,14 +898,16 @@ qemu-kvm -net nic,model=? /dev/null A video device.

-
-      ...
-      <video>
-        <model type='vga' vram='8192' heads='1'>
-          <acceleration accel3d='yes' accel3d='yes'/>
-        </model>
-      </video>
-      ...
+
+  ...
+  <devices>
+    <video>
+      <model type='vga' vram='8192' heads='1'>
+        <acceleration accel3d='yes' accel3d='yes'/>
+      </model>
+    </video>
+  </devices>
+  ...
video
@@ -907,26 +940,27 @@ qemu-kvm -net nic,model=? /dev/null all classed as character devices and so represented using the same syntax.

-
-        ...
-        <parallel type='pty'>
-          <source path='/dev/pts/2'/>
-          <target port='0'/>
-        </parallel>
-        <serial type='pty'>
-          <source path='/dev/pts/3'/>
-          <target port='0'/>
-        </serial>
-        <console type='pty'>
-          <source path='/dev/pts/4'/>
-          <target port='0'/>
-        </console>
-        <channel type='unix'>
-          <source mode='bind' path='/tmp/guestfwd'/>
-          <target type='guestfwd' address='10.0.2.1' port='4600'/>
-        </channel>
-        </devices>
-      </domain>
+
+  ...
+  <devices>
+    <parallel type='pty'>
+      <source path='/dev/pts/2'/>
+      <target port='0'/>
+    </parallel>
+    <serial type='pty'>
+      <source path='/dev/pts/3'/>
+      <target port='0'/>
+    </serial>
+    <console type='pty'>
+      <source path='/dev/pts/4'/>
+      <target port='0'/>
+    </console>
+    <channel type='unix'>
+      <source mode='bind' path='/tmp/guestfwd'/>
+      <target type='guestfwd' address='10.0.2.1' port='4600'/>
+    </channel>
+  </devices>
+  ...

In each of these directives, the top-level element name (parallel, serial, @@ -949,13 +983,15 @@ qemu-kvm -net nic,model=? /dev/null

Parallel port
-
-      ...
-      <parallel type='pty'>
-        <source path='/dev/pts/2'/>
-        <target port='0'/>
-      </parallel>
-      ...
+
+  ...
+  <devices>
+    <parallel type='pty'>
+      <source path='/dev/pts/2'/>
+      <target port='0'/>
+    </parallel>
+  </devices>
+  ...

target can have a port attribute, which @@ -965,13 +1001,15 @@ qemu-kvm -net nic,model=? /dev/null

Serial port
-
-      ...
-      <serial type='pty'>
-        <source path='/dev/pts/3'/>
-        <target port='0'/>
-      </serial>
-      ...
+
+  ...
+  <devices>
+    <serial type='pty'>
+      <source path='/dev/pts/3'/>
+      <target port='0'/>
+    </serial>
+  </devices>
+  ...

target can have a port attribute, which @@ -987,13 +1025,15 @@ qemu-kvm -net nic,model=? /dev/null virtualized guests without a paravirtualized console.

-
-      ...
-      <console type='pty'>
-        <source path='/dev/pts/4'/>
-        <target port='0'/>
-      </console>
-      ...
+
+  ...
+  <devices>
+    <console type='pty'>
+      <source path='/dev/pts/4'/>
+      <target port='0'/>
+    </console>
+  </devices>
+  ...

If the console is presented as a serial port, the target @@ -1008,13 +1048,15 @@ qemu-kvm -net nic,model=? /dev/null guest.

-
-      ...
-      <channel type='unix'>
-        <source mode='bind' path='/tmp/guestfwd'/>
-        <target type='guestfwd' address='10.0.2.1' port='4600'/>
-      </channel>
-      ...
+
+  ...
+  <devices>
+    <channel type='unix'>
+      <source mode='bind' path='/tmp/guestfwd'/>
+      <target type='guestfwd' address='10.0.2.1' port='4600'/>
+    </channel>
+  </devices>
+  ...

This can be implemented in a variety of ways. The specific type of @@ -1045,12 +1087,14 @@ qemu-kvm -net nic,model=? /dev/null into the virtual machine's logfile

-
-      ...
-      <console type='stdio'>
-        <target port='1'>
-      </console>
-      ...
+
+  ...
+  <devices>
+    <console type='stdio'>
+      <target port='1'>
+    </console>
+  </devices>
+  ...
Device logfile
@@ -1060,13 +1104,15 @@ qemu-kvm -net nic,model=? /dev/null device is written to the file.

-
-      ...
-      <serial type="file">
-        <source path="/var/log/vm/vm-serial.log"/>
-        <target port="1"/>
-      </serial>
-      ...
+
+  ...
+  <devices>
+    <serial type="file">
+      <source path="/var/log/vm/vm-serial.log"/>
+      <target port="1"/>
+    </serial>
+  </devices>
+  ...
Virtual console
@@ -1076,12 +1122,14 @@ qemu-kvm -net nic,model=? /dev/null hotkey sequence such as "ctrl+alt+3"

-
-      ...
-      <serial type='vc'>
-        <target port="1"/>
-      </serial>
-      ...
+
+  ...
+  <devices>
+    <serial type='vc'>
+      <target port="1"/>
+    </serial>
+  </devices>
+  ...
Null device
@@ -1090,12 +1138,14 @@ qemu-kvm -net nic,model=? /dev/null provided to the input. All data written is discarded.

-
-      ...
-      <serial type='null'>
-        <target port="1"/>
-      </serial>
-      ...
+
+  ...
+  <devices>
+    <serial type='null'>
+      <target port="1"/>
+    </serial>
+  </devices>
+  ...
Pseudo TTY
@@ -1105,13 +1155,15 @@ qemu-kvm -net nic,model=? /dev/null serial port locally.

-
-      ...
-      <serial type="pty">
-        <source path="/dev/pts/3"/>
-        <target port="1"/>
-      </serial>
-      ...
+
+  ...
+  <devices>
+    <serial type="pty">
+      <source path="/dev/pts/3"/>
+      <target port="1"/>
+    </serial>
+  </devices>
+  ...

NB special case if <console type='pty'>, then the TTY @@ -1130,13 +1182,15 @@ qemu-kvm -net nic,model=? /dev/null port.

-
-      ...
-      <serial type="dev">
-        <source path="/dev/ttyS0"/>
-        <target port="1"/>
-      </serial>
-      ...
+
+  ...
+  <devices>
+    <serial type="dev">
+      <source path="/dev/ttyS0"/>
+      <target port="1"/>
+  </serial>
+  </devices>
+  ...
Named pipe
@@ -1145,13 +1199,15 @@ qemu-kvm -net nic,model=? /dev/null more info.

-
-      ...
-      <serial type="pipe">
-        <source path="/tmp/mypipe"/>
-        <target port="1"/>
-      </serial>
-      ...
+
+  ...
+  <devices>
+    <serial type="pipe">
+      <source path="/tmp/mypipe"/>
+      <target port="1"/>
+    </serial>
+  </devices>
+  ...
TCP client/server
@@ -1160,46 +1216,52 @@ qemu-kvm -net nic,model=? /dev/null remote server.

-
-      ...
-      <serial type="tcp">
-        <source mode="connect" host="0.0.0.0" service="2445"/>
-        <protocol type="raw"/>
-        <target port="1"/>
-      </serial>
-      ...
+
+  ...
+  <devices>
+    <serial type="tcp">
+      <source mode="connect" host="0.0.0.0" service="2445"/>
+      <protocol type="raw"/>
+      <target port="1"/>
+    </serial>
+  </devices>
+   ...

Or as a TCP server waiting for a client connection.

-
-      ...
-      <serial type="tcp">
-        <source mode="bind" host="127.0.0.1" service="2445"/>
-        <protocol type="raw"/>
-        <target port="1"/>
-      </serial>
-      ...
+
+  ...
+  <devices>
+    <serial type="tcp">
+      <source mode="bind" host="127.0.0.1" service="2445"/>
+      <protocol type="raw"/>
+      <target port="1"/>
+    </serial>
+  </devices>
+  ...

Alternatively you can use telnet instead of raw TCP.

-

-      ...
-      <serial type="tcp">
-        <source mode="connect" host="0.0.0.0" service="2445"/>
-        <protocol type="telnet"/>
-        <target port="1"/>
-      </serial>
-      ...
-      <serial type="tcp">
-        <source mode="bind" host="127.0.0.1" service="2445"/>
-        <protocol type="telnet"/>
-        <target port="1"/>
-      </serial>
-      ...
+
+  ...
+  <devices>
+    <serial type="tcp">
+      <source mode="connect" host="0.0.0.0" service="2445"/>
+      <protocol type="telnet"/>
+      <target port="1"/>
+    </serial>
+    ...
+    <serial type="tcp">
+      <source mode="bind" host="127.0.0.1" service="2445"/>
+      <protocol type="telnet"/>
+      <target port="1"/>
+    </serial>
+  </devices>
+  ...
UDP network console
@@ -1208,14 +1270,16 @@ qemu-kvm -net nic,model=? /dev/null sending and receiving packets. This is a lossy service.

-
-      ...
-      <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>
+    <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>
+  ...
UNIX domain socket client/server
@@ -1224,13 +1288,15 @@ qemu-kvm -net nic,model=? /dev/null accepting connections from local clients.

-
-      ...
-      <serial type="unix">
-        <source mode="bind" path="/tmp/foo"/>
-        <target port="1"/>
-      </serial>
-      ...
+
+  ...
+  <devices>
+    <serial type="unix">
+      <source mode="bind" path="/tmp/foo"/>
+      <target port="1"/>
+    </serial>
+  </devices>
+  ...

Sound devices

@@ -1240,10 +1306,12 @@ qemu-kvm -net nic,model=? /dev/null sound element. Since 0.4.3

-
-      ...
-      <sound model='es1370'/>
-      ...
+
+  ...
+  <devices>
+    <sound model='es1370'/>
+  </devices>
+  ...
sound
@@ -1276,15 +1344,19 @@ qemu-kvm -net nic,model=? /dev/null libvirt.

-
-      ...
-      <watchdog model='i6300esb'/>
-      ...
+
+  ...
+  <devices>
+    <watchdog model='i6300esb'/>
+  </devices>
+  ...
-
-      ...
-      <watchdog model='i6300esb' action='poweroff'/>
-      ...
+
+  ...
+  <devices>
+    <watchdog model='i6300esb' action='poweroff'/>
+  </devices>
+</domain>
model