render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
43fe83
From 614eed200e78648bcc536a7ec41e238fb91e105e Mon Sep 17 00:00:00 2001
43fe83
Message-Id: <614eed200e78648bcc536a7ec41e238fb91e105e.1381871412.git.jdenemar@redhat.com>
43fe83
From: "Daniel P. Berrange" <berrange@redhat.com>
43fe83
Date: Mon, 14 Oct 2013 16:45:27 +0100
43fe83
Subject: [PATCH] Ensure lxcContainerResolveSymlinks reports errors
43fe83
43fe83
For
43fe83
43fe83
  https://bugzilla.redhat.com/show_bug.cgi?id=927072
43fe83
43fe83
The lxcContainerResolveSymlinks method merely logged some errors
43fe83
as debug messages, rather than reporting them as proper errors.
43fe83
This meant startup failures were not diagnosed at all.
43fe83
43fe83
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
43fe83
(cherry picked from commit 01100c7f60cee7b9075110b1e4b397dfff1a17ba)
43fe83
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
43fe83
---
43fe83
 src/lxc/lxc_container.c | 9 +++++----
43fe83
 1 file changed, 5 insertions(+), 4 deletions(-)
43fe83
43fe83
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
43fe83
index 06fb08d..9479498 100644
43fe83
--- a/src/lxc/lxc_container.c
43fe83
+++ b/src/lxc/lxc_container.c
43fe83
@@ -1668,7 +1668,6 @@ static int lxcContainerResolveSymlinks(virDomainDefPtr vmDef)
43fe83
 {
43fe83
     char *newroot;
43fe83
     size_t i;
43fe83
-    char ebuf[1024];
43fe83
 
43fe83
     VIR_DEBUG("Resolving symlinks");
43fe83
 
43fe83
@@ -1678,14 +1677,16 @@ static int lxcContainerResolveSymlinks(virDomainDefPtr vmDef)
43fe83
             continue;
43fe83
 
43fe83
         if (access(fs->src, F_OK)) {
43fe83
-            VIR_DEBUG("Failed to access '%s': %s", fs->src,
43fe83
-                      virStrerror(errno, ebuf, sizeof(ebuf)));
43fe83
+            virReportSystemError(errno,
43fe83
+                                 _("Failed to access '%s'"), fs->src);
43fe83
             return -1;
43fe83
         }
43fe83
 
43fe83
         VIR_DEBUG("Resolving '%s'", fs->src);
43fe83
         if (virFileResolveAllLinks(fs->src, &newroot) < 0) {
43fe83
-            VIR_DEBUG("Failed to resolve symlink at %s", fs->src);
43fe83
+            virReportSystemError(errno,
43fe83
+                                 _("Failed to resolve symlink at %s"),
43fe83
+                                 fs->src);
43fe83
             return -1;
43fe83
         }
43fe83
 
43fe83
-- 
43fe83
1.8.3.2
43fe83