From patchwork Wed Aug 1 12:54:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 174459 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 9235D2C0096 for ; Wed, 1 Aug 2012 23:55:06 +1000 (EST) Received: from localhost ([::1]:51438 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwYT9-0000nj-80 for incoming@patchwork.ozlabs.org; Wed, 01 Aug 2012 08:56:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwYSL-0007Kf-9q for qemu-devel@nongnu.org; Wed, 01 Aug 2012 08:55:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwYSD-0007nI-Na for qemu-devel@nongnu.org; Wed, 01 Aug 2012 08:55:17 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:56258) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwYSD-0007mt-DI for qemu-devel@nongnu.org; Wed, 01 Aug 2012 08:55:09 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 1 Aug 2012 13:55:08 +0100 Received: from d06nrmr1307.portsmouth.uk.ibm.com (9.149.38.129) by e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 1 Aug 2012 13:55:07 +0100 Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q71Ct61R2855154 for ; Wed, 1 Aug 2012 13:55:06 +0100 Received: from d06av05.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q71Ct5w2023941 for ; Wed, 1 Aug 2012 06:55:06 -0600 Received: from localhost (sig-9-146-165-117.uk.ibm.com [9.146.165.117]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q71Ct5bA023938; Wed, 1 Aug 2012 06:55:05 -0600 From: Stefan Hajnoczi To: Anthony Liguori Date: Wed, 1 Aug 2012 13:54:45 +0100 Message-Id: <1343825691-343-14-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-5024-0000-0000-000003650599 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.107 Cc: Zhi Yong Wu , qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [Qemu-devel] [PATCH 13/19] net: Rename qemu_del_vlan_client() to qemu_del_net_client() 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 Another step in moving the vlan feature out of net core. Users only deal with NetClientState and therefore qemu_del_vlan_client() should be named qemu_del_net_client(). Signed-off-by: Stefan Hajnoczi Signed-off-by: Zhi Yong Wu Reviewed-by: Laszlo Ersek --- hw/e1000.c | 2 +- hw/eepro100.c | 2 +- hw/ne2000.c | 2 +- hw/pcnet-pci.c | 2 +- hw/rtl8139.c | 2 +- hw/usb/dev-network.c | 2 +- hw/virtio-net.c | 2 +- hw/xen_nic.c | 2 +- net.c | 20 ++++++++++---------- net.h | 2 +- net/slirp.c | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index 531b69a..ae8a6c5 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -1201,7 +1201,7 @@ pci_e1000_uninit(PCIDevice *dev) qemu_free_timer(d->autoneg_timer); memory_region_destroy(&d->mmio); memory_region_destroy(&d->io); - qemu_del_vlan_client(&d->nic->nc); + qemu_del_net_client(&d->nic->nc); } static NetClientInfo net_e1000_info = { diff --git a/hw/eepro100.c b/hw/eepro100.c index c2b0a2d..50d117e 100644 --- a/hw/eepro100.c +++ b/hw/eepro100.c @@ -1847,7 +1847,7 @@ static void pci_nic_uninit(PCIDevice *pci_dev) memory_region_destroy(&s->flash_bar); vmstate_unregister(&pci_dev->qdev, s->vmstate, s); eeprom93xx_free(&pci_dev->qdev, s->eeprom); - qemu_del_vlan_client(&s->nic->nc); + qemu_del_net_client(&s->nic->nc); } static NetClientInfo net_eepro100_info = { diff --git a/hw/ne2000.c b/hw/ne2000.c index 2131770..15605c4 100644 --- a/hw/ne2000.c +++ b/hw/ne2000.c @@ -750,7 +750,7 @@ static void pci_ne2000_exit(PCIDevice *pci_dev) NE2000State *s = &d->ne2000; memory_region_destroy(&s->io); - qemu_del_vlan_client(&s->nic->nc); + qemu_del_net_client(&s->nic->nc); } static Property ne2000_properties[] = { diff --git a/hw/pcnet-pci.c b/hw/pcnet-pci.c index d58cffd..48fd447 100644 --- a/hw/pcnet-pci.c +++ b/hw/pcnet-pci.c @@ -279,7 +279,7 @@ static void pci_pcnet_uninit(PCIDevice *dev) memory_region_destroy(&d->io_bar); qemu_del_timer(d->state.poll_timer); qemu_free_timer(d->state.poll_timer); - qemu_del_vlan_client(&d->state.nic->nc); + qemu_del_net_client(&d->state.nic->nc); } static NetClientInfo net_pci_pcnet_info = { diff --git a/hw/rtl8139.c b/hw/rtl8139.c index 619e6c0..844f1b8 100644 --- a/hw/rtl8139.c +++ b/hw/rtl8139.c @@ -3450,7 +3450,7 @@ static void pci_rtl8139_uninit(PCIDevice *dev) } qemu_del_timer(s->timer); qemu_free_timer(s->timer); - qemu_del_vlan_client(&s->nic->nc); + qemu_del_net_client(&s->nic->nc); } static NetClientInfo net_rtl8139_info = { diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index 6c2edbe..c84892c 100644 --- a/hw/usb/dev-network.c +++ b/hw/usb/dev-network.c @@ -1309,7 +1309,7 @@ static void usb_net_handle_destroy(USBDevice *dev) /* TODO: remove the nd_table[] entry */ rndis_clear_responsequeue(s); - qemu_del_vlan_client(&s->nic->nc); + qemu_del_net_client(&s->nic->nc); } static NetClientInfo net_usbnet_info = { diff --git a/hw/virtio-net.c b/hw/virtio-net.c index a83eade..b1998b2 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -1077,6 +1077,6 @@ void virtio_net_exit(VirtIODevice *vdev) qemu_bh_delete(n->tx_bh); } - qemu_del_vlan_client(&n->nic->nc); + qemu_del_net_client(&n->nic->nc); virtio_cleanup(&n->vdev); } diff --git a/hw/xen_nic.c b/hw/xen_nic.c index c81191d..8b79bfb 100644 --- a/hw/xen_nic.c +++ b/hw/xen_nic.c @@ -406,7 +406,7 @@ static void net_disconnect(struct XenDevice *xendev) netdev->rxs = NULL; } if (netdev->nic) { - qemu_del_vlan_client(&netdev->nic->nc); + qemu_del_net_client(&netdev->nic->nc); netdev->nic = NULL; } } diff --git a/net.c b/net.c index 8aebf8c..88ccb2e 100644 --- a/net.c +++ b/net.c @@ -249,7 +249,7 @@ NICState *qemu_new_nic(NetClientInfo *info, return nic; } -static void qemu_cleanup_vlan_client(NetClientState *nc) +static void qemu_cleanup_net_client(NetClientState *nc) { QTAILQ_REMOVE(&net_clients, nc, next); @@ -258,7 +258,7 @@ static void qemu_cleanup_vlan_client(NetClientState *nc) } } -static void qemu_free_vlan_client(NetClientState *nc) +static void qemu_free_net_client(NetClientState *nc) { if (nc->send_queue) { qemu_del_net_queue(nc->send_queue); @@ -271,7 +271,7 @@ static void qemu_free_vlan_client(NetClientState *nc) g_free(nc); } -void qemu_del_vlan_client(NetClientState *nc) +void qemu_del_net_client(NetClientState *nc) { /* If there is a peer NIC, delete and cleanup client, but do not free. */ if (nc->peer && nc->peer->info->type == NET_CLIENT_OPTIONS_KIND_NIC) { @@ -285,7 +285,7 @@ void qemu_del_vlan_client(NetClientState *nc) if (nc->peer->info->link_status_changed) { nc->peer->info->link_status_changed(nc->peer); } - qemu_cleanup_vlan_client(nc); + qemu_cleanup_net_client(nc); return; } @@ -293,12 +293,12 @@ void qemu_del_vlan_client(NetClientState *nc) if (nc->peer && nc->info->type == NET_CLIENT_OPTIONS_KIND_NIC) { NICState *nic = DO_UPCAST(NICState, nc, nc); if (nic->peer_deleted) { - qemu_free_vlan_client(nc->peer); + qemu_free_net_client(nc->peer); } } - qemu_cleanup_vlan_client(nc); - qemu_free_vlan_client(nc); + qemu_cleanup_net_client(nc); + qemu_free_net_client(nc); } void qemu_foreach_nic(qemu_nic_foreach func, void *opaque) @@ -803,7 +803,7 @@ void net_host_device_remove(Monitor *mon, const QDict *qdict) monitor_printf(mon, "invalid host network device %s\n", device); return; } - qemu_del_vlan_client(nc); + qemu_del_net_client(nc); } void netdev_add(QemuOpts *opts, Error **errp) @@ -851,7 +851,7 @@ void qmp_netdev_del(const char *id, Error **errp) return; } - qemu_del_vlan_client(nc); + qemu_del_net_client(nc); qemu_opts_del(qemu_opts_find(qemu_find_opts_err("netdev", errp), id)); } @@ -920,7 +920,7 @@ void net_cleanup(void) NetClientState *nc, *next_vc; QTAILQ_FOREACH_SAFE(nc, &net_clients, next, next_vc) { - qemu_del_vlan_client(nc); + qemu_del_net_client(nc); } } diff --git a/net.h b/net.h index d368e24e..7e629d3 100644 --- a/net.h +++ b/net.h @@ -77,7 +77,7 @@ NICState *qemu_new_nic(NetClientInfo *info, const char *model, const char *name, void *opaque); -void qemu_del_vlan_client(NetClientState *nc); +void qemu_del_net_client(NetClientState *nc); NetClientState *qemu_find_vlan_client_by_name(Monitor *mon, int vlan_id, const char *client_str); typedef void (*qemu_nic_foreach)(NICState *nic, void *opaque); diff --git a/net/slirp.c b/net/slirp.c index 1bdad37..9d5ca79 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -275,7 +275,7 @@ static int net_slirp_init(NetClientState *peer, const char *model, return 0; error: - qemu_del_vlan_client(nc); + qemu_del_net_client(nc); return -1; }