virtio-net: Avoid QemuOpts in failover_find_primary_device()
commit12b2fad7dcc8d08b6a59d1b14caa392ea614c6d9
authorKevin Wolf <kwolf@redhat.com>
Fri, 8 Oct 2021 13:34:40 +0000 (8 15:34 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 15 Oct 2021 14:11:22 +0000 (15 16:11 +0200)
tree3855001d9766af91ba35e1c6ec129dd9f7dc3f35
parent259a10dbcb4f36a3489fb52f9f7a654761589448
virtio-net: Avoid QemuOpts in failover_find_primary_device()

Don't go through the global QemuOptsList, it is state of the legacy
command line parser and we will create devices that are not contained
in it. It is also just the command line configuration and not
necessarily the current runtime state.

Instead, look at the qdev device tree which has the current state of all
existing devices.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211008133442.141332-14-kwolf@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/net/virtio-net.c