From patchwork Tue Jul 24 15:35:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 172957 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 6E40A2C0095 for ; Wed, 25 Jul 2012 02:44:07 +1000 (EST) Received: from localhost ([::1]:52465 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SthA2-0003WX-F5 for incoming@patchwork.ozlabs.org; Tue, 24 Jul 2012 11:36:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sth9I-0001c9-Qf for qemu-devel@nongnu.org; Tue, 24 Jul 2012 11:35:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sth94-0006Se-Kp for qemu-devel@nongnu.org; Tue, 24 Jul 2012 11:35:48 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:49254) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sth94-0006ST-Bn for qemu-devel@nongnu.org; Tue, 24 Jul 2012 11:35:34 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Jul 2012 16:35:33 +0100 Received: from d06nrmr1507.portsmouth.uk.ibm.com (9.149.38.233) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 24 Jul 2012 16:35:31 +0100 Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6OFZURk2646032 for ; Tue, 24 Jul 2012 16:35:30 +0100 Received: from d06av10.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6OFBekH018659 for ; Tue, 24 Jul 2012 11:11:40 -0400 Received: from localhost (stefanha-thinkpad.manchester-maybrook.uk.ibm.com [9.174.219.145]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q6OFBdcJ018647; Tue, 24 Jul 2012 11:11:40 -0400 From: Stefan Hajnoczi To: Date: Tue, 24 Jul 2012 16:35:12 +0100 Message-Id: <1343144119-18757-10-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1343144119-18757-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1343144119-18757-1-git-send-email-stefanha@linux.vnet.ibm.com> x-cbid: 12072415-1948-0000-0000-0000027C2AC5 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.110 Cc: Paolo Bonzini , Zhi Yong Wu , Laszlo Ersek , Stefan Hajnoczi , Zhi Yong Wu Subject: [Qemu-devel] [PATCH v2 09/16] net: Rename non_vlan_clients to net_clients X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org There is no longer a distinction between vlan clients and non-vlan clients in the net core. The net core only knows about point-to-point clients which are connected to a peer. It's time to rename the global list of net clients since it no longer refers to vlans at all. Signed-off-by: Stefan Hajnoczi Signed-off-by: Zhi Yong Wu --- net.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/net.c b/net.c index ee75e0e..65b45bb 100644 --- a/net.c +++ b/net.c @@ -47,7 +47,7 @@ # define CONFIG_NET_BRIDGE #endif -static QTAILQ_HEAD(, VLANClientState) non_vlan_clients; +static QTAILQ_HEAD(, VLANClientState) net_clients; int default_net = 1; @@ -168,7 +168,7 @@ static char *assign_name(VLANClientState *vc1, const char *model) char buf[256]; int id = 0; - QTAILQ_FOREACH(vc, &non_vlan_clients, next) { + QTAILQ_FOREACH(vc, &net_clients, next) { if (vc == vc1) { continue; } @@ -219,7 +219,7 @@ VLANClientState *qemu_new_net_client(NetClientInfo *info, vc->peer = peer; peer->peer = vc; } - QTAILQ_INSERT_TAIL(&non_vlan_clients, vc, next); + QTAILQ_INSERT_TAIL(&net_clients, vc, next); vc->send_queue = qemu_new_net_queue(qemu_deliver_packet, qemu_deliver_packet_iov, @@ -251,7 +251,7 @@ NICState *qemu_new_nic(NetClientInfo *info, static void qemu_cleanup_vlan_client(VLANClientState *vc) { - QTAILQ_REMOVE(&non_vlan_clients, vc, next); + QTAILQ_REMOVE(&net_clients, vc, next); if (vc->info->cleanup) { vc->info->cleanup(vc); @@ -305,7 +305,7 @@ void qemu_foreach_nic(qemu_nic_foreach func, void *opaque) { VLANClientState *nc; - QTAILQ_FOREACH(nc, &non_vlan_clients, next) { + QTAILQ_FOREACH(nc, &net_clients, next) { if (nc->info->type == NET_CLIENT_OPTIONS_KIND_NIC) { func(DO_UPCAST(NICState, nc, nc), opaque); } @@ -470,7 +470,7 @@ VLANClientState *qemu_find_netdev(const char *id) { VLANClientState *vc; - QTAILQ_FOREACH(vc, &non_vlan_clients, next) { + QTAILQ_FOREACH(vc, &net_clients, next) { if (vc->info->type == NET_CLIENT_OPTIONS_KIND_NIC) continue; if (!strcmp(vc->name, id)) { @@ -867,7 +867,7 @@ void do_info_network(Monitor *mon) NetClientOptionsKind type; monitor_printf(mon, "Devices not on any VLAN:\n"); - QTAILQ_FOREACH(vc, &non_vlan_clients, next) { + QTAILQ_FOREACH(vc, &net_clients, next) { peer = vc->peer; type = vc->info->type; if (!peer || type == NET_CLIENT_OPTIONS_KIND_NIC) { @@ -886,7 +886,7 @@ void qmp_set_link(const char *name, bool up, Error **errp) { VLANClientState *vc = NULL; - QTAILQ_FOREACH(vc, &non_vlan_clients, next) { + QTAILQ_FOREACH(vc, &net_clients, next) { if (!strcmp(vc->name, name)) { goto done; } @@ -920,7 +920,7 @@ void net_cleanup(void) { VLANClientState *vc, *next_vc; - QTAILQ_FOREACH_SAFE(vc, &non_vlan_clients, next, next_vc) { + QTAILQ_FOREACH_SAFE(vc, &net_clients, next, next_vc) { qemu_del_vlan_client(vc); } } @@ -944,7 +944,7 @@ void net_check_clients(void) net_hub_check_clients(); - QTAILQ_FOREACH(vc, &non_vlan_clients, next) { + QTAILQ_FOREACH(vc, &net_clients, next) { if (!vc->peer) { fprintf(stderr, "Warning: %s %s has no peer\n", vc->info->type == NET_CLIENT_OPTIONS_KIND_NIC ? "nic" : "netdev", @@ -1008,7 +1008,7 @@ int net_init_clients(void) #endif } - QTAILQ_INIT(&non_vlan_clients); + QTAILQ_INIT(&net_clients); if (qemu_opts_foreach(qemu_find_opts("netdev"), net_init_netdev, NULL, 1) == -1) return -1;