Adding A Pci Device With Virt-Manager - Red Hat ENTERPRISE LINUX 5 - VIRTUALIZATION GUIDE Manual

Hide thumbs Also See for ENTERPRISE LINUX 5 - VIRTUALIZATION GUIDE:
Table of Contents

Advertisement

Chapter 13. PCI passthrough
5.
Run virsh edit (or virsh attach device) and added 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_manage_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.

13.2. Adding a PCI device with 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 virtualized guest.
Identify the device
1.
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:
194

Advertisement

Table of Contents
loading

Table of Contents