[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/16] migration-test: Only hide error if !QTEST_LOG
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PULL 16/16] migration-test: Only hide error if !QTEST_LOG |
Date: |
Mon, 26 Oct 2020 16:19:52 +0000 |
From: Peter Xu <peterx@redhat.com>
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>
---
tests/qtest/migration-test.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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 = "";
--
2.28.0
- [PULL 06/16] migration: Add braces {} for if statement, (continued)
- [PULL 06/16] migration: Add braces {} for if statement, Dr. David Alan Gilbert (git), 2020/10/26
- [PULL 07/16] migration: Do not initialise statics and globals to 0 or NULL, Dr. David Alan Gilbert (git), 2020/10/26
- [PULL 08/16] migration: Open brace '{' following function declarations go on the next line, Dr. David Alan Gilbert (git), 2020/10/26
- [PULL 09/16] migration: Delete redundant spaces, Dr. David Alan Gilbert (git), 2020/10/26
- [PULL 11/16] migration: Pass incoming state into qemu_ufd_copy_ioctl(), Dr. David Alan Gilbert (git), 2020/10/26
- [PULL 10/16] migration: using trace_ to replace DPRINTF, Dr. David Alan Gilbert (git), 2020/10/26
- [PULL 12/16] migration: Introduce migrate_send_rp_message_req_pages(), Dr. David Alan Gilbert (git), 2020/10/26
- [PULL 13/16] migration: Maintain postcopy faulted addresses, Dr. David Alan Gilbert (git), 2020/10/26
- [PULL 15/16] migration/postcopy: Release fd before going into 'postcopy-pause', Dr. David Alan Gilbert (git), 2020/10/26
- [PULL 14/16] migration: Sync requested pages after postcopy recovery, Dr. David Alan Gilbert (git), 2020/10/26
- [PULL 16/16] migration-test: Only hide error if !QTEST_LOG,
Dr. David Alan Gilbert (git) <=
- Re: [PULL 00/16] migration queue, no-reply, 2020/10/26
- Re: [PULL 00/16] migration queue, Peter Maydell, 2020/10/27
- Re: [PULL 00/16] migration queue, Christian Schoenebeck, 2020/10/31