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>
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);
}
GObject parent;
int *fds;
size_t nfds;
- int *testfds; /* populated by tests to ensure stable FDs */
bool writable;
bool tryRestoreLabel;
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,
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);