Re: [libvirt] [question]Why libvirt bind all devices with same vendor id and device id to vfio-pci driver, and only unbind devices used by VMs to original driver?

2017-10-11 Thread Laine Stump
On 10/09/2017 10:57 AM, Alex Williamson wrote:
> On Mon, 9 Oct 2017 09:28:27 +
> "Wuzongyong (Euler Dept)"  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.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [libvirt] [question]Why libvirt bind all devices with same vendor id and device id to vfio-pci driver, and only unbind devices used by VMs to original driver?

2017-10-09 Thread Alex Williamson
On Mon, 9 Oct 2017 09:28:27 +
"Wuzongyong (Euler Dept)"  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.  Thanks,

Alex

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


[libvirt] [question]Why libvirt bind all devices with same vendor id and device id to vfio-pci driver, and only unbind devices used by VMs to original driver?

2017-10-09 Thread Wuzongyong (Euler Dept)
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.

Thanks,
Zongyong Wu

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list