From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N0bCU-0007sn-K2 for qemu-devel@nongnu.org; Wed, 21 Oct 2009 09:26:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N0bCP-0007lw-0V for qemu-devel@nongnu.org; Wed, 21 Oct 2009 09:26:01 -0400 Received: from [199.232.76.173] (port=55716 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0bCO-0007lS-NM for qemu-devel@nongnu.org; Wed, 21 Oct 2009 09:25:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9925) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N0bCM-0007PP-Pt for qemu-devel@nongnu.org; Wed, 21 Oct 2009 09:25:55 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9LDPrwT009077 for ; Wed, 21 Oct 2009 09:25:53 -0400 From: Gerd Hoffmann Date: Wed, 21 Oct 2009 15:25:29 +0200 Message-Id: <1256131543-28416-9-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> Subject: [Qemu-devel] [PATCH 08/22] prepare pci nic init path for qdev property configuration. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Initialization path will work with both converted and not-converted drivers, so we can convert drivers one by one. Signed-off-by: Gerd Hoffmann --- hw/pci.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index abf07ca..fe2c4bd 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -859,10 +859,16 @@ 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_set_nic_properties(dev, nd); + } 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