From: Michal Privoznik Date: Fri, 4 Oct 2019 18:59:10 +0000 (+0200) Subject: qemuDomainCreateDeviceRecursive: Report error if mkdir() fails X-Git-Tag: v6.2.0-rc1~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bc746d66d126bd609ca1fc4ac16e096da00f5e0;p=thirdparty%2Flibvirt.git qemuDomainCreateDeviceRecursive: Report error if mkdir() fails 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 Reviewed-by: Pavel Mores --- diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index b67ec23a36..1c8d86a904 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -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"),