[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 2/4] net/virtio: return early when failover primary alread add
From: |
Jens Freimann |
Subject: |
[PATCH v2 2/4] net/virtio: return early when failover primary alread added |
Date: |
Wed, 20 Nov 2019 15:38:57 +0100 |
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 <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
---
hw/net/virtio-net.c | 4 ++++
1 file changed, 4 insertions(+)
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) {
--
2.21.0