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

Martin Kletzander mkletzan at redhat.com
Fri Nov 25 14:30:33 UTC 2016


On Fri, Oct 28, 2016 at 12:33:28PM -0700, Prerna Saxena wrote:
>An errno=ECONNRESET received on a monitor socket reflects that the
>guest may have closed the socket.

How would they close it?  Does that happen when the process is dying?

>Today, we just mark it as a 'hangup' and do not trigger
>the eof callback.
>

I'm guessing that's because the process is not quitting and killing the
domain would be weird.

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

It depends.  What are all the ways you can call ECONNRESET on such
socket?

>Is there a subtle corner case I'm missing here ?
>
>Signed-off-by: Prerna Saxena <saxenap.ltc at 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 at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161125/56ff573f/attachment-0001.sig>


More information about the libvir-list mailing list