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....@gmail.com>
---
 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@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to