1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-01-11 09:17:52 +03:00

qemuProcessStartPRDaemonHook: Try to set NS iff domain was started with one

Users have possibility to disable qemu namespace feature (e.g.
because they are running on *BSD which lacks Linux NS support).
If that's the case we should not try to move qemu-pr-helper into
the same namespace as qemu is in.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2018-07-03 13:19:59 +02:00
parent bb4f3543bb
commit dd1d58cabc

View File

@ -2522,12 +2522,14 @@ qemuProcessStartPRDaemonHook(void *opaque)
int *fds = NULL;
int ret = -1;
if (virProcessGetNamespaces(vm->pid, &nfds, &fds) < 0)
return ret;
if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) {
if (virProcessGetNamespaces(vm->pid, &nfds, &fds) < 0)
return ret;
if (nfds > 0 &&
virProcessSetNamespaces(nfds, fds) < 0)
goto cleanup;
if (nfds > 0 &&
virProcessSetNamespaces(nfds, fds) < 0)
goto cleanup;
}
ret = 0;
cleanup: