]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix error reporting when poll returns POLLHUP/POLLERR
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 18 Apr 2017 15:57:06 +0000 (16:57 +0100)
committerCole Robinson <crobinso@redhat.com>
Wed, 10 May 2017 22:02:37 +0000 (18:02 -0400)
commitde609c01499774ed814e5a029a64190247eb540f
treee28408fd393cd921cd39cacb1f4f4efd86029b36
parent6611f3803604eb8ce021d4d19567e1823fd50d74
Fix error reporting when poll returns POLLHUP/POLLERR

In the RPC client event loop code, if poll() returns only a POLLHUP
or POLLERR status, then we end up reporting a bogus error message:

  error: failed to connect to the hypervisor
  error: An error occurred, but the cause is unknown

We do actually report an error, but we virNetClientMarkClose method
has already captured the error status before we report it, so the
real error gets thrown away. The key fix is to report the error
before calling virNetClientMarkClose(). In changing this, we also
split out reporting of POLLHUP vs POLLERR to make any future bugs
easier to diagnose.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit 234ac4e18db3a3acb7d8e792260ec0dabed7c36d)
src/rpc/virnetclient.c