On 7/18/19 10:29 AM, Daniel Henrique
Barboza wrote:
Hi,
If you're thinking of doing that automatically, then I should warn you that we had discussed that a long time ago, and decided that it was a bad idea to do it because it was likely someone would, e.g. try to assign an audio device to their guest that happened to be one function on a multifunction device that also contained a disk controller (or some other device) that the host needed for proper operation.
It may be that in *your* particular case, you understand that the functions you don't want to assign to the guest are not otherwise used, and it's not dangerous to suddenly detach them from their host driver. But you can't assume that will always be the case.
If you *really* can't accept just assigning all the devices in that IOMMU group to the guest (thus making them all explicitly listed in the config, and obvious to the administrator that they won't be available on the host) and simply not using them, then you either need to separately detach those particular functions from the host, or come up with a way of having the domain config explicitly list them as "detached from the host but not actually attached to the guest".
Now, there's a catch. Inside both virHostdevPreparePCIDevices()
If you're not going to use a device (which is implied by the fact that it's not in the hostdevs list) then nothing about its network config will change, so there is no reason to save/restore it.
Again, the above sentence implies that you're wanting to make
this completely automatic, which we previously decided was
something we didn't want to do.
However, since function 2 isn't a hostdev, its network config
You're talking about something that will never
occur - on every SRIOV network card I've ever seen each VF is in
its own IOMMU group, and can be assigned to a guest independent
of what's done with any other VF. I've never seen a case (except
maybe once with a newly released motherboard that had broken
IOMMU firmware(?)) where a VF was in the same IOMMU group as any
other device.
|
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list