]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu_process: Produce better debug message wrt domain namespaces
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 7 Feb 2023 09:34:40 +0000 (10:34 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 8 Feb 2023 07:37:28 +0000 (08:37 +0100)
When going through debug log of a domain startup process, one can
meet the following line:

  debug : qemuProcessLaunch:7668 : Building mount namespace

But this is in fact wrong. Firstly, domain namespaces are just
enabled in domain's privateData. Secondly, the debug message says
nothing about actual state of namespace - whether it was enabled
or not.

Therefore, move the debug printing into
qemuProcessEnableDomainNamespaces() and tweak it so that the
actual value is reflected.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
src/qemu/qemu_process.c

index e96b7689a3ebb441939c59c0245531d93833c659..566deb4c584fab3d2744d2c0d185569f2d53e350 100644 (file)
@@ -7378,11 +7378,17 @@ qemuProcessEnableDomainNamespaces(virQEMUDriver *driver,
                                   virDomainObj *vm)
 {
     g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
+    const char *state = "disabled";
 
     if (virBitmapIsBitSet(cfg->namespaces, QEMU_DOMAIN_NS_MOUNT) &&
         qemuDomainEnableNamespace(vm, QEMU_DOMAIN_NS_MOUNT) < 0)
         return -1;
 
+    if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
+        state = "enabled";
+
+    VIR_DEBUG("Mount namespace for domain name=%s is %s",
+              vm->def->name, state);
     return 0;
 }
 
@@ -7706,8 +7712,6 @@ qemuProcessLaunch(virConnectPtr conn,
 
     qemuDomainLogContextMarkPosition(logCtxt);
 
-    VIR_DEBUG("Building mount namespace");
-
     if (qemuProcessEnableDomainNamespaces(driver, vm) < 0)
         goto cleanup;