From patchwork Mon Jul 12 19:20:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miguel Di Ciurcio Filho X-Patchwork-Id: 58664 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7AC01B6F11 for ; Tue, 13 Jul 2010 05:30:33 +1000 (EST) Received: from localhost ([127.0.0.1]:59692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OYOhy-0007ZM-6h for incoming@patchwork.ozlabs.org; Mon, 12 Jul 2010 15:30:30 -0400 Received: from [140.186.70.92] (port=37624 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OYOZa-0001wW-D4 for qemu-devel@nongnu.org; Mon, 12 Jul 2010 15:21:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OYOZZ-0003vP-45 for qemu-devel@nongnu.org; Mon, 12 Jul 2010 15:21:50 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:44975) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OYOZZ-0003rP-0Y for qemu-devel@nongnu.org; Mon, 12 Jul 2010 15:21:49 -0400 Received: by mail-gy0-f173.google.com with SMTP id 2so2918762gyf.4 for ; Mon, 12 Jul 2010 12:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=WQ+XpmhiUvM8LoJu85QahJ+llvsg3A57rph8hG7M4ig=; b=r33s8Y1CFICmglFz6Eg2MJTSBm+eVu/46Mmv5nMev71yzNWJ7cK2YBm0IHvkvtNo2Z R1BwHLzFJWlkm4C+FkJukHjhEBFFwoRIvHU4SFofJS2Aq55WGJ7siCwAjDm+yqKSylab lIRk6xxy7zdemtCDz2m7BZwihcSoFdCL2j8jA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=fsMGAi3tH8aTc5gSxaOTNSIH9zlTALA6+oAQHSKFogkMmpkXR8ydcaclj7AZ6U4jvT 2d4bbDtmlC+mh4IbqTBcO71lPc5A3E9t12KmmpFoRJ/gKb+4SqZ2z0dKmA7iy/FaQqtW DH6kDwLBdDCbeBNnPBdqzW4/vZuy4fneRYNek= Received: by 10.101.147.8 with SMTP id z8mr8229793ann.78.1278962508740; Mon, 12 Jul 2010 12:21:48 -0700 (PDT) Received: from localhost.localdomain ([143.106.7.130]) by mx.google.com with ESMTPS id p9sm55284904anf.26.2010.07.12.12.21.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 12 Jul 2010 12:21:46 -0700 (PDT) From: Miguel Di Ciurcio Filho To: qemu-devel@nongnu.org Date: Mon, 12 Jul 2010 16:20:52 -0300 Message-Id: <1278962453-15774-8-git-send-email-miguel.filho@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1278962453-15774-1-git-send-email-miguel.filho@gmail.com> References: <1278962453-15774-1-git-send-email-miguel.filho@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Miguel Di Ciurcio Filho , avi@redhat.com Subject: [Qemu-devel] [PATCH 7/8] vlan cleanup: remove legacy monitor commands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org --- net.c | 60 ------------------------------------------------------- net.h | 2 - qemu-monitor.hx | 28 ------------------------- 3 files changed, 0 insertions(+), 90 deletions(-) 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][,...]",