render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
acda74
From 99f69000a1ecacc2f064043993ece8ddba366976 Mon Sep 17 00:00:00 2001
acda74
Message-Id: <99f69000a1ecacc2f064043993ece8ddba366976@dist-git>
acda74
From: Michal Privoznik <mprivozn@redhat.com>
acda74
Date: Tue, 7 Feb 2023 10:34:40 +0100
acda74
Subject: [PATCH] qemu_process: Produce better debug message wrt domain
acda74
 namespaces
acda74
acda74
When going through debug log of a domain startup process, one can
acda74
meet the following line:
acda74
acda74
  debug : qemuProcessLaunch:7668 : Building mount namespace
acda74
acda74
But this is in fact wrong. Firstly, domain namespaces are just
acda74
enabled in domain's privateData. Secondly, the debug message says
acda74
nothing about actual state of namespace - whether it was enabled
acda74
or not.
acda74
acda74
Therefore, move the debug printing into
acda74
qemuProcessEnableDomainNamespaces() and tweak it so that the
acda74
actual value is reflected.
acda74
acda74
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
acda74
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
acda74
(cherry picked from commit 697c16e39ae9a9e18ce7cad0729bf2293b12a307)
acda74
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2167302
acda74
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
acda74
---
acda74
 src/qemu/qemu_process.c | 8 ++++++--
acda74
 1 file changed, 6 insertions(+), 2 deletions(-)
acda74
acda74
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
acda74
index 1217fb1856..32083de563 100644
acda74
--- a/src/qemu/qemu_process.c
acda74
+++ b/src/qemu/qemu_process.c
acda74
@@ -7377,11 +7377,17 @@ qemuProcessEnableDomainNamespaces(virQEMUDriver *driver,
acda74
                                   virDomainObj *vm)
acda74
 {
acda74
     g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
acda74
+    const char *state = "disabled";
acda74
 
acda74
     if (virBitmapIsBitSet(cfg->namespaces, QEMU_DOMAIN_NS_MOUNT) &&
acda74
         qemuDomainEnableNamespace(vm, QEMU_DOMAIN_NS_MOUNT) < 0)
acda74
         return -1;
acda74
 
acda74
+    if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
acda74
+        state = "enabled";
acda74
+
acda74
+    VIR_DEBUG("Mount namespace for domain name=%s is %s",
acda74
+              vm->def->name, state);
acda74
     return 0;
acda74
 }
acda74
 
acda74
@@ -7705,8 +7711,6 @@ qemuProcessLaunch(virConnectPtr conn,
acda74
 
acda74
     qemuDomainLogContextMarkPosition(logCtxt);
acda74
 
acda74
-    VIR_DEBUG("Building mount namespace");
acda74
-
acda74
     if (qemuProcessEnableDomainNamespaces(driver, vm) < 0)
acda74
         goto cleanup;
acda74
 
acda74
-- 
acda74
2.39.1
acda74