hw/pci: Fix crash when running QEMU with "-nic model=rocker"
commit00823980b296c80a3ff7b448df20c48897cd62e9
authorThomas Huth <thuth@redhat.com>
Wed, 27 May 2020 15:31:52 +0000 (27 17:31 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 12 Jun 2020 14:17:06 +0000 (12 10:17 -0400)
treecd0bde968145d9c03a5d9cd3a797a7d1349be3af
parenta9a5c473d25d83bcdad27d97e5fb451950ee894a
hw/pci: Fix crash when running QEMU with "-nic model=rocker"

QEMU currently aborts when being started with "-nic model=rocker" or with
"-net nic,model=rocker". This happens because the "rocker" device is not
a normal NIC but a switch, which has different properties. Thus we should
only consider real NIC devices for "-nic" and "-net". These devices can
be identified by the "netdev" property, so check for this property before
adding the device to the list.

Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Fixes: 52310c3fa7dc854d ("net: allow using any PCI NICs in -net or -nic")
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20200527153152.9211-1-thuth@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/pci.c