]> xenbits.xensource.com Git - libvirt.git/commitdiff
Set stubDriverName from hostdev driver model attribute during pci device setup
authorLaine Stump <laine@redhat.com>
Fri, 16 Feb 2024 17:43:59 +0000 (12:43 -0500)
committerLaine Stump <laine@redhat.com>
Tue, 20 Feb 2024 16:19:44 +0000 (11:19 -0500)
commit v9.10.0-129-g8b93d78c83 (first appearing in libvirt-10.0.0) was
supposed to allow forcing a PCI hostdev to be bound to a particular
driver by adding <driver model='blah'/> to the XML for the
device. Unfortunately, a single line was missed during the final
changes to the patch prior to pushing, and the result was that the
driver model could be set to *anything* and it would be accepted but
just ignored.

This patch adds the missing line, which will set the stubDriverName
field of the virPCIDevice object from the hostdev object as the
virPCIDevice is being created. This ends up being used by
virPCIDeviceBindToStub() as the driver that it binds the device to.

Fixes: 8b93d78c8325f1fba5db98848350f3db43f5e7d5
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/hypervisor/virhostdev.c

index 40f8a4bc2c5657a3f69fd7b4c082e58f6ae5abdf..185ec2ca50e8b8f4ea50546df84854fd4aa0a251 100644 (file)
@@ -242,6 +242,7 @@ virHostdevGetPCIHostDevice(const virDomainHostdevDef *hostdev,
         return -1;
 
     virPCIDeviceSetManaged(actual, hostdev->managed);
+    virPCIDeviceSetStubDriverName(actual, pcisrc->driver.model);
 
     if (pcisrc->driver.name == VIR_DEVICE_HOSTDEV_PCI_DRIVER_NAME_VFIO) {
         virPCIDeviceSetStubDriverType(actual, VIR_PCI_STUB_DRIVER_VFIO);