diff options
author | Jens Freimann <jfreimann@redhat.com> | 2019-11-20 16:49:49 +0100 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2019-11-25 23:30:28 +0800 |
commit | 117378bf03fbe6ec004be9637aceb1b3e273e74f (patch) | |
tree | a0de3f017f5c118fca0a8a5c3f8578b24d1c0815 /hw | |
parent | 284f42a520cd9f5905abac2fa50397423890de8f (diff) | |
download | qemu-117378bf03fbe6ec004be9637aceb1b3e273e74f.zip |
net/virtio: return early when failover primary alread added
Bail out when primary device was already added before.
This avoids printing a wrong warning message during reboot.
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>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/net/virtio-net.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 946039c0dc..ac4d19109e 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -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) { |