mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Drop useless virFileWrapperFdCatchError
We are requesting for stderr catching for all cases in virFileWrapperFdNew(). There is no need to have a separate function just to report an error, esp. when we can do it in virFileWrapperFdClose().
This commit is contained in:
@@ -1382,7 +1382,6 @@ virFileLoopDeviceAssociate;
|
|||||||
virFileRewrite;
|
virFileRewrite;
|
||||||
virFileTouch;
|
virFileTouch;
|
||||||
virFileUpdatePerm;
|
virFileUpdatePerm;
|
||||||
virFileWrapperFdCatchError;
|
|
||||||
virFileWrapperFdClose;
|
virFileWrapperFdClose;
|
||||||
virFileWrapperFdFree;
|
virFileWrapperFdFree;
|
||||||
virFileWrapperFdNew;
|
virFileWrapperFdNew;
|
||||||
|
|||||||
@@ -2855,7 +2855,6 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
virFileWrapperFdCatchError(wrapperFd);
|
|
||||||
virFileWrapperFdFree(wrapperFd);
|
virFileWrapperFdFree(wrapperFd);
|
||||||
VIR_FREE(xml);
|
VIR_FREE(xml);
|
||||||
|
|
||||||
@@ -3288,10 +3287,8 @@ doCoreDump(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
VIR_FORCE_CLOSE(fd);
|
VIR_FORCE_CLOSE(fd);
|
||||||
if (ret != 0) {
|
if (ret != 0)
|
||||||
virFileWrapperFdCatchError(wrapperFd);
|
|
||||||
unlink(path);
|
unlink(path);
|
||||||
}
|
|
||||||
virFileWrapperFdFree(wrapperFd);
|
virFileWrapperFdFree(wrapperFd);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -282,26 +282,17 @@ virFileWrapperFdNew(int *fd ATTRIBUTE_UNUSED,
|
|||||||
int
|
int
|
||||||
virFileWrapperFdClose(virFileWrapperFdPtr wfd)
|
virFileWrapperFdClose(virFileWrapperFdPtr wfd)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (!wfd)
|
if (!wfd)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return virCommandWait(wfd->cmd, NULL);
|
ret = virCommandWait(wfd->cmd, NULL);
|
||||||
}
|
if (wfd->err_msg)
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* virFileWrapperFdCatchError:
|
|
||||||
* @wfd: fd wrapper, or NULL
|
|
||||||
*
|
|
||||||
* If iohelper reported any error VIR_WARN() about it.
|
|
||||||
*/
|
|
||||||
void
|
|
||||||
virFileWrapperFdCatchError(virFileWrapperFdPtr wfd)
|
|
||||||
{
|
|
||||||
if (wfd && wfd->err_msg)
|
|
||||||
VIR_WARN("iohelper reports: %s", wfd->err_msg);
|
VIR_WARN("iohelper reports: %s", wfd->err_msg);
|
||||||
}
|
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virFileWrapperFdFree:
|
* virFileWrapperFdFree:
|
||||||
|
|||||||
@@ -90,8 +90,6 @@ int virFileWrapperFdClose(virFileWrapperFdPtr dfd);
|
|||||||
|
|
||||||
void virFileWrapperFdFree(virFileWrapperFdPtr dfd);
|
void virFileWrapperFdFree(virFileWrapperFdPtr dfd);
|
||||||
|
|
||||||
void virFileWrapperFdCatchError(virFileWrapperFdPtr dfd);
|
|
||||||
|
|
||||||
int virFileLock(int fd, bool shared, off_t start, off_t len);
|
int virFileLock(int fd, bool shared, off_t start, off_t len);
|
||||||
int virFileUnlock(int fd, off_t start, off_t len);
|
int virFileUnlock(int fd, off_t start, off_t len);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user