43fe83
From 044dc48da47a5f5b2dd32212075da4b5e34840e8 Mon Sep 17 00:00:00 2001
43fe83
Message-Id: <044dc48da47a5f5b2dd32212075da4b5e34840e8.1381871412.git.jdenemar@redhat.com>
43fe83
From: "Daniel P. Berrange" <berrange@redhat.com>
43fe83
Date: Mon, 14 Oct 2013 16:45:26 +0100
43fe83
Subject: [PATCH] Ensure lxcContainerMain reports errors on stderr
43fe83
43fe83
For
43fe83
43fe83
  https://bugzilla.redhat.com/show_bug.cgi?id=927072
43fe83
43fe83
Ensure the lxcContainerMain method reports any errors that
43fe83
occur during setup to stderr, where libvirtd will pick them
43fe83
up.
43fe83
43fe83
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
43fe83
(cherry picked from commit 558546fb8f7104ad7fbdd14c615404618ce91453)
43fe83
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
43fe83
---
43fe83
 src/lxc/lxc_container.c | 9 +++++++++
43fe83
 1 file changed, 9 insertions(+)
43fe83
43fe83
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
43fe83
index f6375b7..06fb08d 100644
43fe83
--- a/src/lxc/lxc_container.c
43fe83
+++ b/src/lxc/lxc_container.c
43fe83
@@ -1876,6 +1876,15 @@ cleanup:
43fe83
         ret = virCommandExec(cmd);
43fe83
     }
43fe83
 
43fe83
+    if (ret != 0) {
43fe83
+        virErrorPtr err = virGetLastError();
43fe83
+        if (err && err->message)
43fe83
+            fprintf(stderr, "%s\n", err->message);
43fe83
+        else
43fe83
+            fprintf(stderr, "%s\n",
43fe83
+                    _("Unknown failure in libvirt_lxc startup"));
43fe83
+    }
43fe83
+
43fe83
     virCommandFree(cmd);
43fe83
     return ret;
43fe83
 }
43fe83
-- 
43fe83
1.8.3.2
43fe83