提交 7d1b9390 编写于 作者: P Peter Krempa

qemu: driver: Fix usage of qemuOpenFile

The function returns -errno on failure, not only -1.
上级 f7105d0e
......@@ -11189,7 +11189,7 @@ qemuDomainBlockPeek(virDomainPtr dom,
path = actual;
fd = qemuOpenFile(driver, vm, path, O_RDONLY, NULL, NULL);
if (fd == -1)
if (fd < 0)
goto cleanup;
/* Seek and read. */
......@@ -11327,7 +11327,7 @@ qemuDomainStorageOpenStat(virQEMUDriverPtr driver,
{
if (virStorageSourceIsLocalStorage(src)) {
if ((*ret_fd = qemuOpenFile(driver, vm, src->path, O_RDONLY,
NULL, NULL)) == -1)
NULL, NULL)) < 0)
return -1;
if (fstat(*ret_fd, ret_sb) < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册