qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 08/22] prepare pci nic init path for qdev property c


From: Gerd Hoffmann
Subject: [Qemu-devel] [PATCH 08/22] prepare pci nic init path for qdev property configuration.
Date: Wed, 21 Oct 2009 15:25:29 +0200

Initialization path will work with both converted and not-converted
drivers, so we can convert drivers one by one.

Signed-off-by: Gerd Hoffmann <address@hidden>
---
 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]