[libvirt] [PATCH 2/2] vbox: Resolve Coverity CHECKED_RETURN

Ján Tomko jtomko at redhat.com
Thu Nov 19 14:20:25 UTC 2015


On Thu, Nov 19, 2015 at 09:06:05AM -0500, John Ferlan wrote:
> Other callers check return from virDomainGraphicsListenSetAddress, but
> vbox doesn't in it's vboxDumpDisplay. Follow other instances within vbox
> to just ignore the return value in the vboxDump* functions.
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/vbox/vbox_common.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 

NACK, this silences the error instead of resolving it.

You can achieve the same result by not running Coverity at all :)

Jan

> diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
> index 3e6ed7a..4576a07 100644
> --- a/src/vbox/vbox_common.c
> +++ b/src/vbox/vbox_common.c
> @@ -3408,8 +3408,9 @@ vboxDumpDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine)
>                  if (netAddressUtf16) {
>                      VBOX_UTF16_TO_UTF8(netAddressUtf16, &netAddressUtf8);
>                      if (STRNEQ(netAddressUtf8, ""))
> -                        virDomainGraphicsListenSetAddress(def->graphics[def->ngraphics], 0,
> -                                                          netAddressUtf8, -1, true);
> +                        ignore_value(virDomainGraphicsListenSetAddress(
> +                                     def->graphics[def->ngraphics], 0,
> +                                     netAddressUtf8, -1, true));
>                      VBOX_UTF16_FREE(netAddressUtf16);
>                      VBOX_UTF8_FREE(netAddressUtf8);
>                  }
> -- 
> 2.5.0
> 
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
-------------- 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/20151119/faddecdc/attachment-0001.sig>


More information about the libvir-list mailing list