464
464
attribute provides the sub-type. <span class="since">Since 0.1.8</span>
467
<a name="elementsUSB" id="elementsUSB">USB devices</a>
467
<a name="elementsUSB" id="elementsUSB">USB and PCI devices</a>
470
USB devices attached to the host can be passed through to the guest using
471
the <code>hostdev</code> element. <span class="since">since after 0.4.4</span>
470
USB and PCI devices attached to the host can be passed through to the guest using
471
the <code>hostdev</code> element. <span class="since">since after
472
0.4.4 for USB and 0.6.0 for PCI (KVM only)</span>:
477
478
<vendor id='0x1234'/>
478
479
<product id='0xbeef'/>
486
<hostdev mode='subsystem' type='pci'>
488
<address>bus='0x06' slot='0x02' function='0x0'</address>
482
492
<dl><dt><code>hostdev</code></dt><dd>The <code>hostdev</code> element is the main container for describing
483
493
host devices. For usb device passthrough <code>mode</code> is always
484
"subsystem" and <code>type</code> is "usb".
494
"subsystem" and <code>type</code> is "usb" for an USB device and "pci"
485
496
</dd><dt><code>source</code></dt><dd>The source element describes the device as seen from the host.
486
497
The USB device can either be addressed by vendor / product id using the
487
498
<code>vendor</code> and <code>product</code> elements or by the device's
488
address on the hosts using the <code>address</code> element.</dd><dt><code>vendor</code>, <code>product</code></dt><dd>The <code>vendor</code> and <code>product</code> elements each have an
499
address on the hosts using the <code>address</code> element.
500
PCI devices on the other hand can only be described by their
501
<code>address</code></dd><dt><code>vendor</code>, <code>product</code></dt><dd>The <code>vendor</code> and <code>product</code> elements each have an
489
502
<code>id</code> attribute that specifies the USB vendor and product id.
490
503
The ids can be given in decimal, hexadecimal (starting with 0x) or
491
octal (starting with 0) form.</dd><dt><code>address</code></dt><dd>The <code>address</code> element has a <code>bus</code> and
492
<code>device</code> attribute to specify the USB bus and device number
493
the device appears at on the host. The values of these attributes can
494
be given in decimal, hexadecimal (starting with 0x) or octal (starting
495
with 0) form.</dd></dl>
504
octal (starting with 0) form.</dd><dt><code>address</code></dt><dd>The <code>address</code> element for USB devices has a
505
<code>bus</code> and <code>device</code> attribute to specify the
506
USB bus and device number the device appears at on the host.
507
The values of these attributes can be given in decimal, hexadecimal
508
(starting with 0x) or octal (starting with 0) form.
509
For PCI devices the element carries 3 attributes allowing to designate
510
the device as can be found with the <code>lspci</code> or
511
with <code>virsh nodedev-list</code>. The
512
<code>bus</code> attribute allows the hexadecimal values 0 to ff, the
513
<code>slot</code> attribute allows the hexadecimal values 0 to 1f, and
514
the <code>function</code> attribute allows the hexadecimal values 0 to
515
7. There is also an optional <code>domain</code> attribute for the
516
PCI domain, with hexadecimal values 0 to ffff, but it is currently
517
not used by qemu.</dd></dl>
497
519
<a name="elementsNICS" id="elementsNICS">Network interfaces</a>
713
735
<dl><dt><code>graphics</code></dt><dd>The <code>graphics</code> element has a mandatory <code>type</code>
714
736
attribute which takes the value "sdl" or "vnc". The former displays
715
737
a window on the host desktop, while the latter activates a VNC server.
738
The former accepts 3 optional arguments: a <code>display</code>
739
attribute for the display to use, an <code>xauth</code> attribute for
740
the authentication identifier, and an optional <code>fullscreen</code>
741
attribute accepting values 'yes' or 'no'.
716
742
If the latter is used the <code>port</code> attribute specifies the TCP
717
743
port number (with -1 as legacy syntax indicating that it should be
718
744
auto-allocated). The <code>autoport</code> attribute is the new
719
745
preferred syntax for indicating autoallocation of the TCP port to use.
720
746
The <code>listen</code> attribute is an IP address for the server to
721
747
listen on. The <code>password</code> attribute provides a VNC password
722
in clear text.</dd></dl>
748
in clear text. The <code>keymap</code> attribute specifies the keymap
724
751
<a name="elementsConsole" id="elementsConsole">Consoles, serial & parallel devices</a>