[PATCH 2/3] virfile: Report error in virFileWrapperFdFree()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Logging the error is fine and all, but getting the information
to the user directly is even better.

https://bugzilla.redhat.com/show_bug.cgi?id=1578741
Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/util/virfile.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/util/virfile.c b/src/util/virfile.c
index 271bf5e796..30cad87df9 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -351,8 +351,12 @@ virFileWrapperFdFree(virFileWrapperFdPtr wfd)
     if (!wfd)
         return;
 
+    /* If the command used to process IO has produced errors, it's fair
+     * to assume those will be more relevant to the user than whatever
+     * eg. QEMU can figure out on its own, so it's okay if we end up
+     * discarding an existing error */
     if (wfd->err_msg && *wfd->err_msg)
-        VIR_WARN("iohelper reports: %s", wfd->err_msg);
+        virReportError(VIR_ERR_OPERATION_FAILED, "%s", wfd->err_msg);
 
     virCommandAbort(wfd->cmd);
 
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux