提交 6bc746d6 编写于 作者: M Michal Privoznik

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: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NPavel Mores <pmores@redhat.com>
上级 096e94ce
......@@ -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"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册