From nobody Fri Apr 11 23:12:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615800745; cv=none; d=zohomail.com; s=zohoarc; b=LpLI8CSfY+ZE3uTfruLI5QP//F+pfsgTzl8Cvh269lW53XD9pR7a0rE1v6AAGDtvjY6tIRhxM6mL1d0G98Bft0o/DudwFAq1heHA774PrCLOaYcgImm2WBqJwzaeFRtxPjl5/Z7UjaIffBokR2v6Rlka8rmgT/htXsxYNilMnvw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615800745; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=E+VgJlvCIJSqdxoF3v8V8EV1mu/+683LeE+XvfdyiPg=; b=SSwGhk6GCOtp/RWFt0GVIfxpIaM1//WnZm5dTV+3Bpsdx9lTfac590DkN5RDMu/ywW+6gmsnAlKJ6HyuQqwYuUBZrKRF/1qdLBqfgcKOse3Be8KlwIL/uRs5Fr75LGgl59NM9IFWQXKRpJbGhb5IlmDhTHQY+9mF51ocQyHFbog= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1615800745412480.9573554746371; Mon, 15 Mar 2021 02:32:25 -0700 (PDT) Received: from localhost ([::1]:46828 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLjaK-0003Qc-7B for importer@patchew.org; Mon, 15 Mar 2021 05:32:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLjKa-0000Rx-0U for qemu-devel@nongnu.org; Mon, 15 Mar 2021 05:16:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51159) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lLjKN-0008F7-1F for qemu-devel@nongnu.org; Mon, 15 Mar 2021 05:16:07 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-585-NZRAedaHNkyNCdVrTpwRAw-1; Mon, 15 Mar 2021 05:15:51 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CCDFE80006E; Mon, 15 Mar 2021 09:15:49 +0000 (UTC) Received: from jason-ThinkPad-T430s.redhat.com (ovpn-13-105.pek2.redhat.com [10.72.13.105]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2D3FF100164C; Mon, 15 Mar 2021 09:15:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615799753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=E+VgJlvCIJSqdxoF3v8V8EV1mu/+683LeE+XvfdyiPg=; b=B9HL72+feZoDh+P5Kqj8A+K9LVWApFI4KjSFM1Ds4Fnt+PUW7GYlXQEMT6ou5+h/+Mdemg SiAUyexYNT8Fcuk3lyhXOC/4ANKuCedVLsOR3eRB/P0fiQKtLozFcZE5XroKmIzx6gqPF/ QSEd7VTEckX1IqYoE9czAqjtL5iV3qk= X-MC-Unique: NZRAedaHNkyNCdVrTpwRAw-1 From: Jason Wang To: peter.maydell@linaro.org Subject: [PULL V2 20/20] net: Do not fill legacy info_str for backends Date: Mon, 15 Mar 2021 17:14:33 +0800 Message-Id: <1615799673-31549-21-git-send-email-jasowang@redhat.com> In-Reply-To: <1615799673-31549-1-git-send-email-jasowang@redhat.com> References: <1615799673-31549-1-git-send-email-jasowang@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jasowang@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kirillov , Jason Wang , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alexey Kirillov 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 Signed-off-by: Jason Wang --- net/l2tpv3.c | 2 -- net/slirp.c | 3 --- net/socket.c | 28 ---------------------------- net/tap-win32.c | 2 -- net/tap.c | 9 --------- net/vde.c | 2 -- net/vhost-user.c | 1 - net/vhost-vdpa.c | 1 - 8 files changed, 48 deletions(-) diff --git a/net/l2tpv3.c b/net/l2tpv3.c index 96611cb..b7e1d84 100644 --- a/net/l2tpv3.c +++ b/net/l2tpv3.c @@ -729,8 +729,6 @@ int net_init_l2tpv3(const Netdev *netdev, =20 QAPI_CLONE_MEMBERS(NetdevL2TPv3Options, &nc->stored_config->u.l2tpv3, l2tpv3); - - s->nc.info_str =3D g_strdup_printf("l2tpv3: connected"); return 0; outerr: qemu_del_net_client(nc); diff --git a/net/slirp.c b/net/slirp.c index bfa07e3..9454a67 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -664,9 +664,6 @@ static int net_slirp_init(NetClientState *peer, const c= har *model, stored->tftp_server_name =3D g_strdup(tftp_server_name); } =20 - nc->info_str =3D g_strdup_printf("net=3D%s,restrict=3D%s", inet_ntoa(n= et), - restricted ? "on" : "off"); - s =3D DO_UPCAST(SlirpState, nc, nc); =20 s->slirp =3D slirp_init(restricted, ipv4, net, mask, host, 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 =3D -1; net_socket_rs_init(&s->rs, net_socket_rs_finalize, false); s->nc.link_down =3D true; - g_free(s->nc.info_str); - s->nc.info_str =3D g_new0(char, 1); =20 return; } @@ -401,16 +399,10 @@ static NetSocketState *net_socket_fd_init_dgram(NetCl= ientState *peer, stored->mcast =3D g_strdup(mcast); =20 s->dgram_dst =3D saddr; - nc->info_str =3D g_strdup_printf("socket: fd=3D%d (cloned mcast=3D= %s:%d)", - fd, inet_ntoa(saddr.sin_addr), - ntohs(saddr.sin_port)); } else { if (sa_type =3D=3D SOCKET_ADDRESS_TYPE_UNIX) { s->dgram_dst.sin_family =3D AF_UNIX; } - - nc->info_str =3D g_strdup_printf("socket: fd=3D%d %s", - fd, SocketAddressType_str(sa_type)); } =20 return s; @@ -445,8 +437,6 @@ static NetSocketState *net_socket_fd_init_stream(NetCli= entState *peer, =20 nc =3D qemu_new_net_client(&net_socket_info, peer, model, name); =20 - nc->info_str =3D g_strdup_printf("socket: fd=3D%d", fd); - s =3D DO_UPCAST(NetSocketState, nc, nc); =20 s->fd =3D fd; @@ -528,11 +518,6 @@ static void net_socket_accept(void *opaque) =20 stored->has_fd =3D true; stored->fd =3D g_strdup_printf("%d", fd); - - g_free(s->nc.info_str); - s->nc.info_str =3D g_strdup_printf("socket: connection from %s:%d", - inet_ntoa(saddr.sin_addr), - ntohs(saddr.sin_port)); } =20 static int net_socket_listen_init(NetClientState *peer, @@ -647,10 +632,6 @@ static int net_socket_connect_init(NetClientState *pee= r, stored->has_connect =3D true; stored->connect =3D g_strdup(host_str); =20 - g_free(s->nc.info_str); - s->nc.info_str =3D g_strdup_printf("socket: connect to %s:%d", - inet_ntoa(saddr.sin_addr), - ntohs(saddr.sin_port)); return 0; } =20 @@ -707,12 +688,7 @@ static int net_socket_mcast_init(NetClientState *peer, stored->localaddr =3D g_strdup(localaddr_str); } =20 - g_free(s->nc.info_str); - s->nc.info_str =3D g_strdup_printf("socket: mcast=3D%s:%d", - inet_ntoa(saddr.sin_addr), - ntohs(saddr.sin_port)); return 0; - } =20 static int net_socket_udp_init(NetClientState *peer, @@ -773,10 +749,6 @@ static int net_socket_udp_init(NetClientState *peer, stored->has_udp =3D true; stored->udp =3D g_strdup(rhost); =20 - g_free(s->nc.info_str); - s->nc.info_str =3D g_strdup_printf("socket: udp=3D%s:%d", - inet_ntoa(raddr.sin_addr), - ntohs(raddr.sin_port)); return 0; } =20 diff --git a/net/tap-win32.c b/net/tap-win32.c index 0888db8..21e4511 100644 --- a/net/tap-win32.c +++ b/net/tap-win32.c @@ -787,8 +787,6 @@ static int tap_win32_init(NetClientState *peer, const c= har *model, stored->has_ifname =3D true; stored->ifname =3D g_strdup(ifname); =20 - s->nc.info_str =3D g_strdup_printf("tap: ifname=3D%s", ifname); - s->handle =3D handle; =20 qemu_add_wait_object(s->handle->tap_semaphore, tap_win32_send, s); diff --git a/net/tap.c b/net/tap.c index f864f43..12a08d5 100644 --- a/net/tap.c +++ b/net/tap.c @@ -625,8 +625,6 @@ int net_init_bridge(const Netdev *netdev, const char *n= ame, stored->helper =3D g_strdup(helper); } =20 - s->nc.info_str =3D g_strdup_printf("helper=3D%s,br=3D%s", helper, br); - return 0; } =20 @@ -712,8 +710,6 @@ static void net_init_tap_one(const NetdevTapOptions *ta= p, NetClientState *peer, stored->fds =3D g_strdup_printf("%s:%d", stored->fds, fd); g_free(tmp_s); } - - s->nc.info_str =3D g_strdup_printf("fd=3D%d", fd); } else if (tap->has_helper) { if (!stored->has_helper) { stored->has_helper =3D true; @@ -725,8 +721,6 @@ static void net_init_tap_one(const NetdevTapOptions *ta= p, NetClientState *peer, stored->br =3D tap->has_br ? g_strdup(tap->br) : g_strdup(DEFAULT_BRIDGE_INTERFACE); } - - s->nc.info_str =3D g_strdup_printf("helper=3D%s", tap->helper); } else { if (ifname && !stored->has_ifname) { stored->has_ifname =3D true; @@ -743,9 +737,6 @@ static void net_init_tap_one(const NetdevTapOptions *ta= p, NetClientState *peer, stored->downscript =3D g_strdup(downscript); } =20 - s->nc.info_str =3D g_strdup_printf("ifname=3D%s,script=3D%s,downsc= ript=3D%s", - ifname, script, downscript); - if (strcmp(downscript, "no") !=3D 0) { snprintf(s->down_script, sizeof(s->down_script), "%s", downscr= ipt); snprintf(s->down_script_arg, sizeof(s->down_script_arg), diff --git a/net/vde.c b/net/vde.c index 67de6eb..64bdb93 100644 --- a/net/vde.c +++ b/net/vde.c @@ -100,8 +100,6 @@ static int net_vde_init(NetClientState *peer, const cha= r *model, =20 nc =3D qemu_new_net_client(&net_vde_info, peer, model, name); =20 - nc->info_str =3D g_strdup_printf("sock=3D%s,fd=3D%d", sock, vde_datafd= (vde)); - s =3D DO_UPCAST(VDEState, nc, nc); =20 s->vde =3D vde; diff --git a/net/vhost-user.c b/net/vhost-user.c index 49c9a74..e443c4b 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -327,7 +327,6 @@ static int net_vhost_user_init(NetClientState *peer, co= nst char *device, user =3D g_new0(struct VhostUserState, 1); for (i =3D 0; i < queues; i++) { nc =3D qemu_new_net_client(&net_vhost_user_info, peer, device, nam= e); - nc->info_str =3D g_strdup_printf("vhost-user%d to %s", i, chr->lab= el); nc->queue_index =3D i; if (!nc0) { nc0 =3D nc; diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index 423d717..5a28bbc 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -200,7 +200,6 @@ static int net_vhost_vdpa_init(NetClientState *peer, co= nst char *device, stored->has_queues =3D true; stored->queues =3D 1; /* TODO: change when support multiqueue */ =20 - nc->info_str =3D g_strdup_printf(TYPE_VHOST_VDPA); nc->queue_index =3D 0; s =3D DO_UPCAST(VhostVDPAState, nc, nc); vdpa_device_fd =3D qemu_open_old(vhostdev, O_RDWR); --=20 2.7.4