aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest
diff options
context:
space:
mode:
authorBin Meng <bin.meng@windriver.com>2022-10-17 21:20:22 +0800
committerLaurent Vivier <laurent@vivier.eu>2022-10-22 23:16:37 +0200
commitb1f6208cf986a60e1c9f8b960db5a00851f48f98 (patch)
tree235e6aa7bb9df2f8f079109efb078ba6f871ba5c /tests/qtest
parent0a553c12c71d5627abf223a926ab9688a5573f54 (diff)
downloadqemu-b1f6208cf986a60e1c9f8b960db5a00851f48f98.zip
qemu-b1f6208cf986a60e1c9f8b960db5a00851f48f98.tar.gz
qemu-b1f6208cf986a60e1c9f8b960db5a00851f48f98.tar.bz2
tests/qtest: migration-test: Fix [-Werror=format-overflow=] build warning
When tmpfs is NULL, a build warning is seen with GCC 9.3.0. It's strange that GCC 11.2.0 on Ubuntu 22.04 does not catch this, neither did the QEMU CI. While we are here, improve the error message as well. Reported-by: Shengjiang Wu <shengjiang.wu@windriver.com> Fixes: e5553c1b8d28 ("tests/qtest: migration-test: Avoid using hardcoded /tmp") Signed-off-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20221017132023.2228641-1-bmeng.cn@gmail.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'tests/qtest')
-rw-r--r--tests/qtest/migration-test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index ef4427f..aa1ba17 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -2481,8 +2481,8 @@ int main(int argc, char **argv)
tmpfs = g_dir_make_tmp("migration-test-XXXXXX", &err);
if (!tmpfs) {
- g_test_message("g_dir_make_tmp on path (%s): %s", tmpfs,
- err->message);
+ g_test_message("Can't create temporary directory in %s: %s",
+ g_get_tmp_dir(), err->message);
}
g_assert(tmpfs);