[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/17] tap: net_tap_fd_init() can't fail, drop dead e
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 06/17] tap: net_tap_fd_init() can't fail, drop dead error handling |
Date: |
Wed, 27 May 2015 11:02:57 +0100 |
From: Markus Armbruster <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
net/tap.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/net/tap.c b/net/tap.c
index 8f06cb7..adb1022 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -536,7 +536,6 @@ int net_init_bridge(const NetClientOptions *opts, const
char *name,
/* FIXME error_setg(errp, ...) on failure */
const NetdevBridgeOptions *bridge;
const char *helper, *br;
-
TAPState *s;
int fd, vnet_hdr;
@@ -552,14 +551,8 @@ int net_init_bridge(const NetClientOptions *opts, const
char *name,
}
fcntl(fd, F_SETFL, O_NONBLOCK);
-
vnet_hdr = tap_probe_vnet_hdr(fd);
-
s = net_tap_fd_init(peer, "bridge", name, fd, vnet_hdr);
- if (!s) {
- close(fd);
- return -1;
- }
snprintf(s->nc.info_str, sizeof(s->nc.info_str), "helper=%s,br=%s", helper,
br);
@@ -607,14 +600,9 @@ static int net_init_tap_one(const NetdevTapOptions *tap,
NetClientState *peer,
int vnet_hdr, int fd)
{
Error *err = NULL;
- TAPState *s;
+ TAPState *s = net_tap_fd_init(peer, model, name, fd, vnet_hdr);
int vhostfd;
- s = net_tap_fd_init(peer, model, name, fd, vnet_hdr);
- if (!s) {
- return -1;
- }
-
if (tap_set_sndbuf(s->fd, tap) < 0) {
return -1;
}
--
2.4.1
- [Qemu-devel] [PULL 00/17] Net patches, Stefan Hajnoczi, 2015/05/27
- [Qemu-devel] [PULL 01/17] net: Change help text to list -netdev instead of -net by default, Stefan Hajnoczi, 2015/05/27
- [Qemu-devel] [PULL 02/17] net: Improve error message for -net hubport a bit, Stefan Hajnoczi, 2015/05/27
- [Qemu-devel] [PULL 04/17] net: Improve -net nic error reporting, Stefan Hajnoczi, 2015/05/27
- [Qemu-devel] [PULL 05/17] net/dump: Improve -net/host_net_add dump error reporting, Stefan Hajnoczi, 2015/05/27
- [Qemu-devel] [PULL 03/17] net: Permit incremental conversion of init functions to Error, Stefan Hajnoczi, 2015/05/27
- [Qemu-devel] [PULL 06/17] tap: net_tap_fd_init() can't fail, drop dead error handling,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 07/17] tap: Improve -netdev/netdev_add/-net/... bridge error reporting, Stefan Hajnoczi, 2015/05/27
- [Qemu-devel] [PULL 10/17] tap: Convert launch_script() to Error, Stefan Hajnoczi, 2015/05/27
- [Qemu-devel] [PULL 09/17] tap: Convert net_init_tap_one() to Error, Stefan Hajnoczi, 2015/05/27
- [Qemu-devel] [PULL 08/17] tap: Convert tap_set_sndbuf() to Error, Stefan Hajnoczi, 2015/05/27
- [Qemu-devel] [PULL 11/17] tap: Permit incremental conversion of tap_open() to Error, Stefan Hajnoczi, 2015/05/27
- [Qemu-devel] [PULL 12/17] tap-linux: Convert tap_open() to Error, Stefan Hajnoczi, 2015/05/27
- [Qemu-devel] [PULL 13/17] tap-bsd: Convert tap_open() to Error, Stefan Hajnoczi, 2015/05/27
- [Qemu-devel] [PULL 15/17] tap: Finish conversion of tap_open() to Error, Stefan Hajnoczi, 2015/05/27
- [Qemu-devel] [PULL 14/17] tap-solaris: Convert tap_open() to Error, Stefan Hajnoczi, 2015/05/27
- [Qemu-devel] [PULL 16/17] tap: Improve -netdev/netdev_add/-net/... tap error reporting, Stefan Hajnoczi, 2015/05/27