From patchwork Wed Oct 21 13:25:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 36592 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 4F725B7BA9 for ; Thu, 22 Oct 2009 01:35:33 +1100 (EST) Received: from localhost ([127.0.0.1]:50469 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0cHi-0003Dr-9Y for incoming@patchwork.ozlabs.org; Wed, 21 Oct 2009 10:35:30 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0bCf-00088y-8Q for qemu-devel@nongnu.org; Wed, 21 Oct 2009 09:26:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0bCZ-00081G-Cs for qemu-devel@nongnu.org; Wed, 21 Oct 2009 09:26:11 -0400 Received: from [199.232.76.173] (port=55738 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0bCZ-000811-5j for qemu-devel@nongnu.org; Wed, 21 Oct 2009 09:26:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39121) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N0bCY-0007Ss-NN for qemu-devel@nongnu.org; Wed, 21 Oct 2009 09:26:07 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9LDQ58x015584 for ; Wed, 21 Oct 2009 09:26:06 -0400 Received: from zweiblum.home.kraxel.org (vpn2-9-113.ams2.redhat.com [10.36.9.113]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id n9LDQ0Ye032419; Wed, 21 Oct 2009 09:26:01 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 2507D7011A; Wed, 21 Oct 2009 15:25:44 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 21 Oct 2009 15:25:41 +0200 Message-Id: <1256131543-28416-21-git-send-email-kraxel@redhat.com> In-Reply-To: <1256131543-28416-1-git-send-email-kraxel@redhat.com> References: <1256131543-28416-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 20/22] zap DeviceState->nd 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 No users left. Also cleanup obsolete helper functions. Signed-off-by: Gerd Hoffmann --- hw/pci.c | 9 +-------- hw/qdev.c | 22 ---------------------- hw/qdev.h | 1 - net.h | 7 ------- 4 files changed, 1 insertions(+), 38 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index fe2c4bd..553febb 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -859,14 +859,7 @@ PCIDevice *pci_nic_init(NICInfo *nd, const char *default_model, dev = &pci_dev->qdev; if (nd->name) dev->id = qemu_strdup(nd->name); - if (qdev_prop_exists(dev, "mac")) { - /* qdev-ified */ - qdev_set_nic_properties(dev, nd); - } else { - /* legacy */ - dev->nd = nd; - nd->private = dev; - } + qdev_set_nic_properties(dev, nd); if (qdev_init(dev) < 0) return NULL; return pci_dev; diff --git a/hw/qdev.c b/hw/qdev.c index e81d662..373ddfc 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -361,28 +361,6 @@ void qdev_connect_gpio_out(DeviceState * dev, int n, qemu_irq pin) dev->gpio_out[n] = pin; } -VLANClientState *qdev_get_vlan_client(DeviceState *dev, - NetCanReceive *can_receive, - NetReceive *receive, - NetReceiveIOV *receive_iov, - NetCleanup *cleanup, - void *opaque) -{ - NICInfo *nd = dev->nd; - assert(nd); - nd->vc = qemu_new_vlan_client(nd->vlan, nd->netdev, - nd->model, nd->name, - can_receive, receive, receive_iov, - cleanup, opaque); - return nd->vc; -} - - -void qdev_get_macaddr(DeviceState *dev, uint8_t *macaddr) -{ - memcpy(macaddr, dev->nd->macaddr, 6); -} - void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd) { qdev_prop_set_macaddr(dev, "mac", nd->macaddr); diff --git a/hw/qdev.h b/hw/qdev.h index 5271a3c..d28978f 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -39,7 +39,6 @@ struct DeviceState { qemu_irq *gpio_in; QLIST_HEAD(, BusState) child_bus; int num_child_bus; - NICInfo *nd; QLIST_ENTRY(DeviceState) sibling; }; diff --git a/net.h b/net.h index f2d10f0..c96f291 100644 --- a/net.h +++ b/net.h @@ -164,13 +164,6 @@ void net_host_device_remove(Monitor *mon, const QDict *qdict); #define SMBD_COMMAND "/usr/sbin/smbd" #endif -void qdev_get_macaddr(DeviceState *dev, uint8_t *macaddr); -VLANClientState *qdev_get_vlan_client(DeviceState *dev, - NetCanReceive *can_receive, - NetReceive *receive, - NetReceiveIOV *receive_iov, - NetCleanup *cleanup, - void *opaque); void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd); #endif