mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-05 22:05:47 +00:00
util: honor stubDriverName when probing/binding stub driver for a device
Signed-off-by: Laine Stump <laine@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
2d9c9445b9
commit
928296b044
@ -1290,17 +1290,20 @@ virPCIDeviceUnbindFromStub(virPCIDevice *dev)
|
|||||||
static int
|
static int
|
||||||
virPCIDeviceBindToStub(virPCIDevice *dev)
|
virPCIDeviceBindToStub(virPCIDevice *dev)
|
||||||
{
|
{
|
||||||
const char *stubDriverName;
|
const char *stubDriverName = dev->stubDriverName;
|
||||||
g_autofree char *stubDriverPath = NULL;
|
g_autofree char *stubDriverPath = NULL;
|
||||||
g_autofree char *driverLink = NULL;
|
g_autofree char *driverLink = NULL;
|
||||||
|
|
||||||
/* Check the device is configured to use one of the known stub drivers */
|
|
||||||
if (dev->stubDriverType == VIR_PCI_STUB_DRIVER_NONE) {
|
if (dev->stubDriverType == VIR_PCI_STUB_DRIVER_NONE) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("No stub driver configured for PCI device %1$s"),
|
_("No stub driver configured for PCI device %1$s"),
|
||||||
dev->name);
|
dev->name);
|
||||||
return -1;
|
return -1;
|
||||||
} else if (!(stubDriverName = virPCIStubDriverTypeToString(dev->stubDriverType))) {
|
}
|
||||||
|
|
||||||
|
if (!stubDriverName
|
||||||
|
&& !(stubDriverName = virPCIStubDriverTypeToString(dev->stubDriverType))) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Unknown stub driver configured for PCI device %1$s"),
|
_("Unknown stub driver configured for PCI device %1$s"),
|
||||||
dev->name);
|
dev->name);
|
||||||
|
Loading…
Reference in New Issue
Block a user