qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests/qtest/migration-test: Do not try to print NULL pointer string
@ 2022-10-17 10:55 Thomas Huth
  2022-10-17 11:43 ` Markus Armbruster
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Huth @ 2022-10-17 10:55 UTC (permalink / raw)
  To: qemu-devel, bin.meng; +Cc: qemu-trivial, Juan Quintela, Dr. David Alan Gilbert

If tmpfs is NULL, we should not try to print it as a string.

Reported-by: shengjiangwuqq on github.com
Fixes: e5553c1b8d ("tests/qtest: migration-test: Avoid using hardcoded /tmp")
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/migration-test.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index ef4427ff4d..de70611f50 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -2481,8 +2481,7 @@ 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("g_dir_make_tmp failed: %s", err->message);
     }
     g_assert(tmpfs);
 
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tests/qtest/migration-test: Do not try to print NULL pointer string
  2022-10-17 10:55 [PATCH] tests/qtest/migration-test: Do not try to print NULL pointer string Thomas Huth
@ 2022-10-17 11:43 ` Markus Armbruster
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Armbruster @ 2022-10-17 11:43 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-devel, bin.meng, qemu-trivial, Juan Quintela,
	Dr. David Alan Gilbert

Thomas Huth <thuth@redhat.com> writes:

> If tmpfs is NULL, we should not try to print it as a string.
>
> Reported-by: shengjiangwuqq on github.com
> Fixes: e5553c1b8d ("tests/qtest: migration-test: Avoid using hardcoded /tmp")
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  tests/qtest/migration-test.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
> index ef4427ff4d..de70611f50 100644
> --- a/tests/qtest/migration-test.c
> +++ b/tests/qtest/migration-test.c
> @@ -2481,8 +2481,7 @@ 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("g_dir_make_tmp failed: %s", err->message);
>      }
>      g_assert(tmpfs);

Reviewed-by: Markus Armbruster <armbru@redhat.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-17 11:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-17 10:55 [PATCH] tests/qtest/migration-test: Do not try to print NULL pointer string Thomas Huth
2022-10-17 11:43 ` Markus Armbruster

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).