net/virtio: fix re-plugging of primary device
authorJens Freimann <jfreimann@redhat.com>
Wed, 20 Nov 2019 15:49:50 +0000 (16:49 +0100)
committerJason Wang <jasowang@redhat.com>
Mon, 25 Nov 2019 15:30:29 +0000 (23:30 +0800)
commit150ab54aa6934583180f88a2bd540bc6fc4fbff3
treed0282be6e4873c5122729d155da4542501cab733
parent117378bf03fbe6ec004be9637aceb1b3e273e74f
net/virtio: fix re-plugging of primary device

failover_replug_primary was returning true on failure which lead to
re-plug not working when a migration failed.  Fix this by returning
success when hotplug worked.  This is a bug that was missed in last
round of testing but was tested succesfully with this version.  Also
make sure we don't pass NULL to qdev_set_parent_bus().

This fixes CID 1407224.

Fixes: 9711cd0dfc3f ("net/virtio: add failover support")
Signed-off-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/virtio-net.c