]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virDomainFDTuple: drop 'testfds' field
authorPeter Krempa <pkrempa@redhat.com>
Mon, 18 May 2026 12:58:51 +0000 (14:58 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 25 May 2026 11:28:58 +0000 (13:28 +0200)
Thanks to real FD testing we no longer need to inject test
infrastructure into production code. Remove it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/virdomainfd.c
src/conf/virdomainfd.h
src/qemu/qemu_domain.c
src/qemu/qemu_process.c

index 13c3161e6afaf1517f9f884ba6da75a55ebd070f..86990a10bcc0dcb146d08b5a6427d67db5e874d4 100644 (file)
@@ -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);
 }
index 0c0d475ed6b2264fb6da4624565357714ce1b7e5..0ae84f2c0cf169935c88c941adada8badc54c4a2 100644 (file)
@@ -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;
index dde257bb7007e2d95018a64448a34b52ead0cee9..84c8645259a8e9fc0d871693e0cf6f7a216ff14a 100644 (file)
@@ -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,
index 3561b6d17d5634b827b059af7251cb41c7d2ac1f..4e59651c25c201979963170fdb8a517cf5e1ee81 100644 (file)
@@ -7785,14 +7785,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);