[libvirt] PATCH: PCI device passthrough in Xen driver

Cole Robinson crobinso at redhat.com
Tue Mar 17 16:10:47 UTC 2009

Daniel P. Berrange wrote:
> This patch provides initial support for PCI device passthrough in
> Xen, at time of boot. It does not (yet) implement device hotplug
> for PCI, since it works in an annoyingly different way to device
> hotplug of disks & nics. The patch has several aspects
>  - Refactors the pci.c file to make it easier to support both
>    Xen's pci-back.ko and upstream's pcistub.ko, which are almost
>    identical
>  - Add code to pci.c register the PCI device with 'new_slot' before
>    invoking 'bind', since pci-back.ko wants this extra step
>  - In xen_unified.c, add implmentations of APIs to dettach, reattach
>    and reset PCI devices - this just calls into shared pci.c code that
>    QEMU/KVM uses.
>  - In xend_internal.c implement SEXPR conversion.
>  - In xm_internal.c implement parsing of 'pci' config parameter
>  - Add lots of test cases
> XenD only supports 'unmanaged' PCI devices - ie mgmt app is responsible
> for detaching/reattaching PCI devices from/to  host device drivers.
> XenD itself won't automatically do this for us, though perhaps someone
> might like to implement this as an optional feature for XenD, since it
> is more convenient in some cases.

So for 'unmanaged', virt-manager (and virsh?) would need to detach +
reset on guest start, and reattach on guest shutdown? Or should we just
assume that if someone is using PCI passthrough for xen, then they have
taken necessary steps in /etc/modprobe or whatever for it all to just work.

Is there any reason why libvirt can't handle the 'managed' case, and
take the same steps as it does in the qemu driver before asking xen to
start the guest?

Sorry if these are silly questions, I'm pretty ignorant of all this.


More information about the libvir-list mailing list