Installation guide

Run virsh edit (or virsh attach device) and add a device entry in the <devices> section
to attach the PCI device to the guest. Only run this command on offline guests. Red Hat
Enterprise Linux does not support hotplugging PCI devices at this time.
# virsh edit win2k3
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address domain='0x0000' bus='0x00' slot='0x1a' function='0x7'/>
</source>
</hostdev>
6. Once the guest system is configured to use the PCI address, we need to tell the host system to
stop using it. The ehci driver is loaded by default for the USB PCI controller.
$ readlink /sys/bus/pci/devices/0000\:00\:1d.7/driver
../../../bus/pci/drivers/ehci_hcd
7. Detach the device:
$ virsh nodedev-dettach pci_8086_3a6c
8. Verify it is now under the control of pci_stub:
$ readlink /sys/bus/pci/devices/0000\:00\:1d.7/driver
../../../bus/pci/drivers/pci-stub
9. Set a sebool to allow the management of the PCI device from the guest:
# setsebool -P virt_use_sysfs 1
10. Start the guest system :
# virsh start win2k3
The PCI device should now be successfully attached to the guest and accessible to the guest
operating system.
15.2. Adding a PCI device wit h virt -manager
PCI devices can be added to guests using the graphical virt-manager tool. The following
procedure adds a 2 port USB controller to a guest.
1. Id en t if y t h e d evice
Identify the PCI device designated for passthrough to the guest. The virsh nodedev-list
command lists all devices attached to the system. The --tree option is useful for identifying
devices attached to the PCI device (for example, disk controllers and USB controllers).
# virsh nodedev-list --tree
For a list of only PCI devices, run the following command:
# virsh nodedev-list | grep pci
Chapt er 1 5. PCI passt hrough
195