From: Jason Wang <jasowang@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] net: simplify net_init_tap_one logic
Date: Fri, 26 Feb 2016 15:13:30 +0800 [thread overview]
Message-ID: <56CFFB1A.8060006@redhat.com> (raw)
In-Reply-To: <1456441557-1096-1-git-send-email-pbonzini@redhat.com>
On 02/26/2016 07:05 AM, Paolo Bonzini wrote:
> net_init_tap_one receives in vhostfdname a fd name from vhostfd= or
> vhostfds=, or NULL if there is no vhostfd=/vhostfds=. It is simpler
> to just check vhostfdname, than it is to check for vhostfd= or
> vhostfds=. This also calms down Coverity, which otherwise thinks
> that monitor_fd_param could dereference a NULL vhostfdname.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> net/tap.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/tap.c b/net/tap.c
> index cfb6831..cd7a7fc 100644
> --- a/net/tap.c
> +++ b/net/tap.c
> @@ -662,7 +662,7 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
> options.backend_type = VHOST_BACKEND_TYPE_KERNEL;
> options.net_backend = &s->nc;
>
> - if (tap->has_vhostfd || tap->has_vhostfds) {
> + if (vhostfdname) {
> vhostfd = monitor_fd_param(cur_mon, vhostfdname, &err);
> if (vhostfd == -1) {
> error_propagate(errp, err);
> @@ -684,7 +684,7 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
> "vhost-net requested but could not be initialized");
> return;
> }
> - } else if (tap->has_vhostfd || tap->has_vhostfds) {
> + } else if (vhostfdname) {
> error_setg(errp, "vhostfd= is not valid without vhost");
> }
> }
Applied to -net.
Thanks
prev parent reply other threads:[~2016-02-26 7:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-25 23:05 [Qemu-devel] [PATCH] net: simplify net_init_tap_one logic Paolo Bonzini
2016-02-26 7:13 ` Jason Wang [this message]
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=56CFFB1A.8060006@redhat.com \
--to=jasowang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.