summaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2017-05-15 15:32:56 +0200
committerJason Wang <jasowang@redhat.com>2017-05-23 10:10:38 +0800
commit559964a1ada14dc2d5066f445a2ef1c8389f7d6c (patch)
treed9566f031dd372433a09eb9219e12617fd765b08 /net/net.c
parentf583dca9ad2adb9797da56ad8d859ed50eeae536 (diff)
downloadqemu-559964a1ada14dc2d5066f445a2ef1c8389f7d6c.zip
hmp / net: Mark host_net_add/remove as deprecated
The netdev_add and netdev_del commands should be used nowadays instead. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/net.c b/net/net.c
index 0ac3b9e80c..6235aabed8 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"
@@ -1149,6 +1150,12 @@ void hmp_host_net_add(Monitor *mon, const QDict *qdict)
const char *opts_str = qdict_get_try_str(qdict, "opts");
Error *local_err = NULL;
QemuOpts *opts;
+ static bool warned;
+
+ if (!warned && !qtest_enabled()) {
+ error_report("host_net_add is deprecated, use netdev_add instead");
+ warned = true;
+ }
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 = qdict_get_int(qdict, "vlan_id");
const char *device = qdict_get_str(qdict, "device");
+ static bool warned;
+
+ if (!warned && !qtest_enabled()) {
+ error_report("host_net_remove is deprecated, use netdev_del instead");
+ warned = true;
+ }
nc = net_hub_find_client_by_name(vlan_id, device);
if (!nc) {