util: Report error in virFileWrapperFdClose()
commit40204c05c509580d4fb66e32617b5641b05cf0a4
authorAndrea Bolognani <abologna@redhat.com>
Tue, 19 Feb 2019 16:20:41 +0000 (19 17:20 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 25 Feb 2019 15:34:37 +0000 (25 16:34 +0100)
treebf22a28406370805eb1a097e6f259b5b4f8a6252
parent4640131ba39e549ae9b5a794efe0c259408626c6
util: Report error in virFileWrapperFdClose()

libvirt_iohelper is used internally by the virFileWrapperFd APIs;
more specifically, in the QEMU driver we have the doCoreDump() and
qemuDomainSaveMemory() helper functions as users, and those in turn
end up being called by the implementation of several driver APIs.

By calling virReportError() if libvirt_iohelper has failed, we
overwrite whatever generic error message QEMU might have raised
with the more useful one generated by the helper program.

After this commit, the user will be able to see the error directly
instead of having to dig in the journal or libvirtd log.

https://bugzilla.redhat.com/show_bug.cgi?id=1578741

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virfile.c