aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2020-10-21 17:27:21 -0400
committerDr. David Alan Gilbert <dgilbert@redhat.com>2020-10-26 16:15:04 +0000
commita47295014de56e108f359ec859d5499b851f62b8 (patch)
tree747063a0318eee9983167e912f15332f9c0a448a
parentd246ea5039fd6d5344becd0943fcbb7f8e6bbfe7 (diff)
migration-test: Only hide error if !QTEST_LOG
The errors are very useful when debugging qtest failures, especially when QTEST_LOG=1 is set. Let's allow override MigrateStart.hide_stderr when QTEST_LOG=1 is specified, because that means the user wants to be verbose. Not very nice to introduce the first QTEST_LOG env access in migration-test.c, however it should be handy. Without this patch, I was hacking error_report() when debugging such errors. Let's make things easier. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20201021212721.440373-7-peterx@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
-rw-r--r--tests/qtest/migration-test.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index f410ec5996..f2142fbd3c 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -464,6 +464,10 @@ static void migrate_postcopy_start(QTestState *from, QTestState *to)
}
typedef struct {
+ /*
+ * QTEST_LOG=1 may override this. When QTEST_LOG=1, we always dump errors
+ * unconditionally, because it means the user would like to be verbose.
+ */
bool hide_stderr;
bool use_shmem;
/* only launch the target process */
@@ -557,7 +561,7 @@ static int test_migrate_start(QTestState **from, QTestState **to,
g_free(bootpath);
- if (args->hide_stderr) {
+ if (!getenv("QTEST_LOG") && args->hide_stderr) {
ignore_stderr = "2>/dev/null";
} else {
ignore_stderr = "";