[PATCH 09/10] qemu: agent: fix loop error messages

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

 



---
 src/qemu/qemu_agent.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c
index 5dc39b6..36bc7c7 100644
--- a/src/qemu/qemu_agent.c
+++ b/src/qemu/qemu_agent.c
@@ -634,9 +634,15 @@ qemuAgentIO(int watch, int fd, int events, void *opaque)
     if (events & VIR_EVENT_HANDLE_READABLE) {
         int got = qemuAgentIORead(mon);
 
-        if (got <= 0)
+        if (got < 0)
             goto error;
 
+        if (got == 0) {
+            virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                           _("EOF from agent"));
+            goto error;
+        }
+
         if (qemuAgentIOProcess(mon) < 0)
             goto error;
 
@@ -647,13 +653,13 @@ qemuAgentIO(int watch, int fd, int events, void *opaque)
 
     if (events & VIR_EVENT_HANDLE_HANGUP) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("End of file from agent monitor"));
+                       _("Write hangup from agent"));
         goto error;
     }
 
     if (events & VIR_EVENT_HANDLE_ERROR) {
         virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("Invalid file descriptor while waiting for monitor"));
+                       _("Write error to agent"));
         goto error;
     }
 
-- 
1.8.3.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]