On 01/06/2016 08:58 PM, Ziviani .
wrote:
But "iommu group" is not the same thing as "all functions on a single device". Although in some cases they might be the same, that isn't necessarily true - one iommu group could span several devices, and there could be devices in the group that the user wasn't expecting and that could cause unexpected disastrous results (the most commonly used example is if the controller for the host's main disk happens to be in the same iommu group as some device that you're trying to assign). Also, you're making the assumption that only physical hardware devices assigned with vfio can/should be put onto multiple functions of a single guest slot, but that isn't true. It's also okay (and at times desirable) to put multiple emulated devices into different functions of the same slot.
Why do you assert that there is no missing function? Again, while this *can* be used to assign all of the functions of a single multi-function host device to functions of a single guest slot, that isn't the only use. You can also assign *some* of the functions of a single device, or a collection of emulated devices (or possibly even a mixture of emulated and assigned devices, although I'm not sure what vfio would think about that - it may be prohibited for very good reasons).
My understanding is that there is no way to inform the guest OS that a single function of a device has been detached. The only thing you can do is tell it that the entire device has been unplugged from the slot.
It's not that simple. You need to keep track of which devices you've told qemu to detach that qemu hasn't yet informed you were successfully detached. Also, if we allow it in steps (libvirt accepts attach/detach for multiple functions followed by a "make it so!" command), the info about pending attach/detach sets would need to be maintained. You should probably spend some time looking at src/qemu/qemu_hotplug.c, src/util/virhostdev.c, and virpci.c before jumping to a lot of conclusions :-)
|
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list