]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
Add some misc debugging to LXC startup
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 1 Jul 2013 16:42:25 +0000 (17:42 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 2 Jul 2013 13:00:13 +0000 (14:00 +0100)
Add some debug logging of LXC wait/continue messages
and uid/gid map update code.

src/lxc/lxc_container.c
src/lxc/lxc_controller.c

index b37300b16da3a863edac3446e6fd8ab747aca65f..282c726f8cad67692aca620ac6844042a90e83bf 100644 (file)
@@ -294,6 +294,7 @@ int lxcContainerSendContinue(int control)
     lxc_message_t msg = LXC_CONTINUE_MSG;
     int writeCount = 0;
 
+    VIR_DEBUG("Send continue on fd %d", control);
     writeCount = safewrite(control, &msg, sizeof(msg));
     if (writeCount != sizeof(msg)) {
         goto error_out;
@@ -319,7 +320,9 @@ int lxcContainerWaitForContinue(int control)
     lxc_message_t msg;
     int readLen;
 
+    VIR_DEBUG("Wait continue on fd %d", control);
     readLen = saferead(control, &msg, sizeof(msg));
+    VIR_DEBUG("Got continue on fd %d %d", control, readLen);
     if (readLen != sizeof(msg)) {
         if (readLen >= 0)
             errno = EIO;
@@ -348,6 +351,7 @@ static int lxcContainerSetID(virDomainDefPtr def)
      * for this container. And user namespace is only enabled
      * when nuidmap&ngidmap is not zero */
 
+    VIR_DEBUG("Set UID/GID to 0/0");
     if (def->idmap.nuidmap && virSetUIDGID(0, 0) < 0) {
         virReportSystemError(errno, "%s",
                              _("setuid or setgid failed"));
index 4c825aa05dc86ef9f3e45128cc5e456c4206602b..88601f12b52c7271e0d8b858cc9ee61465c7119e 100644 (file)
@@ -1158,6 +1158,8 @@ virLXCControllerSetupUsernsMap(virDomainIdMapEntryPtr map,
     if (virBufferError(&map_value))
         goto no_memory;
 
+    VIR_DEBUG("Set '%s' to '%s'", path, virBufferCurrentContent(&map_value));
+
     if (virFileWriteStr(path, virBufferCurrentContent(&map_value), 0) < 0) {
         virReportSystemError(errno, _("unable write to %s"), path);
         goto cleanup;