qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>, qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [Qemu-devel] [PULL 02/11] vhost-user: check unix_listen() return value
Date: Wed, 26 Jun 2019 12:55:43 -0500	[thread overview]
Message-ID: <dddce02c-a132-9ab8-0a96-7a81fd8ee76f@redhat.com> (raw)
In-Reply-To: <20190605145829.7674-3-marcandre.lureau@redhat.com>


[-- Attachment #1.1: Type: text/plain, Size: 1476 bytes --]

On 6/16/19 4:36 PM, Michael S. Tsirkin wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> This check shouldn't be necessary, since &error_fatal is given as
> argument and will exit() on failure. However, this change should
> silence coverity CID 1401761 & 1401705.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Message-Id: <20190605145829.7674-3-marcandre.lureau@redhat.com>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  contrib/vhost-user-gpu/main.c   | 4 ++++
>  contrib/vhost-user-input/main.c | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/contrib/vhost-user-gpu/main.c b/contrib/vhost-user-gpu/main.c
> index 9614c9422c..e0b6df5b4d 100644
> --- a/contrib/vhost-user-gpu/main.c
> +++ b/contrib/vhost-user-gpu/main.c
> @@ -1160,6 +1160,10 @@ main(int argc, char *argv[])
>  
>      if (opt_socket_path) {
>          int lsock = unix_listen(opt_socket_path, &error_fatal);
> +        if (lsock < 0) {
> +            g_printerr("Failed to listen on %s.\n", opt_socket_path);
> +            exit(EXIT_FAILURE);
> +        }

4 lines to appease Coverity; wouldn't the following one-liner also do
the trick?

int lsock = unix_listen(opt_socket_path, &error_fatal);
assert (lsock >= 0);

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2019-06-26 17:56 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05 14:58 [Qemu-devel] [PATCH 0/5] Misc vhost-user fixes Marc-André Lureau
2019-06-05 14:58 ` [Qemu-devel] [PATCH 1/5] vhost-user-gpu: do not send scanout update if no GPU socket Marc-André Lureau
2019-06-16 21:36   ` [Qemu-devel] [PULL 01/11] " Michael S. Tsirkin
2019-06-05 14:58 ` [Qemu-devel] [PATCH 2/5] vhost-user: check unix_listen() return value Marc-André Lureau
2019-06-07  8:49   ` Peter Maydell
2019-06-16 21:36   ` [Qemu-devel] [PULL 02/11] " Michael S. Tsirkin
2019-06-26 17:55   ` Eric Blake [this message]
2019-06-26 19:37     ` Marc-André Lureau
2019-06-05 14:58 ` [Qemu-devel] [PATCH 3/5] vhost-user: improve error report Marc-André Lureau
2019-06-16 21:36   ` [Qemu-devel] [PULL 03/11] " Michael S. Tsirkin
2019-06-05 14:58 ` [Qemu-devel] [PATCH 4/5] vhost-user-input: check ioctl(EVIOCGNAME) return value Marc-André Lureau
2019-06-07  8:50   ` Peter Maydell
2019-06-16 21:36   ` [Qemu-devel] [PULL 04/11] " Michael S. Tsirkin
2019-06-05 14:58 ` [Qemu-devel] [PATCH 5/5] vhost-user-gpu: initialize msghdr & iov at declaration Marc-André Lureau
2019-06-07  8:47   ` Peter Maydell
2019-06-16 21:36   ` [Qemu-devel] [PULL 05/11] " Michael S. Tsirkin
  -- strict thread matches above, loose matches on Subject: below --
2019-06-16 21:36 [Qemu-devel] [PULL 00/11] virtio, acpi: fixes, cleanups Michael S. Tsirkin
2019-06-03  6:15 ` [Qemu-devel] [PATCH] vhost: fix vhost_log size overflow during migration lihangjing
2019-06-16 21:36   ` [Qemu-devel] [PULL 07/11] " Michael S. Tsirkin
2019-06-05 13:12 ` [Qemu-devel] [PATCH] docs/vhost-user.json: some firmware.json copy leftovers Marc-André Lureau
2019-06-14  8:36   ` Stefan Hajnoczi
2019-06-16 21:36   ` [Qemu-devel] [PULL 06/11] " Michael S. Tsirkin
2019-06-26 16:24   ` [Qemu-devel] [Qemu-trivial] [PATCH] " Laurent Vivier
2019-06-26 16:28     ` Laurent Vivier
2019-06-07  7:34 ` [Qemu-devel] [PATCH v2] q35: fix mmconfig and PCI0._CRS Gerd Hoffmann
2019-06-07  7:49   ` Laszlo Ersek
2019-06-11  8:15   ` Marcel Apfelbaum
2019-06-11 11:37   ` Paolo Bonzini
2019-06-11 12:06     ` Michael S. Tsirkin
2019-06-16 21:36   ` [Qemu-devel] [PULL 09/11] " Michael S. Tsirkin
2019-06-10  1:18 ` [Qemu-devel] [PATCH v7] hw/acpi: extract acpi_add_rom_blob() Wei Yang
2019-06-16 21:36   ` [Qemu-devel] [PULL 08/11] " Michael S. Tsirkin
2019-06-16 21:36 ` [Qemu-devel] [PULL 10/11] q35: update DSDT Michael S. Tsirkin
2019-06-16 21:36 ` [Qemu-devel] [PULL 11/11] tests/rebuild-expected-aml.sh: blow out difflist Michael S. Tsirkin
2019-06-17 12:59 ` [Qemu-devel] [PULL 00/11] virtio, acpi: fixes, cleanups Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dddce02c-a132-9ab8-0a96-7a81fd8ee76f@redhat.com \
    --to=eblake@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).