From patchwork Wed Oct 21 13:25:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 36559 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 E9F05B7BA9 for ; Thu, 22 Oct 2009 01:02:38 +1100 (EST) Received: from localhost ([127.0.0.1]:56674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N0blr-0003ud-2N for incoming@patchwork.ozlabs.org; Wed, 21 Oct 2009 10:02:35 -0400 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 Received: from zweiblum.home.kraxel.org (vpn2-9-113.ams2.redhat.com [10.36.9.113]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id n9LDPonH025887; Wed, 21 Oct 2009 09:25:51 -0400 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id DD7527010E; Wed, 21 Oct 2009 15:25:43 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org 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> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 08/22] prepare pci nic init path for qdev property configuration. 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 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; }