On Thu, Nov 14, 2019 at 03:16:11PM +0100, Jens Freimann wrote: > 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 <jfreim...@redhat.com>
Reviewed-by: Michael S. Tsirkin <m...@redhat.com> > --- > 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