]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
test: qemu: Fix error message when populating fd groups
authorPeter Krempa <pkrempa@redhat.com>
Thu, 7 May 2026 10:37:17 +0000 (12:37 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 12 May 2026 11:37:11 +0000 (13:37 +0200)
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>
tests/testutilsqemu.c

index e9bdbdbbe7eb54bbca5e97a95e18167a23d3e2d7..e7a61d0c6fae45b98e9bfb8b17ed2918f44537cb 100644 (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();
                 }