Patchwork [7/8] vlan cleanup: remove legacy monitor commands

login
register
mail settings
Submitter Miguel Di Ciurcio Filho
Date July 12, 2010, 7:20 p.m.
Message ID <1278962453-15774-8-git-send-email-miguel.filho@gmail.com>
Download mbox | patch
Permalink /patch/58664/
State New
Headers show

Comments

Miguel Di Ciurcio Filho - July 12, 2010, 7:20 p.m.
---
 net.c           |   60 -------------------------------------------------------
 net.h           |    2 -
 qemu-monitor.hx |   28 -------------------------
 3 files changed, 0 insertions(+), 90 deletions(-)

Patch

diff --git a/net.c b/net.c
index addd167..2c1c50f 100644
--- a/net.c
+++ b/net.c
@@ -1095,66 +1095,6 @@  int net_client_init(Monitor *mon, QemuOpts *opts, int is_netdev)
     return -1;
 }
 
-static int net_host_check_device(const char *device)
-{
-    int i;
-    const char *valid_param_list[] = { "tap", "socket", "dump"
-#ifdef CONFIG_SLIRP
-                                       ,"user"
-#endif
-#ifdef CONFIG_VDE
-                                       ,"vde"
-#endif
-    };
-    for (i = 0; i < sizeof(valid_param_list) / sizeof(char *); i++) {
-        if (!strncmp(valid_param_list[i], device,
-                     strlen(valid_param_list[i])))
-            return 1;
-    }
-
-    return 0;
-}
-
-void net_host_device_add(Monitor *mon, const QDict *qdict)
-{
-    const char *device = qdict_get_str(qdict, "device");
-    const char *opts_str = qdict_get_try_str(qdict, "opts");
-    QemuOpts *opts;
-
-    if (!net_host_check_device(device)) {
-        monitor_printf(mon, "invalid host network device %s\n", device);
-        return;
-    }
-
-    opts = qemu_opts_parse(&qemu_net_opts, opts_str ? opts_str : "", 0);
-    if (!opts) {
-        return;
-    }
-
-    qemu_opt_set(opts, "type", device);
-
-    if (net_client_init(mon, opts, 0) < 0) {
-        monitor_printf(mon, "adding host network device %s failed\n", device);
-    }
-}
-
-void net_host_device_remove(Monitor *mon, const QDict *qdict)
-{
-    VLANClientState *vc;
-    int vlan_id = qdict_get_int(qdict, "vlan_id");
-    const char *device = qdict_get_str(qdict, "device");
-
-    vc = qemu_find_vlan_client_by_name(mon, vlan_id, device);
-    if (!vc) {
-        return;
-    }
-    if (!net_host_check_device(vc->model)) {
-        monitor_printf(mon, "invalid host network device %s\n", device);
-        return;
-    }
-    qemu_del_vlan_client(vc);
-}
-
 int do_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret_data)
 {
     QemuOpts *opts;
diff --git a/net.h b/net.h
index 518cf9c..b3c5ca3 100644
--- a/net.h
+++ b/net.h
@@ -161,8 +161,6 @@  int net_client_parse(QemuOptsList *opts_list, const char *str);
 int net_init_clients(void);
 void net_check_clients(void);
 void net_cleanup(void);
-void net_host_device_add(Monitor *mon, const QDict *qdict);
-void net_host_device_remove(Monitor *mon, const QDict *qdict);
 int do_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret_data);
 int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data);
 
diff --git a/qemu-monitor.hx b/qemu-monitor.hx
index 2af3de6..275f3bc 100644
--- a/qemu-monitor.hx
+++ b/qemu-monitor.hx
@@ -1154,34 +1154,6 @@  Hot remove PCI device.
 ETEXI
 
     {
-        .name       = "host_net_add",
-        .args_type  = "device:s,opts:s?",
-        .params     = "tap|user|socket|vde|dump [options]",
-        .help       = "add host VLAN client",
-        .mhandler.cmd = net_host_device_add,
-    },
-
-STEXI
-@item host_net_add
-@findex host_net_add
-Add host VLAN client.
-ETEXI
-
-    {
-        .name       = "host_net_remove",
-        .args_type  = "vlan_id:i,device:s",
-        .params     = "vlan_id name",
-        .help       = "remove host VLAN client",
-        .mhandler.cmd = net_host_device_remove,
-    },
-
-STEXI
-@item host_net_remove
-@findex host_net_remove
-Remove host VLAN client.
-ETEXI
-
-    {
         .name       = "netdev_add",
         .args_type  = "netdev:O",
         .params     = "[user|tap|socket],id=str[,prop=value][,...]",