[libvirt] [PATCH 01/11] qemu: monitor: Extract handling of JSON block job error codes

Peter Krempa pkrempa at redhat.com
Thu Apr 9 09:37:35 UTC 2015


On Thu, Apr 09, 2015 at 05:31:08 -0400, John Ferlan wrote:
> 
> 
> On 04/09/2015 05:26 AM, Peter Krempa wrote:
> 
> >> Because you touched it - Coverity whines that 'error' is not checked for
> >> NULL:
> >>
> >> (8) Event returned_null: 	"virJSONValueObjectGet" returns null (checked
> >> 96 out of 99 times). [details]
> >> (16) Event var_assigned: 	Assigning: "error" = null return value from
> >> "virJSONValueObjectGet".
> >> Also see events:
> >> (17) Event dereference: 	Dereferencing a pointer that might be null
> >> "error" when calling "virJSONValueObjectGetString". [details]
> > 
> > I hate coverity for this. That's a false positive due to the fact that
> > we check right away that the reply object contains the error subobject.
> > 
> 
> How about a "sa_assert(event);"

I hate those to be honest.

> 
> Coverity is only complaining because so many places check "if (error) ?
> xxx : yyy"
> 
> And yes it does work, I just checked
> 
> John

I've refactored a few other places, they should work nice together and
get rid of the error. I'll post v2 of the patches that can't be pushed
separately after I finish rebasing.

Peter

-------------- 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/20150409/2d4e5083/attachment-0001.sig>


More information about the libvir-list mailing list