[RFC PATCH 04/28] virpcitest: Change the stub driver to vfio from pci-stub

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The pci-stub is obsolete for a while now. Upcoming test cases try
to test the VFIO hotplug/unplug cases.

Change the default test driver to vfio-pci instead of pci-stub,
and fail bind for pci-stub instead.


Signed-off-by: Shivaprasad G Bhat <sbhat@xxxxxxxxxxxxxxxxxx>
---
 tests/virhostdevtest.c |    8 ++++----
 tests/virpcimock.c     |    5 ++---
 tests/virpcitest.c     |   12 ++++++------
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c
index e4fee567a2..41062ebf3c 100644
--- a/tests/virhostdevtest.c
+++ b/tests/virhostdevtest.c
@@ -97,7 +97,7 @@ myInit(void)
         subsys.u.pci.addr.bus = 0;
         subsys.u.pci.addr.slot = i + 1;
         subsys.u.pci.addr.function = 0;
-        subsys.u.pci.backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_KVM;
+        subsys.u.pci.backend = VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO;
         hostdevs[i]->source.subsys = subsys;
     }
 
@@ -105,7 +105,7 @@ myInit(void)
         if (!(dev[i] = virPCIDeviceNew(0, 0, i + 1, 0)))
             goto cleanup;
 
-        virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_KVM);
+        virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
     }
 
     if (VIR_ALLOC(mgr) < 0)
@@ -485,7 +485,7 @@ testVirHostdevRoundtripManaged(const void *opaque ATTRIBUTE_UNUSED)
 {
     int ret = -1;
 
-    if (virHostdevHostSupportsPassthroughKVM()) {
+    if (virHostdevHostSupportsPassthroughVFIO()) {
         if (testVirHostdevPreparePCIHostdevs_managed(false) < 0)
             goto out;
         if (testVirHostdevReAttachPCIHostdevs_managed(false) < 0)
@@ -517,7 +517,7 @@ testVirHostdevRoundtripMixed(const void *opaque ATTRIBUTE_UNUSED)
 
     if (testVirHostdevDetachPCINodeDevice() < 0)
         goto out;
-    if (virHostdevHostSupportsPassthroughKVM()) {
+    if (virHostdevHostSupportsPassthroughVFIO()) {
         if (testVirHostdevPreparePCIHostdevs_managed(true) < 0)
             goto out;
         if (testVirHostdevReAttachPCIHostdevs_managed(true) < 0)
diff --git a/tests/virpcimock.c b/tests/virpcimock.c
index 22adc740b8..c9b7434c9a 100644
--- a/tests/virpcimock.c
+++ b/tests/virpcimock.c
@@ -982,9 +982,8 @@ init_env(void)
 
     MAKE_PCI_DRIVER("iwlwifi", 0x8086, 0x0044);
     MAKE_PCI_DRIVER("i915", 0x8086, 0x0046, 0x8086, 0x0047);
-    MAKE_PCI_DRIVER("pci-stub", -1, -1);
-    pci_driver_new("vfio-pci", PCI_ACTION_BIND, -1, -1);
-
+    pci_driver_new("pci-stub", PCI_ACTION_BIND, -1, -1);
+    MAKE_PCI_DRIVER("vfio-pci", -1, -1);
 
 # define MAKE_PCI_DEVICE(Id, Vendor, Device, ...) \
     do { \
diff --git a/tests/virpcitest.c b/tests/virpcitest.c
index 80e994ae52..fa7acb85a2 100644
--- a/tests/virpcitest.c
+++ b/tests/virpcitest.c
@@ -110,12 +110,12 @@ testVirPCIDeviceDetach(const void *opaque ATTRIBUTE_UNUSED)
         if (!(dev[i] = virPCIDeviceNew(0, 0, i + 1, 0)))
             goto cleanup;
 
-        virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_KVM);
+        virPCIDeviceSetStubDriver(dev[i], VIR_PCI_STUB_DRIVER_VFIO);
 
         if (virPCIDeviceDetach(dev[i], activeDevs, inactiveDevs) < 0)
             goto cleanup;
 
-        if (testVirPCIDeviceCheckDriver(dev[i], "pci-stub") < 0)
+        if (testVirPCIDeviceCheckDriver(dev[i], "vfio-pci") < 0)
             goto cleanup;
 
         CHECK_LIST_COUNT(activeDevs, 0);
@@ -249,7 +249,7 @@ testVirPCIDeviceDetachSingle(const void *opaque)
     if (!dev)
         goto cleanup;
 
-    virPCIDeviceSetStubDriver(dev, VIR_PCI_STUB_DRIVER_KVM);
+    virPCIDeviceSetStubDriver(dev, VIR_PCI_STUB_DRIVER_VFIO);
 
     if (virPCIDeviceDetach(dev, NULL, NULL) < 0)
         goto cleanup;
@@ -271,7 +271,7 @@ testVirPCIDeviceDetachFail(const void *opaque)
     if (!dev)
         goto cleanup;
 
-    virPCIDeviceSetStubDriver(dev, VIR_PCI_STUB_DRIVER_VFIO);
+    virPCIDeviceSetStubDriver(dev, VIR_PCI_STUB_DRIVER_KVM);
 
     if (virPCIDeviceDetach(dev, NULL, NULL) < 0) {
         if (virTestGetVerbose() || virTestGetDebug())
@@ -282,7 +282,7 @@ testVirPCIDeviceDetachFail(const void *opaque)
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        "Attaching device %s to %s should have failed",
                        virPCIDeviceGetName(dev),
-                       virPCIStubDriverTypeToString(VIR_PCI_STUB_DRIVER_VFIO));
+                       virPCIStubDriverTypeToString(VIR_PCI_STUB_DRIVER_KVM));
     }
 
  cleanup:
@@ -441,7 +441,7 @@ mymain(void)
     /* Detach an unbound device */
     DO_TEST_PCI_DRIVER(0, 0x0a, 2, 0, NULL);
     DO_TEST_PCI(testVirPCIDeviceDetachSingle, 0, 0x0a, 2, 0);
-    DO_TEST_PCI_DRIVER(0, 0x0a, 2, 0, "pci-stub");
+    DO_TEST_PCI_DRIVER(0, 0x0a, 2, 0, "vfio-pci");
 
     /* Reattach an unknown unbound device */
     DO_TEST_PCI_DRIVER(0, 0x0a, 3, 0, NULL);

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux