]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuDomainCreateDeviceRecursive: Report error if mkdir() fails
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 4 Oct 2019 18:59:10 +0000 (20:59 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 20 Mar 2020 13:29:51 +0000 (14:29 +0100)
The virFileMakePathWithMode() which is our recursive version of
mkdir() fails, it simply just returns a negative value with errno
set. No error is reported (as compared to virFileTouch() for
instance).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Mores <pmores@redhat.com>
src/qemu/qemu_domain.c

index b67ec23a362a7d3b91165ceece42de2be8ab81b4..1c8d86a904706dc4b0cfa7a23c47aab97413f7d4 100644 (file)
@@ -14643,8 +14643,12 @@ qemuDomainCreateDeviceRecursive(const char *device,
          * proper owner and mode. Bind mount only after that. */
     } else if (isDir) {
         if (create &&
-            virFileMakePathWithMode(devicePath, sb.st_mode) < 0)
+            virFileMakePathWithMode(devicePath, sb.st_mode) < 0) {
+            virReportSystemError(errno,
+                                 _("Unable to make dir %s"),
+                                 devicePath);
             goto cleanup;
+        }
     } else {
         virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
                        _("unsupported device type %s 0%o"),