]> xenbits.xensource.com Git - libvirt.git/commitdiff
Ensure lxcContainerResolveSymlinks reports errors
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 14 Oct 2013 12:06:31 +0000 (13:06 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 14 Oct 2013 14:38:20 +0000 (15:38 +0100)
The lxcContainerResolveSymlinks method merely logged some errors
as debug messages, rather than reporting them as proper errors.
This meant startup failures were not diagnosed at all.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/lxc/lxc_container.c

index 9e871750739846a61085350b39a4fd6f63714db1..56df69e387df592fe4a7e0503782e308bce5a1fd 100644 (file)
@@ -1697,7 +1697,6 @@ static int lxcContainerResolveSymlinks(virDomainDefPtr vmDef)
 {
     char *newroot;
     size_t i;
-    char ebuf[1024];
 
     VIR_DEBUG("Resolving symlinks");
 
@@ -1707,14 +1706,16 @@ static int lxcContainerResolveSymlinks(virDomainDefPtr vmDef)
             continue;
 
         if (access(fs->src, F_OK)) {
-            VIR_DEBUG("Failed to access '%s': %s", fs->src,
-                      virStrerror(errno, ebuf, sizeof(ebuf)));
+            virReportSystemError(errno,
+                                 _("Failed to access '%s'"), fs->src);
             return -1;
         }
 
         VIR_DEBUG("Resolving '%s'", fs->src);
         if (virFileResolveAllLinks(fs->src, &newroot) < 0) {
-            VIR_DEBUG("Failed to resolve symlink at %s", fs->src);
+            virReportSystemError(errno,
+                                 _("Failed to resolve symlink at %s"),
+                                 fs->src);
             return -1;
         }