diff options
author | Laurent Vivier <lvivier@redhat.com> | 2021-12-20 15:53:14 +0100 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2021-12-22 08:12:45 +0100 |
commit | 1b529d908d1e97ac154ab0e68573f8c211aac3f1 (patch) | |
tree | 8a08ef81f1032b18e83db711d87f521f35add79b /hw/net/virtio-net.c | |
parent | 8c5f94cd4182753959c8be8de415120dc879d8f0 (diff) | |
download | qemu-1b529d908d1e97ac154ab0e68573f8c211aac3f1.zip qemu-1b529d908d1e97ac154ab0e68573f8c211aac3f1.tar.gz qemu-1b529d908d1e97ac154ab0e68573f8c211aac3f1.tar.bz2 |
failover: Silence warning messages during qtest
virtio-net-failover test tries several device combinations that produces
some expected warnings.
These warning can be confusing, so we disable them during the qtest
sequence.
Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20211220145314.390697-1-lvivier@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
[thuth: Fix memory leak by using error_free()]
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'hw/net/virtio-net.c')
-rw-r--r-- | hw/net/virtio-net.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index f2014d5..cf8ab0f 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -44,6 +44,7 @@ #include "hw/pci/pci.h" #include "net_rx_pkt.h" #include "hw/virtio/vhost.h" +#include "sysemu/qtest.h" #define VIRTIO_NET_VM_VERSION 11 @@ -926,7 +927,11 @@ static void virtio_net_set_features(VirtIODevice *vdev, uint64_t features) qatomic_set(&n->failover_primary_hidden, false); failover_add_primary(n, &err); if (err) { - warn_report_err(err); + if (!qtest_enabled()) { + warn_report_err(err); + } else { + error_free(err); + } } } } |