From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Myn4Y-0001uZ-BS for qemu-devel@nongnu.org; Fri, 16 Oct 2009 09:42:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Myn4Q-0001qy-BU for qemu-devel@nongnu.org; Fri, 16 Oct 2009 09:42:19 -0400 Received: from [199.232.76.173] (port=40521 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Myn4P-0001qZ-L7 for qemu-devel@nongnu.org; Fri, 16 Oct 2009 09:42:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17420) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Myn4P-0007nd-8B for qemu-devel@nongnu.org; Fri, 16 Oct 2009 09:42:13 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9GDgCfO029389 for ; Fri, 16 Oct 2009 09:42:12 -0400 From: Gerd Hoffmann Date: Fri, 16 Oct 2009 15:42:01 +0200 Message-Id: <1255700523-15270-9-git-send-email-kraxel@redhat.com> In-Reply-To: <1255700523-15270-1-git-send-email-kraxel@redhat.com> References: <1255700523-15270-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [RfC PATCH v3 08/10] prepare pci nic init path for qdev conversion List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Signed-off-by: Gerd Hoffmann --- hw/pci.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index abf07ca..fe8e939 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -859,10 +859,20 @@ PCIDevice *pci_nic_init(NICInfo *nd, const char *default_model, dev = &pci_dev->qdev; if (nd->name) dev->id = qemu_strdup(nd->name); - dev->nd = nd; + if (qdev_prop_exists(dev, "mac")) { + /* qdev-ified */ + qdev_prop_set_macaddr(dev, "mac", nd->macaddr); + if (nd->vlan) + qdev_prop_set_vlan(dev, "vlan", nd->vlan); + if (nd->netdev) + qdev_prop_set_netdev(dev, "netdev", nd->netdev); + } else { + /* legacy */ + dev->nd = nd; + nd->private = dev; + } if (qdev_init(dev) < 0) return NULL; - nd->private = dev; return pci_dev; } -- 1.6.2.5