[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 2/9] Fix propagation of RPC errors from streams



On 06/28/2011 11:01 AM, Daniel P. Berrange wrote:
> If a streams error is raised, virNetClientIOEventLoop
> returns 0, but an error is set. Check for this and
> propagate it if present
> 
> * src/rpc/virnetclient.c: Propagate streams error
> ---
>  src/rpc/virnetclient.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
> index ded1e12..dc0ce51 100644
> --- a/src/rpc/virnetclient.c
> +++ b/src/rpc/virnetclient.c
> @@ -1090,10 +1090,15 @@ static int virNetClientIO(virNetClientPtr client,
>       */
>      virNetSocketUpdateIOCallback(client->sock, 0);
>  
> +    virResetLastError();
>      rv = virNetClientIOEventLoop(client, thiscall);
>  
>      virNetSocketUpdateIOCallback(client->sock, VIR_EVENT_HANDLE_READABLE);
>  
> +    if (rv == 0 &&
> +        virGetLastError())
> +        rv = -1;
> +
>  cleanup:
>      VIR_DEBUG("All done with our call %p %p %d", client->waitDispatch, thiscall, rv);
>      return rv;

ACK.

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]