From patchwork Mon Sep 21 19:19:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kirillov X-Patchwork-Id: 1368585 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=yandex-team.ru Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=yandex-team.ru header.i=@yandex-team.ru header.a=rsa-sha256 header.s=default header.b=V1jN7B0r; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BwDsP4dmdz9sSt for ; Tue, 22 Sep 2020 05:24:41 +1000 (AEST) Received: from localhost ([::1]:58128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKRQV-00067u-Jv for incoming@patchwork.ozlabs.org; Mon, 21 Sep 2020 15:24:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKRLn-0001Hq-0T for qemu-devel@nongnu.org; Mon, 21 Sep 2020 15:19:47 -0400 Received: from forwardcorp1p.mail.yandex.net ([77.88.29.217]:41404) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKRLk-0004JF-L8 for qemu-devel@nongnu.org; Mon, 21 Sep 2020 15:19:46 -0400 Received: from myt5-23f0be3aa648.qloud-c.yandex.net (myt5-23f0be3aa648.qloud-c.yandex.net [IPv6:2a02:6b8:c12:3e29:0:640:23f0:be3a]) by forwardcorp1p.mail.yandex.net (Yandex) with ESMTP id 292B72E14E1; Mon, 21 Sep 2020 22:19:43 +0300 (MSK) Received: from myt4-18a966dbd9be.qloud-c.yandex.net (myt4-18a966dbd9be.qloud-c.yandex.net [2a02:6b8:c00:12ad:0:640:18a9:66db]) by myt5-23f0be3aa648.qloud-c.yandex.net (mxbackcorp/Yandex) with ESMTP id dI8rFvvPG5-JgvCKApk; Mon, 21 Sep 2020 22:19:43 +0300 Precedence: bulk DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.ru; s=default; t=1600715983; bh=WFJLvqX8TUNu1sfn9jKTRRAyaDexk9ohQ7ylomNphqU=; h=In-Reply-To:Message-Id:References:Date:Subject:To:From:Cc; b=V1jN7B0rre54dbnFS4oYmLghsh/5zf8CyLgDt4lpYDZkwsMlhig82KQfN8/EncfJt NY4Ara9oDrbfcs4mUrMf71JTCte68/bTV/dUomJnStKvFXp7d/QakZKnD2cVoX5pu9 AjdUOnrOmkhYnHJaIhFSW/e/3y5KwLV5suvvG8yo= Authentication-Results: myt5-23f0be3aa648.qloud-c.yandex.net; dkim=pass header.i=@yandex-team.ru Received: from dynamic-vpn.dhcp.yndx.net (dynamic-vpn.dhcp.yndx.net [2a02:6b8:b080:6416::1:4]) by myt4-18a966dbd9be.qloud-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id 3Nc4XKVFl3-Jgl4SIpg; Mon, 21 Sep 2020 22:19:42 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) From: Alexey Kirillov To: Eric Blake , Markus Armbruster , Thomas Huth , Jason Wang Subject: [PATCH v4 4/4] net: Do not use legacy info_str for backends Date: Mon, 21 Sep 2020 22:19:12 +0300 Message-Id: <20200921191912.105305-5-lekiravi@yandex-team.ru> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200921191912.105305-1-lekiravi@yandex-team.ru> References: <20200921191912.105305-1-lekiravi@yandex-team.ru> MIME-Version: 1.0 Received-SPF: pass client-ip=77.88.29.217; envelope-from=lekiravi@yandex-team.ru; helo=forwardcorp1p.mail.yandex.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/21 15:19:28 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , "Michael S. Tsirkin" , Stefan Weil , qemu-devel@nongnu.org, Vincenzo Maffione , yc-core@yandex-team.ru, Paolo Bonzini , Samuel Thibault , Giuseppe Lettieri , Luigi Rizzo Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" As we use QMP query-netdev to store and get information about backend network devices, we can drop usage legacy field info_str for them. We still use this field for NIC and hubports, so we can not completely remove it. Signed-off-by: Alexey Kirillov --- net/l2tpv3.c | 2 -- net/slirp.c | 4 ---- net/socket.c | 22 ---------------------- net/tap-win32.c | 3 --- net/tap.c | 12 ------------ net/vde.c | 3 --- net/vhost-user.c | 2 -- net/vhost-vdpa.c | 1 - 8 files changed, 49 deletions(-) diff --git a/net/l2tpv3.c b/net/l2tpv3.c index 881fc6f7c1..7f2a590155 100644 --- a/net/l2tpv3.c +++ b/net/l2tpv3.c @@ -745,8 +745,6 @@ int net_init_l2tpv3(const Netdev *netdev, stored->dstport = g_strdup(l2tpv3->dstport); } - snprintf(s->nc.info_str, sizeof(s->nc.info_str), - "l2tpv3: connected"); return 0; outerr: qemu_del_net_client(nc); diff --git a/net/slirp.c b/net/slirp.c index 65d3f2639c..14fa64227d 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -670,10 +670,6 @@ static int net_slirp_init(NetClientState *peer, const char *model, stored->tftp_server_name = g_strdup(tftp_server_name); } - snprintf(nc->info_str, sizeof(nc->info_str), - "net=%s,restrict=%s", inet_ntoa(net), - restricted ? "on" : "off"); - s = DO_UPCAST(SlirpState, nc, nc); s->slirp = slirp_init(restricted, ipv4, net, mask, host, diff --git a/net/socket.c b/net/socket.c index b70bd2df94..63d9632603 100644 --- a/net/socket.c +++ b/net/socket.c @@ -180,7 +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; - memset(s->nc.info_str, 0, sizeof(s->nc.info_str)); return; } @@ -400,16 +399,10 @@ static NetSocketState *net_socket_fd_init_dgram(NetClientState *peer, stored->mcast = g_strdup(mcast); s->dgram_dst = saddr; - snprintf(nc->info_str, sizeof(nc->info_str), - "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; } - - snprintf(nc->info_str, sizeof(nc->info_str), - "socket: fd=%d %s", fd, SocketAddressType_str(sa_type)); } return s; @@ -444,8 +437,6 @@ static NetSocketState *net_socket_fd_init_stream(NetClientState *peer, nc = qemu_new_net_client(&net_socket_info, peer, model, name); - snprintf(nc->info_str, sizeof(nc->info_str), "socket: fd=%d", fd); - s = DO_UPCAST(NetSocketState, nc, nc); s->fd = fd; @@ -527,10 +518,6 @@ static void net_socket_accept(void *opaque) 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)); } static int net_socket_listen_init(NetClientState *peer, @@ -645,9 +632,6 @@ static int net_socket_connect_init(NetClientState *peer, 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)); return 0; } @@ -704,9 +688,6 @@ static int net_socket_mcast_init(NetClientState *peer, 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)); return 0; } @@ -769,9 +750,6 @@ static int net_socket_udp_init(NetClientState *peer, 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)); return 0; } diff --git a/net/tap-win32.c b/net/tap-win32.c index b60933bd1a..21e451107b 100644 --- a/net/tap-win32.c +++ b/net/tap-win32.c @@ -787,9 +787,6 @@ static int tap_win32_init(NetClientState *peer, const char *model, stored->has_ifname = true; stored->ifname = g_strdup(ifname); - snprintf(s->nc.info_str, sizeof(s->nc.info_str), - "tap: ifname=%s", ifname); - s->handle = handle; qemu_add_wait_object(s->handle->tap_semaphore, tap_win32_send, s); diff --git a/net/tap.c b/net/tap.c index 14bdd92a9a..588479b3f5 100644 --- a/net/tap.c +++ b/net/tap.c @@ -621,9 +621,6 @@ int net_init_bridge(const Netdev *netdev, const char *name, stored->helper = g_strdup(helper); } - snprintf(s->nc.info_str, sizeof(s->nc.info_str), "helper=%s,br=%s", helper, - br); - return 0; } @@ -709,8 +706,6 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer, stored->fds = g_strdup_printf("%s:%d", stored->fds, fd); g_free(tmp_s); } - - snprintf(s->nc.info_str, sizeof(s->nc.info_str), "fd=%d", fd); } else if (tap->has_helper) { if (!stored->has_helper) { stored->has_helper = true; @@ -722,9 +717,6 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer, stored->br = tap->has_br ? g_strdup(tap->br) : g_strdup(DEFAULT_BRIDGE_INTERFACE); } - - snprintf(s->nc.info_str, sizeof(s->nc.info_str), "helper=%s", - tap->helper); } else { if (ifname && !stored->has_ifname) { stored->has_ifname = true; @@ -741,10 +733,6 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer, stored->downscript = g_strdup(downscript); } - snprintf(s->nc.info_str, sizeof(s->nc.info_str), - "ifname=%s,script=%s,downscript=%s", ifname, script, - downscript); - if (strcmp(downscript, "no") != 0) { snprintf(s->down_script, sizeof(s->down_script), "%s", downscript); snprintf(s->down_script_arg, sizeof(s->down_script_arg), diff --git a/net/vde.c b/net/vde.c index 041eadbcf9..bda8444d1a 100644 --- a/net/vde.c +++ b/net/vde.c @@ -100,9 +100,6 @@ static int net_vde_init(NetClientState *peer, const char *model, nc = qemu_new_net_client(&net_vde_info, peer, model, name); - snprintf(nc->info_str, sizeof(nc->info_str), "sock=%s,fd=%d", - sock, vde_datafd(vde)); - s = DO_UPCAST(VDEState, nc, nc); s->vde = vde; diff --git a/net/vhost-user.c b/net/vhost-user.c index c69592c518..56873a753d 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -323,8 +323,6 @@ static int net_vhost_user_init(NetClientState *peer, const char *device, user = g_new0(struct VhostUserState, 1); for (i = 0; i < queues; i++) { nc = qemu_new_net_client(&net_vhost_user_info, peer, device, name); - snprintf(nc->info_str, sizeof(nc->info_str), "vhost-user%d to %s", - i, chr->label); nc->queue_index = i; if (!nc0) { nc0 = nc; diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index cffd7850ab..e71c2ec5b3 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -195,7 +195,6 @@ static int net_vhost_vdpa_init(NetClientState *peer, const char *device, stored->has_queues = true; stored->queues = 1; /* TODO: change when support multiqueue */ - snprintf(nc->info_str, sizeof(nc->info_str), TYPE_VHOST_VDPA); nc->queue_index = 0; s = DO_UPCAST(VhostVDPAState, nc, nc); vdpa_device_fd = qemu_open_old(vhostdev, O_RDWR);