if (noldfdlist && oldfdlist) {
size_t nfds;
- if (virProcessGetNamespaces(getpid(),
- &nfds,
- oldfdlist) < 0)
- goto error;
+ virProcessGetNamespaces(getpid(), &nfds, oldfdlist);
*noldfdlist = nfds;
}
goto endjob;
}
- if (virProcessGetNamespaces(priv->initpid, &nfds, fdlist) < 0)
- goto endjob;
+ virProcessGetNamespaces(priv->initpid, &nfds, fdlist);
ret = nfds;
int ret = -1;
if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) {
- if (virProcessGetNamespaces(vm->pid, &nfds, &fds) < 0)
- return ret;
+ virProcessGetNamespaces(vm->pid, &nfds, &fds);
if (nfds > 0 &&
virProcessSetNamespaces(nfds, fds) < 0)
}
-int virProcessGetNamespaces(pid_t pid,
- size_t *nfdlist,
- int **fdlist)
+void virProcessGetNamespaces(pid_t pid,
+ size_t *nfdlist,
+ int **fdlist)
{
size_t i = 0;
const char *ns[] = { "user", "ipc", "uts", "net", "pid", "mnt" };
(*fdlist)[(*nfdlist)-1] = fd;
}
}
-
- return 0;
}
int virProcessGetStartTime(pid_t pid,
unsigned long long *timestamp);
-int virProcessGetNamespaces(pid_t pid,
- size_t *nfdlist,
- int **fdlist);
+void virProcessGetNamespaces(pid_t pid,
+ size_t *nfdlist,
+ int **fdlist);
int virProcessSetNamespaces(size_t nfdlist,
int *fdlist);