From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Thomas Huth <thuth@redhat.com>,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
peterx@redhat.com, Juan Quintela <quintela@redhat.com>
Subject: [PATCH v5 6/6] migration-test: Only hide error if !QTEST_LOG
Date: Mon, 19 Oct 2020 18:57:20 -0400 [thread overview]
Message-ID: <20201019225720.172743-7-peterx@redhat.com> (raw)
In-Reply-To: <20201019225720.172743-1-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>
---
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 00a233cd8c..ff9ed70029 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -461,6 +461,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 */
@@ -554,7 +558,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.26.2
prev parent reply other threads:[~2020-10-19 23:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-19 22:57 [PATCH v5 0/6] migration/postcopy: Sync faulted addresses after network recovered Peter Xu
2020-10-19 22:57 ` [PATCH v5 1/6] migration: Pass incoming state into qemu_ufd_copy_ioctl() Peter Xu
2020-10-19 22:57 ` [PATCH v5 2/6] migration: Introduce migrate_send_rp_message_req_pages() Peter Xu
2020-10-19 22:57 ` [PATCH v5 3/6] migration: Maintain postcopy faulted addresses Peter Xu
2020-10-21 14:23 ` Dr. David Alan Gilbert
2020-10-21 15:50 ` Peter Xu
2020-10-21 17:42 ` Dr. David Alan Gilbert
2020-10-21 18:04 ` Peter Xu
2020-10-19 22:57 ` [PATCH v5 4/6] migration: Sync requested pages after postcopy recovery Peter Xu
2020-10-21 14:37 ` Dr. David Alan Gilbert
2020-10-19 22:57 ` [PATCH v5 5/6] migration/postcopy: Release fd before going into 'postcopy-pause' Peter Xu
2020-10-21 18:56 ` Dr. David Alan Gilbert
2020-10-19 22:57 ` Peter Xu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201019225720.172743-7-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=dgilbert@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).