msf2: Unbreak device-list-properties for "msf-soc"
commit2b0650205b71c2aa8bf6f877a8333ef25bf288b2
authorMarkus Armbruster <armbru@redhat.com>
Wed, 15 Jul 2020 14:04:39 +0000 (15 16:04 +0200)
committerThomas Huth <thuth@redhat.com>
Tue, 21 Jul 2020 06:40:54 +0000 (21 08:40 +0200)
treec30d3b1e5183e9ebc53ad6df35b208b92ee362a5
parent6184e5fb4221ec5dd6f0c27d05a8e575b81eb89b
msf2: Unbreak device-list-properties for "msf-soc"

Watch this:

    $ qemu-system-aarch64 -M ast2600-evb -S -display none -qmp stdio
    {"QMP": {"version": {"qemu": {"micro": 50, "minor": 0, "major": 5}, "package": "v5.0.0-2464-g3a9163af4e"}, "capabilities": ["oob"]}}
    {"execute": "qmp_capabilities"}
    {"return": {}}
    {"execute": "device-list-properties", "arguments": {"typename": "msf2-soc"}}
    Unsupported NIC model: ftgmac100
    armbru@dusky:~/work/images$ echo $?
    1

This is what breaks "make check SPEED=slow".

Root cause is m2sxxx_soc_initfn()'s messing with nd_table[] via
qemu_check_nic_model().  That's wrong.

We fixed the exact same bug for device "allwinner-a10" in commit
8aabc5437b "hw/arm/allwinner-a10: Do not use nd_table in instance_init
function".  Fix this instance the same way: move the offending code to
m2sxxx_soc_realize(), where it's less wrong, and add a FIXME comment.

Fixes: 05b7374a58 ("msf2: Add EMAC block to SmartFusion2 SoC")
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200715140440.3540942-2-armbru@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
hw/arm/msf2-soc.c