failover: Silence warning messages during qtest
PATCH 1/1 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.
--- hw/net/virtio-net.c | 3 ++- migration/migration.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-)
hw/net/virtio-net.c +2 -1
@@ -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
@@ -925,7 +926,7 @@ static void virtio_net_set_features(VirtIODevice *vdev, uint64_t features)qapi_event_send_failover_negotiated (n->netclient_name);qatomic_set (&n->failover_primary_hidden, false);failover_add_primary (n, &err); -if (err) { +if (err && !qtest_enabled ()) {warn_report_err (err); } }
migration/migration.c +3 -1
@@ -60,6 +60,7 @@#include "qemu/yank.h" #include "sysemu/cpus.h" #include "yank_functions.h" +#include "sysemu/qtest.h" #define MAX_THROTTLE (128 << 20)/* Migration transfer speed throttling */
@@ -3766,7 +3767,8 @@ static void qemu_savevm_wait_unplug(MigrationState *s, int old_state,while (timeout-- &&qemu_savevm_state_guest_unplug_pending ()) {qemu_sem_timedwait (&s->wait_unplug_sem,250 ); } -if (qemu_savevm_state_guest_unplug_pending ()) { +if (qemu_savevm_state_guest_unplug_pending () && + !qtest_enabled ()) {warn_report ("migration: partially unplugged device on " "failure" ); }
Signature · 1 line
2.33.1
Quoted 3 lines · Laurent Vivier
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
Typo "warnings".
Quoted 8 lines
sequence.
Reported-by Thomas Huth <[email protected]>Signed-off-by Laurent Vivier <[email protected]>--- hw/net/virtio-net.c | 3 ++- migration/migration.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-)
Quoted 9 lines · Laurent Vivier
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 <[email protected]>Signed-off-by Laurent Vivier <[email protected]>---
Quoted 50 lines
hw/net/virtio-net.c | 3 ++- migration/migration.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-)hw/net/virtio-net.c +2
-1@@ -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@@ -925,7 +926,7 @@ static void virtio_net_set_features(VirtIODevice *vdev, uint64_t features)qapi_event_send_failover_negotiated (n->netclient_name);qatomic_set (&n->failover_primary_hidden, false);failover_add_primary (n, &err); -if (err) { +if (err && !qtest_enabled ()) {warn_report_err (err); } }migration/migration.c +3
-2@@ -60,6 +60,7 @@#include "qemu/yank.h" #include "sysemu/cpus.h" #include "yank_functions.h" +#include "sysemu/qtest.h" #define MAX_THROTTLE (128 << 20)/* Migration transfer speed throttling */ @@ -3766,7 +3767,8 @@ static void qemu_savevm_wait_unplug(MigrationState *s, int old_state,while (timeout-- &&qemu_savevm_state_guest_unplug_pending ()) {qemu_sem_timedwait (&s->wait_unplug_sem,250 ); } -if (qemu_savevm_state_guest_unplug_pending ()) { +if (qemu_savevm_state_guest_unplug_pending () && + !qtest_enabled ()) {warn_report ("migration: partially unplugged device on " "failure" ); } --2.33.1
Quoted 25 lines · Laurent Vivier
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 <[email protected]>Signed-off-by Laurent Vivier <[email protected]>--- hw/net/virtio-net.c | 3 ++- migration/migration.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-)hw/net/virtio-net.c +1
-0@@ -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
hw/net/virtio-net.c static void virtio_net_set_features(VirtIODevice *vdev, uint64_t features) · line 931
Quoted 7 lines
hw/net/virtio-net.c +1
-1@@ -925,7 +926,7 @@ static void virtio_net_set_features(VirtIODevice *vdev, uint64_t features)qapi_event_send_failover_negotiated (n->netclient_name);qatomic_set (&n->failover_primary_hidden, false);failover_add_primary (n, &err); -if (err) { +if (err && !qtest_enabled ()) {warn_report_err (err); }
This trips the sanitizer build now:
https://gitlab.com/thuth/qemu/-/jobs/1907374419
I think you have to error_free(err) in case qtest_enabled() ?
Thomas
Quoted 35 lines · Thomas Huth
Quoted 23 lines · Laurent Vivier
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 <[email protected]>Signed-off-by Laurent Vivier <[email protected]>---
hw/net/virtio-net.c | 3 ++-
migration/migration.c| 4 +++-2 files changed, 5 insertions(+), 2 deletions(-)hw/net/virtio-net.c +1
-0@@ -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@@ -925,7 +926,7 @@ static void virtio_net_set_features(VirtIODevice
Quoted 8 lines
*vdev,
uint64_tfeatures)qapi_event_send_failover_negotiated(n->netclient_name);qatomic_set(&n->failover_primary_hidden, false);failover_add_primary(n, &err);
- if (err) {
+ if (err && !qtest_enabled()) {warn_report_err(err);
}This trips the sanitizer build now:
Quoted 3 lines
https://gitlab.com/thuth/qemu/-/jobs/1907374419
I think you have to
error_free(err)in caseqtest_enabled()?
Indeed. In that case it might be better to add awarn_report_err_except_qtest() helper...