On 10/09/2017 10:57 AM, Alex Williamson wrote:
On Mon, 9 Oct 2017 09:28:27 +0000
"Wuzongyong (Euler Dept)" <cordius.wu(a)huawei.com> wrote:
> Hi,
>
> As the title says, I thought that it's a bit unreasonable and inconsistent to
unbind devices assigned to VMs to original driver
> and leave other devices binding to vfio-pci driver.
> Why not to bind devices we need to vfio-pci driver instead of bind all devices with
same type to vfio-pci driver?
> Or, we may can rebind devices unused with same type to original driver.
Because that's the way the kernel's new_id interface works, any
matching device without a driver will probe the new_id driver. For a
new enough kernel and libvirt, the driver_override interface should be
used instead, which will only bind the target device.
Note that all libvirt 2.3.0 and later uses driver_override rather than
new_id (as long as the host kernel also supports it, which these days
should almost always be the case). If you're seeing *all* unbound
devices being bound to vfio-pci when only one of the devices is assigned
to a guest, then either 1) you are using a host with a *very* old
kernel, 2) you have modified libvirt's code to somehow force taking the
old/deprecated path, or 3) there is a bug in libvirt's code.