Commit bcf9e2c2 authored by Mark Cave-Ayland's avatar Mark Cave-Ayland
Browse files

sun4u: fix assert when adding NICs which aren't the in-built model



Commit 8d932971 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: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: default avatarArtyom Tarasenko <atar4qemu@gmail.com>
parent 6864fa38
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;