virProcessGetNamespaces() return value
is invariant, so change it type and remove all dependent
checks.
Fixes: 7d2fd6ef01 ("Do not check return value of VIR_EXPAND_N")
Signed-off-by: Artem Chernyshev <artem.chernyshev(a)red-soft.ru>
---
src/libvirt-lxc.c | 5 +----
src/lxc/lxc_driver.c | 3 +--
src/qemu/qemu_process.c | 3 +--
src/util/virprocess.c | 4 +---
src/util/virprocess.h | 2 +-
5 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/src/libvirt-lxc.c b/src/libvirt-lxc.c
index ecc1207ca9..99bb450702 100644
--- a/src/libvirt-lxc.c
+++ b/src/libvirt-lxc.c
@@ -140,10 +140,7 @@ virDomainLxcEnterNamespace(virDomainPtr domain,
if (noldfdlist && oldfdlist) {
size_t nfds;
- if (virProcessGetNamespaces(getpid(),
- &nfds,
- oldfdlist) < 0)
- goto error;
+ virProcessGetNamespaces(getpid(), &nfds, oldfdlist);
*noldfdlist = nfds;
}
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 3e9c1395bf..c281998652 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -4691,8 +4691,7 @@ static int lxcDomainLxcOpenNamespace(virDomainPtr dom,
goto endjob;
}
- if (virProcessGetNamespaces(priv->initpid, &nfds, fdlist) < 0)
- goto endjob;
+ virProcessGetNamespaces(priv->initpid, &nfds, fdlist);
ret = nfds;
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 696d526a5d..7770e7e7eb 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2737,8 +2737,7 @@ qemuProcessStartPRDaemonHook(void *opaque)
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)
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index b6fb17db83..74233e2169 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -652,7 +652,7 @@ int virProcessGetPids(pid_t pid, size_t *npids, pid_t **pids)
}
-int virProcessGetNamespaces(pid_t pid,
+void virProcessGetNamespaces(pid_t pid,
size_t *nfdlist,
int **fdlist)
{
@@ -673,8 +673,6 @@ int virProcessGetNamespaces(pid_t pid,
(*fdlist)[(*nfdlist)-1] = fd;
}
}
-
- return 0;
}
diff --git a/src/util/virprocess.h b/src/util/virprocess.h
index 6008cca4af..cc6abc6e4b 100644
--- a/src/util/virprocess.h
+++ b/src/util/virprocess.h
@@ -70,7 +70,7 @@ int virProcessGetPids(pid_t pid, size_t *npids, pid_t **pids);
int virProcessGetStartTime(pid_t pid,
unsigned long long *timestamp);
-int virProcessGetNamespaces(pid_t pid,
+void virProcessGetNamespaces(pid_t pid,
size_t *nfdlist,
int **fdlist);
--
2.43.0