From: "Daniel P. Berrange" <berrange(a)redhat.com>
Ensure the lxcContainerMain method reports any errors that
occur during setup to stderr, where libvirtd will pick them
up.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/lxc/lxc_container.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 7c722cc..9e87175 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -1905,6 +1905,15 @@ cleanup:
ret = virCommandExec(cmd);
}
+ if (ret != 0) {
+ virErrorPtr err = virGetLastError();
+ if (err && err->message)
+ fprintf(stderr, "%s\n", err->message);
+ else
+ fprintf(stderr, "%s\n",
+ _("Unknown failure in libvirt_lxc startup"));
+ }
+
virCommandFree(cmd);
return ret;
}
--
1.8.3.1