From nobody Sun May 5 20:00:25 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1575542489; cv=none; d=zohomail.com; s=zohoarc; b=QYRYEo4mp2DmtKj4wT8PmerP1iRoZiUPJgRrP2+/uoRUafY0EJx5rB5q9OLKqJFhfXw5PDyM9MyhTZ5qyS1XxGsImZ2lz1bD90ccSKg+fHXOfcgAHsT8jsYDg80AMkupNxuY8njo7h41Uki3BcrqWo1EI4b9J6tnW7LSjmLwFu8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575542489; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=fPEqYwRDD7P6d99Jsb5C+qMy2KAJfHl5romJBYWBDx8=; b=OA5TEELMI2B1cQXDY9Pjq+vh7P0MmK3yn31JRBe9S+y54HbO6IdAmtZJm73OEHT0yYrQMiekqm+ftPPTi/cFJ+jrkJHVWCgfqQi7MFdw/LvsxZaIf9ClplgLWDi0S0TjlNxfV8pvYbhC7iGS1ow9j2pW/61sgwilj2tn5ZhQdns= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1575542489082699.4500801166071; Thu, 5 Dec 2019 02:41:29 -0800 (PST) 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-292-rpG6N6muOuij4kw5tlN7mQ-1; Thu, 05 Dec 2019 05:41:26 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E0108801E76; Thu, 5 Dec 2019 10:41:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6812960179; Thu, 5 Dec 2019 10:41:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8C35E18089CF; Thu, 5 Dec 2019 10:41:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xB5AfHE9006321 for ; Thu, 5 Dec 2019 05:41:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id A98216CE40; Thu, 5 Dec 2019 10:41:17 +0000 (UTC) Received: from thuth.com (ovpn-116-87.ams2.redhat.com [10.36.116.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01D6168424; Thu, 5 Dec 2019 10:41:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575542487; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=fPEqYwRDD7P6d99Jsb5C+qMy2KAJfHl5romJBYWBDx8=; b=UCzv/YqCyLymoRpeo1ClWA55rjE4INuSYT7iEkM/Re5S/8WRz5eAWKfQCa7Mh65PuTp14C NLsxOM4GqFDyPt4qSACFNdruIJia0prYE7DWDxVIJ7W/yMDvsd1/1Ne/CjQb89CArKZU1r riCvRUzgiYGMLVrjD8XDsODNryRYhm0= From: Thomas Huth To: qemu-devel@nongnu.org, Jason Wang Date: Thu, 5 Dec 2019 11:41:09 +0100 Message-Id: <20191205104109.18680-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, Samuel Thibault , "Dr. David Alan Gilbert" Subject: [libvirt] [PATCH] net: Remove deprecated [hub_id name] tuple of 'hostfwd_add' / 'hostfwd_remove' X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: rpG6N6muOuij4kw5tlN7mQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" It's been deprecated since QEMU v3.1.0. Time to finally remove it now. Signed-off-by: Thomas Huth Acked-by: Dr. David Alan Gilbert --- hmp-commands.hx | 8 ++++---- net/hub.c | 23 ----------------------- net/hub.h | 2 -- net/slirp.c | 44 ++++++++++++-------------------------------- qemu-deprecated.texi | 13 ++++++++----- 5 files changed, 24 insertions(+), 66 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index cfcc044ce4..14ccc685d7 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1463,8 +1463,8 @@ ETEXI #ifdef CONFIG_SLIRP { .name =3D "hostfwd_add", - .args_type =3D "arg1:s,arg2:s?,arg3:s?", - .params =3D "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:ho= stport-[guestaddr]:guestport", + .args_type =3D "arg1:s,arg2:s?", + .params =3D "[netdev_id] [tcp|udp]:[hostaddr]:hostport-[guesta= ddr]:guestport", .help =3D "redirect TCP or UDP connections from host to gues= t (requires -net user)", .cmd =3D hmp_hostfwd_add, }, @@ -1478,8 +1478,8 @@ ETEXI #ifdef CONFIG_SLIRP { .name =3D "hostfwd_remove", - .args_type =3D "arg1:s,arg2:s?,arg3:s?", - .params =3D "[hub_id name]|[netdev_id] [tcp|udp]:[hostaddr]:ho= stport", + .args_type =3D "arg1:s,arg2:s?", + .params =3D "[netdev_id] [tcp|udp]:[hostaddr]:hostport", .help =3D "remove host-to-guest TCP or UDP redirection", .cmd =3D hmp_hostfwd_remove, }, diff --git a/net/hub.c b/net/hub.c index 5795a678ed..88cfb876f3 100644 --- a/net/hub.c +++ b/net/hub.c @@ -193,29 +193,6 @@ NetClientState *net_hub_add_port(int hub_id, const cha= r *name, return &port->nc; } =20 -/** - * Find a specific client on a hub - */ -NetClientState *net_hub_find_client_by_name(int hub_id, const char *name) -{ - NetHub *hub; - NetHubPort *port; - NetClientState *peer; - - QLIST_FOREACH(hub, &hubs, next) { - if (hub->id =3D=3D hub_id) { - QLIST_FOREACH(port, &hub->ports, next) { - peer =3D port->nc.peer; - - if (peer && strcmp(peer->name, name) =3D=3D 0) { - return peer; - } - } - } - } - return NULL; -} - /** * Find a available port on a hub; otherwise create one new port */ diff --git a/net/hub.h b/net/hub.h index 66d3322fac..ce45f7b399 100644 --- a/net/hub.h +++ b/net/hub.h @@ -15,10 +15,8 @@ #ifndef NET_HUB_H #define NET_HUB_H =20 - NetClientState *net_hub_add_port(int hub_id, const char *name, NetClientState *hubpeer); -NetClientState *net_hub_find_client_by_name(int hub_id, const char *name); void net_hub_info(Monitor *mon); void net_hub_check_clients(void); bool net_hub_flush(NetClientState *nc); diff --git a/net/slirp.c b/net/slirp.c index c4334ee876..77042e6df7 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -610,25 +610,13 @@ error: return -1; } =20 -static SlirpState *slirp_lookup(Monitor *mon, const char *hub_id, - const char *name) +static SlirpState *slirp_lookup(Monitor *mon, const char *id) { - if (name) { - NetClientState *nc; - if (hub_id) { - nc =3D net_hub_find_client_by_name(strtol(hub_id, NULL, 0), na= me); - if (!nc) { - monitor_printf(mon, "unrecognized (hub-id, stackname) pair= \n"); - return NULL; - } - warn_report("Using 'hub-id' is deprecated, specify the netdev = id " - "directly instead"); - } else { - nc =3D qemu_find_netdev(name); - if (!nc) { - monitor_printf(mon, "unrecognized netdev id '%s'\n", name); - return NULL; - } + if (id) { + NetClientState *nc =3D qemu_find_netdev(id); + if (!nc) { + monitor_printf(mon, "unrecognized netdev id '%s'\n", id); + return NULL; } if (strcmp(nc->model, "user")) { monitor_printf(mon, "invalid device specified\n"); @@ -655,16 +643,12 @@ void hmp_hostfwd_remove(Monitor *mon, const QDict *qd= ict) int err; const char *arg1 =3D qdict_get_str(qdict, "arg1"); const char *arg2 =3D qdict_get_try_str(qdict, "arg2"); - const char *arg3 =3D qdict_get_try_str(qdict, "arg3"); =20 - if (arg3) { - s =3D slirp_lookup(mon, arg1, arg2); - src_str =3D arg3; - } else if (arg2) { - s =3D slirp_lookup(mon, NULL, arg1); + if (arg2) { + s =3D slirp_lookup(mon, arg1); src_str =3D arg2; } else { - s =3D slirp_lookup(mon, NULL, NULL); + s =3D slirp_lookup(mon, NULL); src_str =3D arg1; } if (!s) { @@ -784,16 +768,12 @@ void hmp_hostfwd_add(Monitor *mon, const QDict *qdict) SlirpState *s; const char *arg1 =3D qdict_get_str(qdict, "arg1"); const char *arg2 =3D qdict_get_try_str(qdict, "arg2"); - const char *arg3 =3D qdict_get_try_str(qdict, "arg3"); =20 - if (arg3) { - s =3D slirp_lookup(mon, arg1, arg2); - redir_str =3D arg3; - } else if (arg2) { - s =3D slirp_lookup(mon, NULL, arg1); + if (arg2) { + s =3D slirp_lookup(mon, arg1); redir_str =3D arg2; } else { - s =3D slirp_lookup(mon, NULL, NULL); + s =3D slirp_lookup(mon, NULL); redir_str =3D arg1; } if (s) { diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 66d2b22a94..e407cc085e 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -206,11 +206,6 @@ the 'wait' field, which is only applicable to sockets = in server mode =20 @section Human Monitor Protocol (HMP) commands =20 -@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (sinc= e 3.1) - -The @option{[hub_id name]} parameter tuple of the 'hostfwd_add' and -'hostfwd_remove' HMP commands has been replaced by @option{netdev_id}. - @subsection cpu-add (since 4.0) =20 Use ``device_add'' for hotplugging vCPUs instead of ``cpu-add''. See @@ -376,6 +371,14 @@ What follows is a record of recently removed, formerly= deprecated features that serves as a record for users who have encountered trouble after a recent upgrade. =20 +@section Human Monitor Protocol (HMP) commands + +@subsection The hub_id parameter of 'hostfwd_add' / 'hostfwd_remove' (remo= ved in 5.0) + +The @option{[hub_id name]} parameter tuple of the 'hostfwd_add' and +'hostfwd_remove' HMP commands has been replaced by the single option +@option{netdev_id}. + @section QEMU Machine Protocol (QMP) commands =20 @subsection block-dirty-bitmap-add "autoload" parameter (since 4.2.0) --=20 2.18.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list