diff options
author | Andrea Bolognani <abologna@redhat.com> | 2015-10-23 11:54:07 +0200 |
---|---|---|
committer | Andrea Bolognani <abologna@redhat.com> | 2015-12-21 11:17:22 +0100 |
commit | 6d9cdd2a57f712c477e3b1fc2c5d4ab5a963756e (patch) | |
tree | a9dd9e144d820f1ea4d1620ab37bfbababcd4cab /tests/virhostdevtest.c | |
parent | e1b2458364e32e999a28f81a2613ebca6f4b7083 (diff) | |
download | libvirt-6d9cdd2a57f712c477e3b1fc2c5d4ab5a963756e.tar.gz |
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.
Diffstat (limited to 'tests/virhostdevtest.c')
-rw-r--r-- | tests/virhostdevtest.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c index 2a7497604e..1b30681074 100644 --- a/tests/virhostdevtest.c +++ b/tests/virhostdevtest.c @@ -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) |