From nobody Mon Apr 29 03:41:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494855279224296.5301418043224; Mon, 15 May 2017 06:34:39 -0700 (PDT) Received: from localhost ([::1]:36932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dAG8x-0007OG-TL for importer@patchew.org; Mon, 15 May 2017 09:34:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43513) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dAG7T-0006iz-Sa for qemu-devel@nongnu.org; Mon, 15 May 2017 09:33:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dAG7Q-00048i-OM for qemu-devel@nongnu.org; Mon, 15 May 2017 09:33:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47322) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dAG7Q-00048H-G6 for qemu-devel@nongnu.org; Mon, 15 May 2017 09:33:00 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id C2DEB3DBD6 for ; Mon, 15 May 2017 13:32:58 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-247.ams2.redhat.com [10.36.116.247]) by smtp.corp.redhat.com (Postfix) with ESMTP id A80EE18A6C; Mon, 15 May 2017 13:32:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C2DEB3DBD6 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=thuth@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C2DEB3DBD6 From: Thomas Huth To: qemu-devel@nongnu.org Date: Mon, 15 May 2017 15:32:56 +0200 Message-Id: <1494855176-11127-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 15 May 2017 13:32:58 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] hmp / net: Mark host_net_add/remove as deprecated X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jason Wang , dgilbert@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The netdev_add and netdev_del commands should be used nowadays instead. Signed-off-by: Thomas Huth --- hmp-commands.hx | 8 ++++---- net/net.c | 13 +++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 0aca984..baeac47 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -1296,7 +1296,7 @@ ETEXI .name =3D "host_net_add", .args_type =3D "device:s,opts:s?", .params =3D "tap|user|socket|vde|netmap|bridge|vhost-user|dump= [options]", - .help =3D "add host VLAN client", + .help =3D "add host VLAN client (deprecated, use netdev_add = instead)", .cmd =3D hmp_host_net_add, .command_completion =3D host_net_add_completion, }, @@ -1304,14 +1304,14 @@ ETEXI STEXI @item host_net_add @findex host_net_add -Add host VLAN client. +Add host VLAN client. Deprecated, please use @code{netdev_add} instead. ETEXI =20 { .name =3D "host_net_remove", .args_type =3D "vlan_id:i,device:s", .params =3D "vlan_id name", - .help =3D "remove host VLAN client", + .help =3D "remove host VLAN client (deprecated, use netdev_d= el instead)", .cmd =3D hmp_host_net_remove, .command_completion =3D host_net_remove_completion, }, @@ -1319,7 +1319,7 @@ ETEXI STEXI @item host_net_remove @findex host_net_remove -Remove host VLAN client. +Remove host VLAN client. Deprecated, please use @code{netdev_del} instead. ETEXI =20 { diff --git a/net/net.c b/net/net.c index 0ac3b9e..6235aab 100644 --- a/net/net.c +++ b/net/net.c @@ -45,6 +45,7 @@ #include "qapi-visit.h" #include "qapi/opts-visitor.h" #include "sysemu/sysemu.h" +#include "sysemu/qtest.h" #include "net/filter.h" #include "qapi/string-output-visitor.h" =20 @@ -1149,6 +1150,12 @@ void hmp_host_net_add(Monitor *mon, const QDict *qdi= ct) const char *opts_str =3D qdict_get_try_str(qdict, "opts"); Error *local_err =3D NULL; QemuOpts *opts; + static bool warned; + + if (!warned && !qtest_enabled()) { + error_report("host_net_add is deprecated, use netdev_add instead"); + warned =3D true; + } =20 if (!net_host_check_device(device)) { monitor_printf(mon, "invalid host network device %s\n", device); @@ -1175,6 +1182,12 @@ void hmp_host_net_remove(Monitor *mon, const QDict *= qdict) NetClientState *nc; int vlan_id =3D qdict_get_int(qdict, "vlan_id"); const char *device =3D qdict_get_str(qdict, "device"); + static bool warned; + + if (!warned && !qtest_enabled()) { + error_report("host_net_remove is deprecated, use netdev_del instea= d"); + warned =3D true; + } =20 nc =3D net_hub_find_client_by_name(vlan_id, device); if (!nc) { --=20 1.8.3.1