[PATCH 2/3] Ensure lxcContainerResolveSymlinks reports errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

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@xxxxxxxxxx>
---
 src/lxc/lxc_container.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 9e87175..56df69e 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -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;
         }
 
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]