test: qemu: Fix error message when populating fd groups

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>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Peter Krempa committed 2026-05-12 13:37:11 +02:00
1 parent 59197dc16f
commit c3af80575b
1 file changed
+1 -1
+1 -1
View File
@@ -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();
}