render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From 614eed200e78648bcc536a7ec41e238fb91e105e Mon Sep 17 00:00:00 2001
Message-Id: <614eed200e78648bcc536a7ec41e238fb91e105e.1381871412.git.jdenemar@redhat.com>
From: "Daniel P. Berrange" <berrange@redhat.com>
Date: Mon, 14 Oct 2013 16:45:27 +0100
Subject: [PATCH] Ensure lxcContainerResolveSymlinks reports errors

For

  https://bugzilla.redhat.com/show_bug.cgi?id=927072

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>
(cherry picked from commit 01100c7f60cee7b9075110b1e4b397dfff1a17ba)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 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 06fb08d..9479498 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -1668,7 +1668,6 @@ static int lxcContainerResolveSymlinks(virDomainDefPtr vmDef)
 {
     char *newroot;
     size_t i;
-    char ebuf[1024];
 
     VIR_DEBUG("Resolving symlinks");
 
@@ -1678,14 +1677,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.2