[libvirt] [PATCH 1/2] rpc: Report proper close reason

Martin Kletzander mkletzan at redhat.com
Mon Dec 8 12:58:24 UTC 2014


On Mon, Dec 01, 2014 at 10:46:38AM +0100, Jiri Denemark wrote:
>On Sun, Nov 30, 2014 at 20:09:08 +0100, Martin Kletzander wrote:
>> 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.
>>
>> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
>> ---
>>  src/rpc/virnetclient.c | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
>> index 8657b0e..d7455b5 100644
>> --- a/src/rpc/virnetclient.c
>> +++ b/src/rpc/virnetclient.c
>> @@ -634,8 +634,11 @@ virNetClientMarkClose(virNetClientPtr client,
>>      VIR_DEBUG("client=%p, reason=%d", client, reason);
>>      if (client->sock)
>>          virNetSocketRemoveIOCallback(client->sock);
>> -    client->wantClose = true;
>> -    client->closeReason = reason;
>> +    /* Don't override reason that's already set. */
>> +    if (!client->wantClose) {
>> +        client->wantClose = true;
>> +        client->closeReason = reason;
>> +    }
>>  }
>>
>
>ACK
>

Pushed, thanks.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20141208/867e33a9/attachment-0001.sig>


More information about the libvir-list mailing list