qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Gonglei <arei.gonglei@huawei.com>,
	Longpeng <longpeng2@huawei.com>,
	Jay Zhou <jianjay.zhou@huawei.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PULL 10/13] cryptodev: add vhost-user as a new cryptodev backend
Date: Fri, 27 Apr 2018 17:15:02 +0100	[thread overview]
Message-ID: <CAFEAcA8=4nyvq4949e171pScH86HbFdKxArHxC-gBcvm6Kytww@mail.gmail.com> (raw)
In-Reply-To: <1519922735-29054-11-git-send-email-mst@redhat.com>

On 1 March 2018 at 16:46, Michael S. Tsirkin <mst@redhat.com> wrote:
> From: Gonglei <arei.gonglei@huawei.com>
>
> Usage:
>  -chardev socket,id=charcrypto0,path=/path/to/your/socket
>  -object cryptodev-vhost-user,id=cryptodev0,chardev=charcrypto0
>  -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0
>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> Signed-off-by: Longpeng(Mike) <longpeng2@huawei.com>
> Signed-off-by: Jay Zhou <jianjay.zhou@huawei.com>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Hi; Coverity (CID 1390600) points out that there's dead code
in this function:

> +static void cryptodev_vhost_user_event(void *opaque, int event)
> +{
> +    CryptoDevBackendVhostUser *s = opaque;
> +    CryptoDevBackend *b = CRYPTODEV_BACKEND(s);
> +    Error *err = NULL;

We set err to NULL here...

> +    int queues = b->conf.peers.queues;
> +
> +    assert(queues < MAX_CRYPTO_QUEUE_NUM);
> +
> +    switch (event) {
> +    case CHR_EVENT_OPENED:
> +        if (cryptodev_vhost_user_start(queues, s) < 0) {
> +            exit(1);
> +        }
> +        b->ready = true;
> +        break;
> +    case CHR_EVENT_CLOSED:
> +        b->ready = false;
> +        cryptodev_vhost_user_stop(queues, s);
> +        break;
> +    }

...and nothing here does anything with err...

> +
> +    if (err) {
> +        error_report_err(err);
> +    }

...so this if() is all dead code and we could remove err entirely.

> +}

thanks
-- PMM

  reply	other threads:[~2018-04-27 16:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01 16:45 [Qemu-devel] [PULL 00/13] virtio, vhost, pci, pc: features, fixes and cleanups Michael S. Tsirkin
2018-03-01 16:45 ` [Qemu-devel] [PULL 01/13] vhost-user: fix memory leak Michael S. Tsirkin
2018-03-01 16:45 ` [Qemu-devel] [PULL 02/13] virtio-pci: trivial fixes in error message Michael S. Tsirkin
2018-03-01 16:45 ` [Qemu-devel] [PULL 03/13] intel-iommu: Accept 64-bit writes to FEADDR Michael S. Tsirkin
2018-03-01 16:45 ` [Qemu-devel] [PULL 04/13] docs: document virtio-balloon stats Michael S. Tsirkin
2018-03-01 16:45 ` [Qemu-devel] [PULL 05/13] docs: pcie: Spell out machine type needs for PCIe features Michael S. Tsirkin
2018-03-01 16:46 ` [Qemu-devel] [PULL 07/13] vhost: avoid to start/stop virtqueue which is not ready Michael S. Tsirkin
2018-03-01 16:46 ` [Qemu-devel] [PULL 06/13] vhost: fix memslot limit check Michael S. Tsirkin
2018-03-01 16:46 ` [Qemu-devel] [PULL 08/13] vhost: fix incorrect check in vhost_verify_ring_mappings Michael S. Tsirkin
2018-03-01 16:46 ` [Qemu-devel] [PULL 09/13] docs/vmcoreinfo: detail unsupported host format behaviour Michael S. Tsirkin
2018-03-01 16:46 ` [Qemu-devel] [PULL 11/13] cryptodev: add vhost support Michael S. Tsirkin
2018-03-01 16:46 ` [Qemu-devel] [PULL 10/13] cryptodev: add vhost-user as a new cryptodev backend Michael S. Tsirkin
2018-04-27 16:15   ` Peter Maydell [this message]
2018-04-28  0:59     ` Zhoujian (jay)
2018-03-01 16:46 ` [Qemu-devel] [PULL 12/13] cryptodev-vhost-user: add crypto session handler Michael S. Tsirkin
2018-03-01 16:46 ` [Qemu-devel] [PULL 13/13] cryptodev-vhost-user: set the key length Michael S. Tsirkin
2018-03-01 17:17 ` [Qemu-devel] [PULL 00/13] virtio, vhost, pci, pc: features, fixes and cleanups no-reply
2018-03-01 17:21 ` no-reply
2018-03-02 11:17 ` 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='CAFEAcA8=4nyvq4949e171pScH86HbFdKxArHxC-gBcvm6Kytww@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=arei.gonglei@huawei.com \
    --cc=jianjay.zhou@huawei.com \
    --cc=longpeng2@huawei.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --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).