aboutsummaryrefslogtreecommitdiff
path: root/net/socket.c
diff options
context:
space:
mode:
authorAlexey Kirillov <lekiravi@yandex-team.ru>2021-03-03 12:59:10 +0300
committerJason Wang <jasowang@redhat.com>2021-03-15 16:41:22 +0800
commitf2e8319d456724c3d8514d943dc4607e2f08e88a (patch)
treeb8214d1f736513eb2531769571bd409eef1339b4 /net/socket.c
parenta0724776c5a98a08fc946bb5a4ad16410ca64c0e (diff)
downloadqemu-f2e8319d456724c3d8514d943dc4607e2f08e88a.zip
qemu-f2e8319d456724c3d8514d943dc4607e2f08e88a.tar.gz
qemu-f2e8319d456724c3d8514d943dc4607e2f08e88a.tar.bz2
net: Do not fill legacy info_str for backends
As we use QAPI NetClientState->stored_config to store and get information about backend network devices, we can drop fill of legacy field info_str for them. We still use info_str field for NIC and hubports, so we can not completely remove it. Signed-off-by: Alexey Kirillov <lekiravi@yandex-team.ru> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c28
1 files changed, 0 insertions, 28 deletions
diff --git a/net/socket.c b/net/socket.c
index 9817234..c0de10c 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -180,8 +180,6 @@ static void net_socket_send(void *opaque)
s->fd = -1;
net_socket_rs_init(&s->rs, net_socket_rs_finalize, false);
s->nc.link_down = true;
- g_free(s->nc.info_str);
- s->nc.info_str = g_new0(char, 1);
return;
}
@@ -401,16 +399,10 @@ static NetSocketState *net_socket_fd_init_dgram(NetClientState *peer,
stored->mcast = g_strdup(mcast);
s->dgram_dst = saddr;
- nc->info_str = g_strdup_printf("socket: fd=%d (cloned mcast=%s:%d)",
- fd, inet_ntoa(saddr.sin_addr),
- ntohs(saddr.sin_port));
} else {
if (sa_type == SOCKET_ADDRESS_TYPE_UNIX) {
s->dgram_dst.sin_family = AF_UNIX;
}
-
- nc->info_str = g_strdup_printf("socket: fd=%d %s",
- fd, SocketAddressType_str(sa_type));
}
return s;
@@ -445,8 +437,6 @@ static NetSocketState *net_socket_fd_init_stream(NetClientState *peer,
nc = qemu_new_net_client(&net_socket_info, peer, model, name);
- nc->info_str = g_strdup_printf("socket: fd=%d", fd);
-
s = DO_UPCAST(NetSocketState, nc, nc);
s->fd = fd;
@@ -528,11 +518,6 @@ static void net_socket_accept(void *opaque)
stored->has_fd = true;
stored->fd = g_strdup_printf("%d", fd);
-
- g_free(s->nc.info_str);
- s->nc.info_str = g_strdup_printf("socket: connection from %s:%d",
- inet_ntoa(saddr.sin_addr),
- ntohs(saddr.sin_port));
}
static int net_socket_listen_init(NetClientState *peer,
@@ -647,10 +632,6 @@ static int net_socket_connect_init(NetClientState *peer,
stored->has_connect = true;
stored->connect = g_strdup(host_str);
- g_free(s->nc.info_str);
- s->nc.info_str = g_strdup_printf("socket: connect to %s:%d",
- inet_ntoa(saddr.sin_addr),
- ntohs(saddr.sin_port));
return 0;
}
@@ -707,12 +688,7 @@ static int net_socket_mcast_init(NetClientState *peer,
stored->localaddr = g_strdup(localaddr_str);
}
- g_free(s->nc.info_str);
- s->nc.info_str = g_strdup_printf("socket: mcast=%s:%d",
- inet_ntoa(saddr.sin_addr),
- ntohs(saddr.sin_port));
return 0;
-
}
static int net_socket_udp_init(NetClientState *peer,
@@ -773,10 +749,6 @@ static int net_socket_udp_init(NetClientState *peer,
stored->has_udp = true;
stored->udp = g_strdup(rhost);
- g_free(s->nc.info_str);
- s->nc.info_str = g_strdup_printf("socket: udp=%s:%d",
- inet_ntoa(raddr.sin_addr),
- ntohs(raddr.sin_port));
return 0;
}