aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-06-15 11:41:44 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-06-15 11:41:44 +0100
commit91fe7a376ad46e3cc5e82d418aad22173c948a3c (patch)
tree076c5367d214228c7344bd08cf16e5aa3fb1ad4d /net
parent409c241f887a38bb7a2ac12e34d3a8d73922a9a5 (diff)
parentc67daf4a24442d1bb404a11a6a54dc45ea10f234 (diff)
Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging
# gpg: Signature made Fri 15 Jun 2018 03:47:09 BST # gpg: using RSA key EF04965B398D6211 # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 215D 46F4 8246 689E C77F 3562 EF04 965B 398D 6211 * remotes/jasowang/tags/net-pull-request: vhost-user: delete net client if necessary e1000e: Do not auto-clear ICR bits which aren't set in EIAC net: Fix a potential segfault tap: set vhostfd passed from qemu cli to non-blocking Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'net')
-rw-r--r--net/net.c4
-rw-r--r--net/tap.c2
-rw-r--r--net/vhost-user.c3
3 files changed, 8 insertions, 1 deletions
diff --git a/net/net.c b/net/net.c
index efb9eaf779..2a3133990c 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1093,7 +1093,9 @@ static int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp)
int ret = -1;
Visitor *v = opts_visitor_new(opts);
- if (is_netdev && is_help_option(qemu_opt_get(opts, "type"))) {
+ const char *type = qemu_opt_get(opts, "type");
+
+ if (is_netdev && type && is_help_option(type)) {
show_netdevs();
exit(0);
} else {
diff --git a/net/tap.c b/net/tap.c
index de05f20e28..2126f4882d 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -40,6 +40,7 @@
#include "qemu-common.h"
#include "qemu/cutils.h"
#include "qemu/error-report.h"
+#include "qemu/sockets.h"
#include "net/tap.h"
@@ -693,6 +694,7 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
}
return;
}
+ qemu_set_nonblock(vhostfd);
} else {
vhostfd = open("/dev/vhost-net", O_RDWR);
if (vhostfd < 0) {
diff --git a/net/vhost-user.c b/net/vhost-user.c
index 608b837175..a39f9c9974 100644
--- a/net/vhost-user.c
+++ b/net/vhost-user.c
@@ -345,6 +345,9 @@ err:
s->vhost_user = NULL;
}
}
+ if (nc0) {
+ qemu_del_net_client(nc0);
+ }
return -1;
}