• N
    rpc: client: incapsulate error checks · ad063f61
    Nikolay Shirokovskiy 提交于
    Checking virNetClientStreamRaiseError without client lock
    is racy which is fixed in [1] for example. Thus let's remove such checks
    when we are sending message to server. And in other cases
    (like virNetClientStreamRecvHole for example) let's move the check
    into client stream code.
    
    virNetClientStreamRecvPacket already have stream lock so we could
    introduce another error checking function like virNetClientStreamRaiseErrorLocked
    but as error is set when both client and stream lock are hold we
    can remove locking from virNetClientStreamRaiseError because all
    callers hold either client or stream lock.
    
    Also let's split virNetClientStreamRaiseErrorLocked into checking
    state function and checking message send status function. They are
    same yet.
    
    [1] 1b6a29c21: rpc: fix race on stream abort/finish and server side abort
    Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
    Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
    ad063f61
virnetclientstream.h 3.5 KB