]> xenbits.xensource.com Git - people/pauldu/qemu.git/commitdiff
sun4u: fix assert when adding NICs which aren't the in-built model
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Sun, 15 Oct 2017 09:05:59 +0000 (10:05 +0100)
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Thu, 19 Oct 2017 06:45:35 +0000 (07:45 +0100)
Commit 8d93297 introduced a bug whereby non-inbuilt NICs are realized before
setting the default MAC address causing an assert. Switch NIC creation
over from pci_create_simple() to pci_create() which works exactly the
same except omitting the realize as originally intended.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Artyom Tarasenko <atar4qemu@gmail.com>
hw/sparc64/sun4u.c

index 55d81ee73eef76065ad8c224297d1abd8d92b134..77a787466a57c3f1aa7b6cbb308b40dc62798519 100644 (file)
@@ -494,10 +494,10 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
                 memcpy(&macaddr, &nd->macaddr.a, sizeof(MACAddr));
                 onboard_nic = true;
             } else {
-                pci_dev = pci_create_simple(pci_busB, -1, "sunhme");
+                pci_dev = pci_create(pci_busB, -1, "sunhme");
             }
         } else {
-            pci_dev = pci_create_simple(pci_busB, -1, nd->model);
+            pci_dev = pci_create(pci_busB, -1, nd->model);
         }
 
         dev = &pci_dev->qdev;