[libvirt] [PATCH v4 3/6] virStream*All: Call virStreamAbort() more frequently

John Ferlan jferlan at redhat.com
Sat Jul 8 12:51:44 UTC 2017



On 06/22/2017 08:30 AM, Michal Privoznik wrote:
> Our documentation to all four virStreamRecvAll, virStreamSendAll,
> virStreamSparseRecvAll, virStreamSparseSendAll says that if these
> functions fail, virStreamAbort() is called. But that is not

Our documentation to the virStreamRecvAll, virStreamSendAll,
virStreamSparseRecvAll, and virStreamSparseSendAll functions indicates
that if these functions fail, then virStreamAbort is called....

(essentially what I wrote in the previous review).

> necessarily true. For instance all of these functions allocate a
> buffer to work with. If the allocation fails, no virStreamAbort()
> is called despite -1 being returned. It's the same story with
> argument sanity checks and a lot of other checks.
> 
> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
> ---
>  src/libvirt-stream.c | 49 ++++++++++++++++++++-----------------------------
>  1 file changed, 20 insertions(+), 29 deletions(-)
> 

Also of note from the previous review:

My comment:
   > Another "irony" is that the comment code example for virStreamSend
shows
   > the need to call virStreamAbort after a virStreamSend failure, but the
   > same is not true for virStreamRecv failure example.

Your response:
    Ah, I haven't realized that! Sure. this definitely needs to be fixed
    too. In fact, it belongs to this patch IMO - since it's fixing the very
    same issue.

...

So, IOW: Please update the virStreamRecv example to add that
virStreamAbort if (got < 0)...

Reviewed-by: John Ferlan <jferlan at redhat.com>

John




More information about the libvir-list mailing list