]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: default to vfio for nodedev-detach
authorLaine Stump <laine@laine.org>
Fri, 29 Nov 2013 11:19:26 +0000 (13:19 +0200)
committerLaine Stump <laine@laine.org>
Tue, 3 Dec 2013 09:58:26 +0000 (11:58 +0200)
commit47b9aae0ae0652738d3a65d6cdd6b0bb16b3a2ec
tree86832dcfdd540f688df250c572138ba7be9da0fb
parent26fb96d8c04ef87d432ccb5a98bea472b04e5dd6
qemu: default to vfio for nodedev-detach

This patch resolves:

  https://bugzilla.redhat.com/show_bug.cgi?id=1035188

Commit f094aaac48a6 changed the PCI device assignment in qemu domains
to default to using VFIO rather than legacy KVM device assignment
(when VFIO is available). It didn't change which driver was used by
default for virNodeDeviceDetachFlags(), though, so that API (and the
virsh nodedev-detach command) was still binding to the pci-stub
driver, used by legacy KVM assignment, by default.

This patch publicizes (only within the qemu module, though, so no
additions to the symbol exports are needed) the functions that check
for presence of KVM and VFIO device assignment, then uses those
functions to decide what to do when no driver is specified for
virNodeDeviceDetachFlags(); if the vfio driver is loaded, the device
will be bound to vfio-pci, or if legacy KVM assignment is supported on
this system, the device will be bound to pci-stub; if neither method
is available, the detach will fail.
src/qemu/qemu_driver.c
src/qemu/qemu_hostdev.c
src/qemu/qemu_hostdev.h