[PATCH] test: qemu: Fix error message when populating fd groups
From: Peter Krempa <pkrempa@redhat.com> The 'new->fds' array is not yet initialized at the point where the check if the FD is occupied happens so the error would always report that FD '0' is in use. Use 'new->testfds' instead. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/testutilsqemu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index e9bdbdbbe7..e7a61d0c6f 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -727,7 +727,7 @@ testQemuInfoSetArgs(testQemuInfo *info, new->testfds[i] = va_arg(argptr, unsigned int); if (fcntl(new->testfds[i], F_GETFD) != -1) { - fprintf(stderr, "fd '%d' is already in use\n", new->fds[i]); + fprintf(stderr, "fd '%d' is already in use\n", new->testfds[i]); abort(); } -- 2.54.0
On Tue, May 12, 2026 at 10:03:31AM +0200, Peter Krempa via Devel wrote:
From: Peter Krempa <pkrempa@redhat.com>
The 'new->fds' array is not yet initialized at the point where the check if the FD is occupied happens so the error would always report that FD '0' is in use. Use 'new->testfds' instead.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- tests/testutilsqemu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
participants (2)
-
Pavel Hrdina -
Peter Krempa