]> xenbits.xensource.com Git - libvirt.git/commitdiff
virLXCControllerSetupUsernsMap: Modify debug logging for clean startup errors
authorPeter Krempa <pkrempa@redhat.com>
Tue, 1 Aug 2023 13:32:16 +0000 (15:32 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 4 Aug 2023 08:04:21 +0000 (10:04 +0200)
Avoid logging multiline debug logs so that the function which attempts
to extract a non-debug log error message can work properly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/lxc/lxc_controller.c

index 51459b47e741f5a09b6c412514eb03be1d7dda5d..d79b8e1dd669a1ef5139bdf3ccedddb0bd72aaff 100644 (file)
@@ -1359,11 +1359,13 @@ virLXCControllerSetupUsernsMap(virDomainIdMapEntry *map,
         return -1;
     }
 
-    for (i = 0; i < num; i++)
+    VIR_DEBUG("Set '%s' mappings to:", path);
+
+    for (i = 0; i < num; i++) {
+        VIR_DEBUG("%u %u %u", map[i].start, map[i].target, map[i].count);
         virBufferAsprintf(&map_value, "%u %u %u\n",
                           map[i].start, map[i].target, map[i].count);
-
-    VIR_DEBUG("Set '%s' to '%s'", path, virBufferCurrentContent(&map_value));
+    }
 
     if (virFileWriteStr(path, virBufferCurrentContent(&map_value), 0) < 0) {
         virReportSystemError(errno, _("unable write to %1$s"), path);