qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] tests/qtest: migration-test: Fix [-Werror=format-overflow=] build warning
@ 2022-10-17 13:20 Bin Meng
  2022-10-17 13:20 ` [PATCH v2 2/2] tests/qtest: vhost-user-test: " Bin Meng
  2022-10-22 21:17 ` [PATCH v2 1/2] tests/qtest: migration-test: " Laurent Vivier
  0 siblings, 2 replies; 4+ messages in thread
From: Bin Meng @ 2022-10-17 13:20 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: Markus Armbruster, Bin Meng, Shengjiang Wu,
	Dr. David Alan Gilbert, Juan Quintela, Laurent Vivier,
	Paolo Bonzini, Thomas Huth

From: Bin Meng <bin.meng@windriver.com>

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

Changes in v2:
- improve the error message

 tests/qtest/migration-test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index ef4427ff4d..aa1ba179fa 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);
 
-- 
2.34.1



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

* [PATCH v2 2/2] tests/qtest: vhost-user-test: Fix [-Werror=format-overflow=] build warning
  2022-10-17 13:20 [PATCH v2 1/2] tests/qtest: migration-test: Fix [-Werror=format-overflow=] build warning Bin Meng
@ 2022-10-17 13:20 ` Bin Meng
  2022-10-22 21:17   ` Laurent Vivier
  2022-10-22 21:17 ` [PATCH v2 1/2] tests/qtest: migration-test: " Laurent Vivier
  1 sibling, 1 reply; 4+ messages in thread
From: Bin Meng @ 2022-10-17 13:20 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial
  Cc: Markus Armbruster, Bin Meng, Shengjiang Wu, Laurent Vivier,
	Paolo Bonzini, Thomas Huth

From: Bin Meng <bin.meng@windriver.com>

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: e6efe236c1d1 ("tests/qtest: vhost-user-test: Avoid using hardcoded /tmp")
Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
---

Changes in v2:
- improve the error message

 tests/qtest/vhost-user-test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c
index e8d2da7228..bf9f7c4248 100644
--- a/tests/qtest/vhost-user-test.c
+++ b/tests/qtest/vhost-user-test.c
@@ -571,8 +571,8 @@ static TestServer *test_server_new(const gchar *name,
 
     tmpfs = g_dir_make_tmp("vhost-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_error_free(err);
     }
     g_assert(tmpfs);
-- 
2.34.1



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

* Re: [PATCH v2 1/2] tests/qtest: migration-test: Fix [-Werror=format-overflow=] build warning
  2022-10-17 13:20 [PATCH v2 1/2] tests/qtest: migration-test: Fix [-Werror=format-overflow=] build warning Bin Meng
  2022-10-17 13:20 ` [PATCH v2 2/2] tests/qtest: vhost-user-test: " Bin Meng
@ 2022-10-22 21:17 ` Laurent Vivier
  1 sibling, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2022-10-22 21:17 UTC (permalink / raw)
  To: Bin Meng, qemu-devel, qemu-trivial
  Cc: Markus Armbruster, Bin Meng, Shengjiang Wu,
	Dr. David Alan Gilbert, Juan Quintela, Laurent Vivier,
	Paolo Bonzini, Thomas Huth

Le 17/10/2022 à 15:20, Bin Meng a écrit :
> From: Bin Meng <bin.meng@windriver.com>
> 
> 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>
> ---
> 
> Changes in v2:
> - improve the error message
> 
>   tests/qtest/migration-test.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
> index ef4427ff4d..aa1ba179fa 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);
>   
Applied to my trivial-patches branch.

Thanks,
Laurent




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

* Re: [PATCH v2 2/2] tests/qtest: vhost-user-test: Fix [-Werror=format-overflow=] build warning
  2022-10-17 13:20 ` [PATCH v2 2/2] tests/qtest: vhost-user-test: " Bin Meng
@ 2022-10-22 21:17   ` Laurent Vivier
  0 siblings, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2022-10-22 21:17 UTC (permalink / raw)
  To: Bin Meng, qemu-devel, qemu-trivial
  Cc: Markus Armbruster, Bin Meng, Shengjiang Wu, Laurent Vivier,
	Paolo Bonzini, Thomas Huth

Le 17/10/2022 à 15:20, Bin Meng a écrit :
> From: Bin Meng <bin.meng@windriver.com>
> 
> 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: e6efe236c1d1 ("tests/qtest: vhost-user-test: Avoid using hardcoded /tmp")
> Signed-off-by: Bin Meng <bin.meng@windriver.com>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
> ---
> 
> Changes in v2:
> - improve the error message
> 
>   tests/qtest/vhost-user-test.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c
> index e8d2da7228..bf9f7c4248 100644
> --- a/tests/qtest/vhost-user-test.c
> +++ b/tests/qtest/vhost-user-test.c
> @@ -571,8 +571,8 @@ static TestServer *test_server_new(const gchar *name,
>   
>       tmpfs = g_dir_make_tmp("vhost-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_error_free(err);
>       }
>       g_assert(tmpfs);

Applied to my trivial-patches branch.

Thanks,
Laurent




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

end of thread, other threads:[~2022-10-24  5:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-17 13:20 [PATCH v2 1/2] tests/qtest: migration-test: Fix [-Werror=format-overflow=] build warning Bin Meng
2022-10-17 13:20 ` [PATCH v2 2/2] tests/qtest: vhost-user-test: " Bin Meng
2022-10-22 21:17   ` Laurent Vivier
2022-10-22 21:17 ` [PATCH v2 1/2] tests/qtest: migration-test: " Laurent Vivier

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