0

In virsh I detach a PCI bus from host and attach it to a VM. I don't see any errors in these steps. But I don't see the PCI device listed in the VM.

virsh # nodedev-dettach pci_0000_01_00_0
Device pci_0000_01_00_0 dettached

virsh # attach-device VM1 pci_add.xml 
Device attached successfully

$ cat pci_add.xml 
<hostdev mode='subsystem' type='pci' managed='yes'>
    <source>
     <address domain='0x000' bus='0x01' slot='0x00' function='0x0'/>
    </source>
</hostdev>

Is PCI hot plug not supported? I am using Ubuntu 12.04.3(kernel 3.8.0-34).

I can add the same PCI device through virsh edit VM1 and start the VM1. This way I am able to see the device.

Braiam
  • 69,112

1 Answers1

1

Resolved the issue. PCI hotplug needs couple of drivers:

  1. acpiphp
  2. pci_hotplug

Both of these drives are needed in Guest OS(and not in host).

Now I am able to see the PCI device from Guest VM.

Braiam
  • 69,112