[libvirt] [PATCH] Fix reporting of i/o errors by iohelper process

Jason J. Herne jjherne at us.ibm.com
Wed Jul 16 14:12:23 UTC 2014

From: "Jason J. Herne" <jjherne at us.ibm.com>

libvirt_iohelper is a helper process that is exec'ed and used to handle I/O
during a Qemu managed save operation. Due to a missing call to
virFileWrapperFdClose, all I/O error messages reported by iohelper are lost.

This patch adds a call to virFileWrapperFdClose to the cleanup phase of

This patch also modifies virFileWrapperFdClose such that errors are only
reported when the length of the err_msg buffer is > 0. Before now, the
existence of the buffer would trigger error reporting in virFileWrapperFdClose.

Signed-off-by: Jason J. Herne <jjherne at us.ibm.com>
 src/qemu/qemu_driver.c | 1 +
 src/util/virfile.c     | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index ecccf6c..8d78805 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3015,6 +3015,7 @@ qemuDomainSaveMemory(virQEMUDriverPtr driver,
+    virFileWrapperFdClose(wrapperFd);
diff --git a/src/util/virfile.c b/src/util/virfile.c
index 463064c..813b4f5 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -322,7 +322,7 @@ virFileWrapperFdClose(virFileWrapperFdPtr wfd)
         return 0;
     ret = virCommandWait(wfd->cmd, NULL);
-    if (wfd->err_msg)
+    if (wfd->err_msg && strlen(wfd->err_msg))
         VIR_WARN("iohelper reports: %s", wfd->err_msg);
     return ret;

More information about the libvir-list mailing list