From patchwork Wed Aug 1 12:54:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 174456 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 BE1662C0081 for ; Wed, 1 Aug 2012 23:36:19 +1000 (EST) Received: from localhost ([::1]:54440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwYTw-0002N8-9w for incoming@patchwork.ozlabs.org; Wed, 01 Aug 2012 08:56:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60483) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwYSE-00077z-OQ for qemu-devel@nongnu.org; Wed, 01 Aug 2012 08:55:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwYSB-0007ll-AO for qemu-devel@nongnu.org; Wed, 01 Aug 2012 08:55:10 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:33435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwYSB-0007jT-0V for qemu-devel@nongnu.org; Wed, 01 Aug 2012 08:55:07 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 1 Aug 2012 13:55:06 +0100 Received: from d06nrmr1307.portsmouth.uk.ibm.com (9.149.38.129) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 1 Aug 2012 13:55:04 +0100 Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q71Ct3go1552416 for ; Wed, 1 Aug 2012 13:55:03 +0100 Received: from d06av04.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q71Ct3ZB018377 for ; Wed, 1 Aug 2012 06:55:03 -0600 Received: from localhost (sig-9-146-165-117.uk.ibm.com [9.146.165.117]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q71Ct3RA018367; Wed, 1 Aug 2012 06:55:03 -0600 From: Stefan Hajnoczi To: Anthony Liguori Date: Wed, 1 Aug 2012 13:54:42 +0100 Message-Id: <1343825691-343-11-git-send-email-stefanha@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1343825691-343-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1343825691-343-1-git-send-email-stefanha@linux.vnet.ibm.com> x-cbid: 12080112-4966-0000-0000-0000031B09AD X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.106 Cc: Zhi Yong Wu , qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 10/19] 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 Reviewed-by: Laszlo Ersek --- 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;