qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ashok Kumar <ashoks@broadcom.com>
To: qemu-devel@nongnu.org
Cc: Ashok Kumar <ashoks@broadcom.com>
Subject: [Qemu-devel] [PATCH] hw/arm/virt: Initialize NICs configured in PCI bus
Date: Wed, 6 Jan 2016 06:47:39 -0800	[thread overview]
Message-ID: <1452091659-17698-1-git-send-email-ashoks@broadcom.com> (raw)

virtio model is used for default case.

Signed-off-by: Ashok Kumar <ashoks@broadcom.com>
---
 hw/arm/virt.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index acc1fcb..fd52b76 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -808,6 +808,7 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic,
     DeviceState *dev;
     char *nodename;
     int i;
+    PCIHostState *pci;
 
     dev = qdev_create(NULL, TYPE_GPEX_HOST);
     qdev_init_nofail(dev);
@@ -847,6 +848,19 @@ static void create_pcie(const VirtBoardInfo *vbi, qemu_irq *pic,
         sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, pic[irq + i]);
     }
 
+    pci = PCI_HOST_BRIDGE(dev);
+    if (pci->bus) {
+        for (i = 0; i < nb_nics; i++) {
+            NICInfo *nd = &nd_table[i];
+
+            if (!nd->model) {
+                nd->model = g_strdup("virtio");
+            }
+
+            pci_nic_init_nofail(nd, pci->bus, nd->model, NULL);
+        }
+    }
+
     nodename = g_strdup_printf("/pcie@%" PRIx64, base);
     qemu_fdt_add_subnode(vbi->fdt, nodename);
     qemu_fdt_setprop_string(vbi->fdt, nodename,
-- 
2.1.0

             reply	other threads:[~2016-01-06 14:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-06 14:47 Ashok Kumar [this message]
2016-01-06 18:10 ` [Qemu-devel] [PATCH] hw/arm/virt: Initialize NICs configured in PCI bus Peter Maydell
2016-01-07  5:53   ` Ashok Kumar
     [not found]   ` <568dfd6e.2966420a.4f765.fffff89dSMTPIN_ADDED_BROKEN@mx.google.com>
2016-01-07 14:47     ` Peter Maydell
2016-01-07 15:21       ` Paolo Bonzini
2016-01-11  2:54         ` Jason Wang
2016-01-11 13:24           ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452091659-17698-1-git-send-email-ashoks@broadcom.com \
    --to=ashoks@broadcom.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).