]> xenbits.xensource.com Git - libvirt.git/commit
rpc: fix propagation of errors from server
authorNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Thu, 7 Feb 2019 12:58:42 +0000 (15:58 +0300)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 8 Feb 2019 15:51:45 +0000 (16:51 +0100)
commit4deed5f3c71f94acce387b68afbfc92911bf0a75
treebe6a24318e338d4c341dc9b9a2700518dbc3bc74
parent6709479a2f1ac392cb015b000b2443eca8a89c86
rpc: fix propagation of errors from server

Stream server error is not propagated if thread does not have the buck.
In case we have the buck we are ok due to the code added in [1].

Let's check for stream error on all paths. Now we don't need
to raise error in virNetClientCallDispatchStream.

Old code reported error only if the first message in wait
queue awaits reply. It is odd as depends on wait queue
situation. For example if we have only TX
message in queue and in one iteration loop both send the
message and receive error then thread sending TX message did
not receive the error. Next if we have RX message (first)
and TX message (second) in queue and in one iteration
loop both send the TX message and receive error then
thread sending TX message received error. In short
it was inconsistent. Let's report error whenever
we received it and for every type of message as it makes
sense to report errors as early as possible.

[1] 16c6e2b41: Fix propagation of RPC errors from streams

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
src/rpc/virnetclient.c