511e2c
From: Cole Robinson <crobinso@redhat.com>
511e2c
Date: Thu, 26 Sep 2019 15:25:52 -0400
511e2c
Subject: [PATCH] vircgroup: Add some VIR_DEBUG statements
511e2c
511e2c
These helped with debugging
511e2c
https://bugzilla.redhat.com/show_bug.cgi?id=1612383
511e2c
511e2c
Signed-off-by: Cole Robinson <crobinso@redhat.com>
511e2c
---
511e2c
 src/util/vircgroup.c   | 3 ++-
511e2c
 src/util/vircgroupv2.c | 9 +++++++++
511e2c
 2 files changed, 11 insertions(+), 1 deletion(-)
511e2c
511e2c
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
511e2c
index 825f62a97b..4f9d80666d 100644
511e2c
--- a/src/util/vircgroup.c
511e2c
+++ b/src/util/vircgroup.c
511e2c
@@ -1157,7 +1157,8 @@ virCgroupNewMachineSystemd(const char *name,
511e2c
     virCgroupFree(&init);
511e2c
 
511e2c
     if (!path || STREQ(path, "/") || path[0] != '/') {
511e2c
-        VIR_DEBUG("Systemd didn't setup its controller");
511e2c
+        VIR_DEBUG("Systemd didn't setup its controller, path=%s",
511e2c
+                  NULLSTR(path));
511e2c
         return -2;
511e2c
     }
511e2c
 
511e2c
diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c
511e2c
index ecf7d42076..ff079be718 100644
511e2c
--- a/src/util/vircgroupv2.c
511e2c
+++ b/src/util/vircgroupv2.c
511e2c
@@ -155,10 +155,14 @@ virCgroupV2CopyPlacement(virCgroupPtr group,
511e2c
                          const char *path,
511e2c
                          virCgroupPtr parent)
511e2c
 {
511e2c
+    VIR_DEBUG("group=%p path=%s parent=%p", group, path, parent);
511e2c
+
511e2c
     if (path[0] == '/') {
511e2c
         if (VIR_STRDUP(group->unified.placement, path) < 0)
511e2c
             return -1;
511e2c
     } else {
511e2c
+        VIR_DEBUG("parent->unified.placement=%s", parent->unified.placement);
511e2c
+
511e2c
         /*
511e2c
          * parent == "/" + path="" => "/"
511e2c
          * parent == "/libvirt.service" + path == "" => "/libvirt.service"
511e2c
@@ -172,6 +176,7 @@ virCgroupV2CopyPlacement(virCgroupPtr group,
511e2c
             return -1;
511e2c
     }
511e2c
 
511e2c
+    VIR_DEBUG("set group->unified.placement=%s", group->unified.placement);
511e2c
     return 0;
511e2c
 }
511e2c
 
511e2c
@@ -200,6 +205,9 @@ virCgroupV2DetectPlacement(virCgroupPtr group,
511e2c
     if (group->unified.placement)
511e2c
         return 0;
511e2c
 
511e2c
+    VIR_DEBUG("group=%p path=%s controllers=%s selfpath=%s",
511e2c
+              group, path, controllers, selfpath);
511e2c
+
511e2c
     /* controllers="" indicates the cgroupv2 controller path */
511e2c
     if (STRNEQ_NULLABLE(controllers, ""))
511e2c
         return 0;
511e2c
@@ -216,6 +224,7 @@ virCgroupV2DetectPlacement(virCgroupPtr group,
511e2c
                     path) < 0)
511e2c
         return -1;
511e2c
 
511e2c
+    VIR_DEBUG("set group->unified.placement=%s", group->unified.placement);
511e2c
     return 0;
511e2c
 }
511e2c