mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
virDomainFDTuple: drop 'testfds' field
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>
This commit is contained in:
1 parent
3d2d363f88
commit
ddfd6db943
4 files changed
+4
-18
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user