[libvirt-users] If it's possible for a third-party PCIe card to be shared by multiple containers

Daniel P. Berrange berrange at redhat.com
Thu Jan 23 10:27:27 UTC 2014


On Thu, Jan 23, 2014 at 08:54:21AM +0000, WANG Cheng D wrote:
> Dear Daniel,
> I found that lxc driver doesn't support hostdev with type of 'pci'.
> As you mentioned before, I tried to expose the device node (the PCIe card) to the container, my XML is as follow:
> <devices>
>     <hostdev mode='subsystem' type='pci' managed='yes'>
>       <source>
>         <address bus='0x01' slot='0x00' function='0x0'/>
>       </source>
>     </hostdev>
> </devices>
> When I started the container, I got the error message:
> Error: failed to start domain
> Error: unsupported configuration: Unsupported hostdev type pci.
> I want to confirm if the element hostdev of PCIe device is not supported by lxc driver currently.

The PCI mode is for actual PCI device assignment at the hardware level.
This concept doesn't make sense for containers since there's a shared
kernel.  Instead you want to assign the device nodes from /dev using
the mode='capability' hostdev XML instead per this link:

 http://libvirt.org/formatdomain.html#elementsHostDevCaps

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvirt-users mailing list