From: Peter Krempa <[email protected]>

Thanks to real FD testing we no longer need to inject test
infrastructure into production code. Remove it.

Signed-off-by: Peter Krempa <[email protected]>
---
 src/conf/virdomainfd.c  |  1 -
 src/conf/virdomainfd.h  |  1 -
 src/qemu/qemu_domain.c  | 10 +---------
 src/qemu/qemu_process.c | 10 +++-------
 4 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/src/conf/virdomainfd.c b/src/conf/virdomainfd.c
index 13c3161e6a..86990a10bc 100644
--- a/src/conf/virdomainfd.c
+++ b/src/conf/virdomainfd.c
@@ -30,7 +30,6 @@ virDomainFDTupleFinalize(GObject *object)
         VIR_FORCE_CLOSE(fdt->fds[i]);

     g_free(fdt->fds);
-    g_free(fdt->testfds);
     g_free(fdt->selinuxLabel);
     G_OBJECT_CLASS(vir_domain_fd_tuple_parent_class)->finalize(object);
 }
diff --git a/src/conf/virdomainfd.h b/src/conf/virdomainfd.h
index 0c0d475ed6..0ae84f2c0c 100644
--- a/src/conf/virdomainfd.h
+++ b/src/conf/virdomainfd.h
@@ -10,7 +10,6 @@ struct _virDomainFDTuple {
     GObject parent;
     int *fds;
     size_t nfds;
-    int *testfds; /* populated by tests to ensure stable FDs */

     bool writable;
     bool tryRestoreLabel;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index dde257bb70..84c8645259 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -9860,15 +9860,7 @@ qemuDomainPrepareStorageSourceFDs(virStorageSource *src,

     for (i = 0; i < fdt->nfds; i++) {
         g_autofree char *idx = g_strdup_printf("%zu", i);
-        int tmpfd;
-
-        if (fdt->testfds) {
-            /* when testing we want to use stable FD numbers provided by the 
test
-             * case */
-            tmpfd = dup2(fdt->fds[i], fdt->testfds[i]);
-        } else {
-            tmpfd = dup(fdt->fds[i]);
-        }
+        int tmpfd = dup(fdt->fds[i]);

         if (tmpfd < 0) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 83f5ebb19c..378b7925c2 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -7774,14 +7774,10 @@ qemuProcessGetPassedIommuFd(virDomainObj *vm)
         return -1;
     }

-    if (fdt->testfds) {
-        iommufd = dup2(fdt->fds[0], fdt->testfds[0]);
-    } else {
-        iommufd = dup(fdt->fds[0]);
+    iommufd = dup(fdt->fds[0]);

-        if (qemuSecuritySetImageFDLabel(priv->driver->securityManager, 
vm->def, iommufd) < 0)
-            return -1;
-    }
+    if (qemuSecuritySetImageFDLabel(priv->driver->securityManager, vm->def, 
iommufd) < 0)
+        return -1;

     priv->iommufd = qemuFDPassDirectNew("iommufd", &iommufd);

-- 
2.54.0

Reply via email to