render / rpms / libvirt

Forked from rpms/libvirt 4 months ago
Clone
9c6c51
From d003bd56fc1e7fc166e7a350e471644431a48988 Mon Sep 17 00:00:00 2001
9c6c51
Message-Id: <d003bd56fc1e7fc166e7a350e471644431a48988@dist-git>
9c6c51
From: Michal Privoznik <mprivozn@redhat.com>
9c6c51
Date: Wed, 11 Jul 2018 17:27:23 +0200
9c6c51
Subject: [PATCH] qemuProcessStartPRDaemonHook: Try to set NS iff domain was
9c6c51
 started with one
9c6c51
MIME-Version: 1.0
9c6c51
Content-Type: text/plain; charset=UTF-8
9c6c51
Content-Transfer-Encoding: 8bit
9c6c51
9c6c51
https://bugzilla.redhat.com/show_bug.cgi?id=1470007
9c6c51
9c6c51
Users have possibility to disable qemu namespace feature (e.g.
9c6c51
because they are running on *BSD which lacks Linux NS support).
9c6c51
If that's the case we should not try to move qemu-pr-helper into
9c6c51
the same namespace as qemu is in.
9c6c51
9c6c51
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9c6c51
(cherry picked from commit dd1d58cabc850324bb9a7ed836985d34697aa7b2)
9c6c51
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9c6c51
Reviewed-by: Ján Tomko <jtomko@redhat.com>
9c6c51
---
9c6c51
 src/qemu/qemu_process.c | 12 +++++++-----
9c6c51
 1 file changed, 7 insertions(+), 5 deletions(-)
9c6c51
9c6c51
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
9c6c51
index 40d35cbe6b..f200729cb1 100644
9c6c51
--- a/src/qemu/qemu_process.c
9c6c51
+++ b/src/qemu/qemu_process.c
9c6c51
@@ -2522,12 +2522,14 @@ qemuProcessStartPRDaemonHook(void *opaque)
9c6c51
     int *fds = NULL;
9c6c51
     int ret = -1;
9c6c51
 
9c6c51
-    if (virProcessGetNamespaces(vm->pid, &nfds, &fds) < 0)
9c6c51
-        return ret;
9c6c51
+    if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) {
9c6c51
+        if (virProcessGetNamespaces(vm->pid, &nfds, &fds) < 0)
9c6c51
+            return ret;
9c6c51
 
9c6c51
-    if (nfds > 0 &&
9c6c51
-        virProcessSetNamespaces(nfds, fds) < 0)
9c6c51
-        goto cleanup;
9c6c51
+        if (nfds > 0 &&
9c6c51
+            virProcessSetNamespaces(nfds, fds) < 0)
9c6c51
+            goto cleanup;
9c6c51
+    }
9c6c51
 
9c6c51
     ret = 0;
9c6c51
  cleanup:
9c6c51
-- 
9c6c51
2.18.0
9c6c51