]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virfile: Add error for root squash change mode failure
authorJohn Ferlan <jferlan@redhat.com>
Mon, 24 Aug 2015 16:37:41 +0000 (12:37 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 2 Sep 2015 12:59:53 +0000 (08:59 -0400)
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.

src/util/virfile.c

index 5f64186bbe665256f707552e565d66b41e62f57f..3abef05036512f64297b82a79892b5af09709acf 100644 (file)
@@ -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);