On 2/16/24 19:45, Laine Stump wrote: > 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@xxxxxxxxxx> > --- > src/hypervisor/virhostdev.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/hypervisor/virhostdev.c b/src/hypervisor/virhostdev.c > index 40f8a4bc2c..53327f4f4d 100644 > --- a/src/hypervisor/virhostdev.c > +++ b/src/hypervisor/virhostdev.c > @@ -242,6 +242,8 @@ virHostdevGetPCIHostDevice(const virDomainHostdevDef *hostdev, > return -1; > > virPCIDeviceSetManaged(actual, hostdev->managed); > + virPCIDeviceSetStubDriverName(actual, pcisrc->driver.model); > + > No need for the extra line. > if (pcisrc->driver.name == VIR_DEVICE_HOSTDEV_PCI_DRIVER_NAME_VFIO) { > virPCIDeviceSetStubDriverType(actual, VIR_PCI_STUB_DRIVER_VFIO); Reviewed-by: Michal Privoznik <mprivozn@xxxxxxxxxx> Michal _______________________________________________ Devel mailing list -- devel@xxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx