mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
pci: Introduce virPCIStubDriver enumeration
This replaces the virPCIKnownStubs string array that was used internally for stub driver validation. Advantages: * possible values are well-defined * typos in driver names will be detected at compile time * avoids having several copies of the same string around * no error checking required when setting / getting value The names used mirror those in the virDomainHostdevSubsysPCIBackendType enumeration.
This commit is contained in:
@@ -97,9 +97,10 @@ myInit(void)
|
||||
}
|
||||
|
||||
for (i = 0; i < nhostdevs; i++) {
|
||||
if (!(dev[i] = virPCIDeviceNew(0, 0, i + 1, 0)) ||
|
||||
virPCIDeviceSetStubDriver(dev[i], "pci-stub") < 0)
|
||||
if (!(dev[i] = virPCIDeviceNew(0, 0, i + 1, 0)))
|
||||
goto cleanup;
|
||||
|
||||
virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_KVM);
|
||||
}
|
||||
|
||||
if (VIR_ALLOC(mgr) < 0)
|
||||
|
||||
Reference in New Issue
Block a user