]> xenbits.xensource.com Git - libvirt.git/commit
fdstream: Report error from the I/O thread
authorJohn Ferlan <jferlan@redhat.com>
Wed, 6 Jun 2018 12:38:30 +0000 (08:38 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 7 Jun 2018 00:35:55 +0000 (20:35 -0400)
commit5babc51912f91f196922b4149ce7e90ceafb5f9c
treed511bbad0f16f37e7e73214c274a93239bfcb1b4
parent6d21d9bccb059dd65389c17d5932b0f3780f284b
fdstream: Report error from the I/O thread

https://bugzilla.redhat.com/show_bug.cgi?id=1529059

Commit id 0fe4aa14 added the thread specific error message
reporting (or save) to virFDStreamEvent; however, as processing
goes via virStream{Send|SendHole|Recv} via calls from
daemonStreamHandle{WriteData|Hole|Read} the last error
gets reset in the main libvirt API's thus, whatever error
may have been set as last error will be cleared prior to
the error paths using it resulting in the generic error
on the client side.

For each of the paths that check threadQuit or threadErr,
check if threadErr was set and set it agian if there isn't
a last error (e.g. some other failure) set so that the
message can be provided back to the client.

Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virfdstream.c