* [PATCH] tests/9p: prevent potential error in do_local_xattr_limit()
@ 2026-07-03 15:38 Christian Schoenebeck
2026-07-06 6:57 ` Philippe Mathieu-Daudé
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Christian Schoenebeck @ 2026-07-03 15:38 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Greg Kurz, Peter Maydell
The local fs backend driver tests require that a dummy file is
created on the host side before running the xattr limit tests,
otherwise the test will fail because the file is expected to exist.
The original call of g_file_set_contents() didn't check its
return value, which might cause subsequent test checks to fail,
making it harder to identify the root cause.
Fix this by simply wrapping the call into a g_assert().
Fixes: 04a62cdfe873 ("tests/9p: add 3 xattr FID limit test cases (local fs driver)")
CID: 1660926
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
---
tests/qtest/virtio-9p-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c
index cfd3c02da4..692a0e8e3f 100644
--- a/tests/qtest/virtio-9p-test.c
+++ b/tests/qtest/virtio-9p-test.c
@@ -402,7 +402,7 @@ static void do_local_xattr_limit(QVirtio9P *v9p, int max_xattr)
/*
* this file must be created for the test to work with the 'local' fs driver
*/
- g_file_set_contents(test_file, "", 0, NULL);
+ g_assert(g_file_set_contents(test_file, "", 0, NULL));
/* the actual test code shared with the 'synth' fs driver tests */
do_xattr_limit(v9p, max_xattr, false);
--
2.47.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] tests/9p: prevent potential error in do_local_xattr_limit()
2026-07-03 15:38 [PATCH] tests/9p: prevent potential error in do_local_xattr_limit() Christian Schoenebeck
@ 2026-07-06 6:57 ` Philippe Mathieu-Daudé
2026-07-06 21:10 ` Pierrick Bouvier
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-06 6:57 UTC (permalink / raw)
To: Christian Schoenebeck, qemu-devel; +Cc: qemu-stable, Greg Kurz, Peter Maydell
On 3/7/26 17:38, Christian Schoenebeck wrote:
> The local fs backend driver tests require that a dummy file is
> created on the host side before running the xattr limit tests,
> otherwise the test will fail because the file is expected to exist.
>
> The original call of g_file_set_contents() didn't check its
> return value, which might cause subsequent test checks to fail,
> making it harder to identify the root cause.
>
> Fix this by simply wrapping the call into a g_assert().
>
> Fixes: 04a62cdfe873 ("tests/9p: add 3 xattr FID limit test cases (local fs driver)")
> CID: 1660926
> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> ---
> tests/qtest/virtio-9p-test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tests/9p: prevent potential error in do_local_xattr_limit()
2026-07-03 15:38 [PATCH] tests/9p: prevent potential error in do_local_xattr_limit() Christian Schoenebeck
2026-07-06 6:57 ` Philippe Mathieu-Daudé
@ 2026-07-06 21:10 ` Pierrick Bouvier
2026-07-06 21:14 ` Philippe Mathieu-Daudé
2026-07-07 17:17 ` Christian Schoenebeck
3 siblings, 0 replies; 5+ messages in thread
From: Pierrick Bouvier @ 2026-07-06 21:10 UTC (permalink / raw)
To: Christian Schoenebeck, qemu-devel; +Cc: qemu-stable, Greg Kurz, Peter Maydell
On 7/3/2026 8:38 AM, Christian Schoenebeck wrote:
> The local fs backend driver tests require that a dummy file is
> created on the host side before running the xattr limit tests,
> otherwise the test will fail because the file is expected to exist.
>
> The original call of g_file_set_contents() didn't check its
> return value, which might cause subsequent test checks to fail,
> making it harder to identify the root cause.
>
> Fix this by simply wrapping the call into a g_assert().
>
> Fixes: 04a62cdfe873 ("tests/9p: add 3 xattr FID limit test cases (local fs driver)")
> CID: 1660926
> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> ---
> tests/qtest/virtio-9p-test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tests/9p: prevent potential error in do_local_xattr_limit()
2026-07-03 15:38 [PATCH] tests/9p: prevent potential error in do_local_xattr_limit() Christian Schoenebeck
2026-07-06 6:57 ` Philippe Mathieu-Daudé
2026-07-06 21:10 ` Pierrick Bouvier
@ 2026-07-06 21:14 ` Philippe Mathieu-Daudé
2026-07-07 17:17 ` Christian Schoenebeck
3 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-06 21:14 UTC (permalink / raw)
To: Christian Schoenebeck, qemu-devel; +Cc: qemu-stable, Greg Kurz, Peter Maydell
On 3/7/26 17:38, Christian Schoenebeck wrote:
> The local fs backend driver tests require that a dummy file is
> created on the host side before running the xattr limit tests,
> otherwise the test will fail because the file is expected to exist.
>
> The original call of g_file_set_contents() didn't check its
> return value, which might cause subsequent test checks to fail,
> making it harder to identify the root cause.
>
> Fix this by simply wrapping the call into a g_assert().
>
> Fixes: 04a62cdfe873 ("tests/9p: add 3 xattr FID limit test cases (local fs driver)")
> CID: 1660926
> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> ---
> tests/qtest/virtio-9p-test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Tested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] tests/9p: prevent potential error in do_local_xattr_limit()
2026-07-03 15:38 [PATCH] tests/9p: prevent potential error in do_local_xattr_limit() Christian Schoenebeck
` (2 preceding siblings ...)
2026-07-06 21:14 ` Philippe Mathieu-Daudé
@ 2026-07-07 17:17 ` Christian Schoenebeck
3 siblings, 0 replies; 5+ messages in thread
From: Christian Schoenebeck @ 2026-07-07 17:17 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable, Greg Kurz
On Friday, 3 July 2026 17:38:10 CEST Christian Schoenebeck wrote:
> The local fs backend driver tests require that a dummy file is
> created on the host side before running the xattr limit tests,
> otherwise the test will fail because the file is expected to exist.
>
> The original call of g_file_set_contents() didn't check its
> return value, which might cause subsequent test checks to fail,
> making it harder to identify the root cause.
>
> Fix this by simply wrapping the call into a g_assert().
>
> Fixes: 04a62cdfe873 ("tests/9p: add 3 xattr FID limit test cases (local fs
> driver)") CID: 1660926
> Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> ---
> tests/qtest/virtio-9p-test.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Queued on 9p.next:
https://github.com/cschoenebeck/qemu/commits/9p.next
Thanks!
/Christian
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-07-07 17:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-03 15:38 [PATCH] tests/9p: prevent potential error in do_local_xattr_limit() Christian Schoenebeck
2026-07-06 6:57 ` Philippe Mathieu-Daudé
2026-07-06 21:10 ` Pierrick Bouvier
2026-07-06 21:14 ` Philippe Mathieu-Daudé
2026-07-07 17:17 ` Christian Schoenebeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.