[PATCH] Qemu : Do not distinguish a 'hangup' from an 'eof'

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

 



An errno=ECONNRESET received on a monitor socket reflects that the
guest may have closed the socket.
Today, we just mark it as a 'hangup' and do not trigger
the eof callback.

I've been looking at a slew of such messages in libvirt logs. If 
the monitor socket indicated an ECONNRESET, it would possibly make sense 
to mark the socket closed so that the "eof" callback may
then be invoked.

Is there a subtle corner case I'm missing here ?

Signed-off-by: Prerna Saxena <saxenap.ltc@xxxxxxxxx>
---
 src/qemu/qemu_monitor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index a5e14b2..dcafa5a 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -690,10 +690,11 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque)
 
         if (events & VIR_EVENT_HANDLE_HANGUP) {
             hangup = true;
+            eof = true;
             if (!error) {
                 virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
                                _("End of file from qemu monitor"));
-                eof = true;
+
                 events &= ~VIR_EVENT_HANDLE_HANGUP;
             }
         }
-- 
1.8.1.2

--
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