[libvirt] [PATCH 1/4] virfile: Add error for root squash change mode failure

John Ferlan jferlan at redhat.com
Wed Sep 2 00:55:55 UTC 2015


This will only be seen when debugging, but in order to help determine
whether a virFileOpenForceOwnerMode failed during an NFS root-squash
volume/file creation, add an error message from the child.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/util/virfile.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/util/virfile.c b/src/util/virfile.c
index 5f64186..3abef05 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -2113,8 +2113,13 @@ virFileOpenForked(const char *path, int openflags, mode_t mode,
 
         /* File is successfully open. Set permissions if requested. */
         ret = virFileOpenForceOwnerMode(path, fd, mode, uid, gid, flags);
-        if (ret < 0)
+        if (ret < 0) {
+            ret = -errno;
+            virReportSystemError(errno,
+                                 _("child process failed to force owner mode file '%s'"),
+                                 path);
             goto childerror;
+        }
 
         do {
             ret = sendfd(pair[1], fd);
-- 
2.1.0




More information about the libvir-list mailing list