mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
qemu: driver: Fix usage of qemuOpenFile
The function returns -errno on failure, not only -1.
This commit is contained in:
parent
f7105d0e4a
commit
7d1b93906c
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user