diff options
author | Jason Wang <jasowang@redhat.com> | 2021-04-02 11:05:20 +0800 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2021-04-08 17:33:59 +0800 |
commit | f9bb0c1f9862dc959ba84977620fc8267623463e (patch) | |
tree | e709382573ed7ee7851d8e53cd0e318206b34692 /net/socket.c | |
parent | 22317309df52d165c02a20bddfdd710c8deed583 (diff) |
Revert "qapi: net: Add query-netdev command"
Several issues has been reported for query-netdev series. Consider
it's late in the rc, this reverts commit
d32ad10a14d46dfe9304e3ed5858a11dcd5c71a0.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/net/socket.c b/net/socket.c index 1614523b82..15b410e8d8 100644 --- a/net/socket.c +++ b/net/socket.c @@ -342,7 +342,6 @@ static NetSocketState *net_socket_fd_init_dgram(NetClientState *peer, NetSocketState *s; SocketAddress *sa; SocketAddressType sa_type; - NetdevSocketOptions *stored; sa = socket_local_address(fd, errp); if (!sa) { @@ -386,19 +385,8 @@ static NetSocketState *net_socket_fd_init_dgram(NetClientState *peer, net_socket_rs_init(&s->rs, net_socket_rs_finalize, false); net_socket_read_poll(s, true); - /* Store startup parameters */ - nc->stored_config = g_new0(NetdevInfo, 1); - nc->stored_config->type = NET_BACKEND_SOCKET; - stored = &nc->stored_config->u.socket; - - stored->has_fd = true; - stored->fd = g_strdup_printf("%d", fd); - /* mcast: save bound address as dst */ if (is_connected && mcast != NULL) { - stored->has_mcast = true; - stored->mcast = g_strdup(mcast); - s->dgram_dst = saddr; snprintf(nc->info_str, sizeof(nc->info_str), "socket: fd=%d (cloned mcast=%s:%d)", @@ -440,7 +428,6 @@ static NetSocketState *net_socket_fd_init_stream(NetClientState *peer, { NetClientState *nc; NetSocketState *s; - NetdevSocketOptions *stored; nc = qemu_new_net_client(&net_socket_info, peer, model, name); @@ -460,15 +447,6 @@ static NetSocketState *net_socket_fd_init_stream(NetClientState *peer, } else { qemu_set_fd_handler(s->fd, NULL, net_socket_connect, s); } - - /* Store startup parameters */ - nc->stored_config = g_new0(NetdevInfo, 1); - nc->stored_config->type = NET_BACKEND_SOCKET; - stored = &nc->stored_config->u.socket; - - stored->has_fd = true; - stored->fd = g_strdup_printf("%d", fd); - return s; } @@ -505,7 +483,6 @@ static void net_socket_accept(void *opaque) struct sockaddr_in saddr; socklen_t len; int fd; - NetdevSocketOptions *stored; for(;;) { len = sizeof(saddr); @@ -521,13 +498,6 @@ static void net_socket_accept(void *opaque) s->fd = fd; s->nc.link_down = false; net_socket_connect(s); - - /* Store additional startup parameters (extend net_socket_listen_init) */ - stored = &s->nc.stored_config->u.socket; - - stored->has_fd = true; - stored->fd = g_strdup_printf("%d", fd); - snprintf(s->nc.info_str, sizeof(s->nc.info_str), "socket: connection from %s:%d", inet_ntoa(saddr.sin_addr), ntohs(saddr.sin_port)); @@ -543,7 +513,6 @@ static int net_socket_listen_init(NetClientState *peer, NetSocketState *s; struct sockaddr_in saddr; int fd, ret; - NetdevSocketOptions *stored; if (parse_host_port(&saddr, host_str, errp) < 0) { return -1; @@ -580,15 +549,6 @@ static int net_socket_listen_init(NetClientState *peer, net_socket_rs_init(&s->rs, net_socket_rs_finalize, false); qemu_set_fd_handler(s->listen_fd, net_socket_accept, NULL, s); - - /* Store startup parameters */ - nc->stored_config = g_new0(NetdevInfo, 1); - nc->stored_config->type = NET_BACKEND_SOCKET; - stored = &nc->stored_config->u.socket; - - stored->has_listen = true; - stored->listen = g_strdup(host_str); - return 0; } @@ -601,7 +561,6 @@ static int net_socket_connect_init(NetClientState *peer, NetSocketState *s; int fd, connected, ret; struct sockaddr_in saddr; - NetdevSocketOptions *stored; if (parse_host_port(&saddr, host_str, errp) < 0) { return -1; @@ -639,12 +598,6 @@ static int net_socket_connect_init(NetClientState *peer, return -1; } - /* Store additional startup parameters (extend net_socket_fd_init) */ - stored = &s->nc.stored_config->u.socket; - - stored->has_connect = true; - stored->connect = g_strdup(host_str); - snprintf(s->nc.info_str, sizeof(s->nc.info_str), "socket: connect to %s:%d", inet_ntoa(saddr.sin_addr), ntohs(saddr.sin_port)); @@ -662,7 +615,6 @@ static int net_socket_mcast_init(NetClientState *peer, int fd; struct sockaddr_in saddr; struct in_addr localaddr, *param_localaddr; - NetdevSocketOptions *stored; if (parse_host_port(&saddr, host_str, errp) < 0) { return -1; @@ -691,19 +643,6 @@ static int net_socket_mcast_init(NetClientState *peer, s->dgram_dst = saddr; - /* Store additional startup parameters (extend net_socket_fd_init) */ - stored = &s->nc.stored_config->u.socket; - - if (!stored->has_mcast) { - stored->has_mcast = true; - stored->mcast = g_strdup(host_str); - } - - if (localaddr_str) { - stored->has_localaddr = true; - stored->localaddr = g_strdup(localaddr_str); - } - snprintf(s->nc.info_str, sizeof(s->nc.info_str), "socket: mcast=%s:%d", inet_ntoa(saddr.sin_addr), ntohs(saddr.sin_port)); @@ -721,7 +660,6 @@ static int net_socket_udp_init(NetClientState *peer, NetSocketState *s; int fd, ret; struct sockaddr_in laddr, raddr; - NetdevSocketOptions *stored; if (parse_host_port(&laddr, lhost, errp) < 0) { return -1; @@ -760,15 +698,6 @@ static int net_socket_udp_init(NetClientState *peer, s->dgram_dst = raddr; - /* Store additional startup parameters (extend net_socket_fd_init) */ - stored = &s->nc.stored_config->u.socket; - - stored->has_localaddr = true; - stored->localaddr = g_strdup(lhost); - - stored->has_udp = true; - stored->udp = g_strdup(rhost); - snprintf(s->nc.info_str, sizeof(s->nc.info_str), "socket: udp=%s:%d", inet_ntoa(raddr.sin_addr), ntohs(raddr.sin_port)); |