Skip to content

Commit

Permalink
net/virtio: return early when failover primary alread added
Browse files Browse the repository at this point in the history
Bail out when primary device was already added before.
This avoids printing a wrong warning message during reboot.

Fixes: 9711cd0 ("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>
  • Loading branch information
jensfr authored and jasowang committed Nov 25, 2019
1 parent 284f42a commit 117378b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hw/net/virtio-net.c
Expand Up @@ -759,6 +759,10 @@ static void failover_add_primary(VirtIONet *n, Error **errp)
{
Error *err = NULL;

if (n->primary_dev) {
return;
}

n->primary_device_opts = qemu_opts_find(qemu_find_opts("device"),
n->primary_device_id);
if (n->primary_device_opts) {
Expand Down

0 comments on commit 117378b

Please sign in to comment.