On Tue, May 02, 2017 at 16:55:59 +0200, Jiri Denemark wrote:
When we get a POLLHUP or VIR_EVENT_HANDLE_HANGUP event for a client,
we
still want to read from the socket to process any accumulated data. But
doing so inevitably results in an error and a call to
virNetClientMarkClose before we get to processing the hangup event (and
another call to virNetClientMarkClose). However the close reason passed
to the second virNetClientMarkClose call is ignored because another one
was already set. We need to pass the correct close reason when marking
the socket to be closed for the first time.
https://bugzilla.redhat.com/show_bug.cgi?id=1373859
So this basically partially overrides what this commit has done (wrong):
commit f1271380381bb49b4a4c38950fe77a60d19ea9a3
Author: Martin Kletzander <mkletzan(a)redhat.com>
Date: Sun Nov 30 20:09:08 2014 +0100
rpc: Report proper close reason
Whenever client socket was marked as closed for some reason, it could've
been changed when really closing the connection. With this patch the
proper reason is kept since the first time it's marked as closed.
Without the mentioned commit the last error would be remembered. It is
probable that in some cases the error would be overwritten incorrectly
so I think that the combination of these two patches should do the
trick.
ACK