20.16.4. Controllers
Depending on the guest virtual machine architecture, it is possible to assign many virtual devices to a single bus. Under normal circumstances libvirt can automatically infer which controller to use for the bus. However, it may be necessary to provide an explicit
<controller>
element in the guest virtual machine XML:
... <devices> <controller type='ide' index='0'/> <controller type='virtio-serial' index='0' ports='16' vectors='4'/> <controller type='virtio-serial' index='1'> <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> <controller type='scsi' index='0' model='virtio-scsi' num_queues='8'/> </controller> ... </devices> ...
Figure 20.25. Controller Elements
Each controller has a mandatory attribute
type
, which must be one of "ide", "fdc", "scsi", "sata", "usb", "ccid", or "virtio-serial"
, and a mandatory attribute index
which is the decimal integer describing in which order the bus controller is encountered (for use in controller attributes of address
elements). The "virtio-serial"
controller has two additional optional attributes, ports
and vectors
, which control how many devices can be connected through the controller.
A
<controller type='scsi'>
has an optional attribute model
, which is one of "auto"
, "buslogic"
, "ibmvscsi"
, "lsilogic"
, "lsias1068"
, "virtio-scsi
or "vmpvscsi"
. It should be noted that virtio-scsi controllers and drivers will work on both KVM and Windows guest virtual machines. The <controller type='scsi'>
also has an attribute num_queues
which enables multi-queue support for the number of queues specified.
A
"usb"
controller has an optional attribute model
, which is one of "piix3-uhci"
, "piix4-uhci"
, "ehci"
, "ich9-ehci1"
, "ich9-uhci1"
, "ich9-uhci2"
, "ich9-uhci3"
, "vt82c686b-uhci"
, "pci-ohci"
or "nec-xhci"
. Additionally, if the USB bus needs to be explicitly disabled for the guest virtual machine, model='none'
may be used. The PowerPC64 "spapr-vio" addresses do not have an associated controller.
For controllers that are themselves devices on a PCI or USB bus, an optional sub-element
address
can specify the exact relationship of the controller to its master bus, with semantics given above.
USB companion controllers have an optional sub-element
master
to specify the exact relationship of the companion to its master controller. A companion controller is on the same bus as its master, so the companion index value should be equal.
... <devices> <controller type='usb' index='0' model='ich9-ehci1'> <address type='pci' domain='0' bus='0' slot='4' function='7'/> </controller> <controller type='usb' index='0' model='ich9-uhci1'> <master startport='0'/> <address type='pci' domain='0' bus='0' slot='4' function='0' multifunction='on'/> </controller> ... </devices> ...
Figure 20.26. Devices - controllers - USB