Skip to contentSkip to conversation

Functional test patches and 32-bit arm Linux header removal

GIT PULL Applied Thomas Huth 2 participants 7 messages Jul 21, 2025 Broadcom iproc Arm architecture

lore
Share & tools
lore
#0 lore raw

The following changes since commit e82989544e38062beeeaad88c175afbeed0400f8:

Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2025-07-18 14:10:02 -0400)

are available in the Git repository at:

https://gitlab.com/thuth/qemu.git tags/pull-request-2025-07-21

for you to fetch changes up to 2c182e1213a0fd334f13948cb80b886e6fd1ab88:

docs/devel: fix over-quoting of QEMU_TEST_KEEP_SCRATCH (2025-07-21 07:58:57 +0200)

----------------------------------------------------------------
* Remove unused 32-bit arm Linux headers
* Fix some small issues in the functional tests and docs

----------------------------------------------------------------
Alex Bennée (1):
docs/devel: fix over-quoting of QEMU_TEST_KEEP_SCRATCH

Daniel P. Berrangé (3):
functional: ensure log handlers are closed
functional: ensure sockets and files are closed
functional: always enable all python warnings

Thomas Huth (1):
linux-headers: Remove the 32-bit arm headers

 docs/devel/testing/functional.rst      |   2 +-
 configure                              |   1 -
 linux-headers/asm-arm/bitsperlong.h    |   1 -
 linux-headers/asm-arm/kvm.h            | 312 --------------------------
 linux-headers/asm-arm/mman.h           |   4 -
 linux-headers/asm-arm/unistd-common.h  | 397 ---------------------------------
 linux-headers/asm-arm/unistd-eabi.h    |   5 -
 linux-headers/asm-arm/unistd-oabi.h    |  17 --
 linux-headers/asm-arm/unistd.h         |  41 ----
 scripts/update-linux-headers.sh        |   5 -
 tests/functional/qemu_test/testcase.py |   6 +
 tests/functional/test_multiprocess.py  |   3 +
 tests/functional/test_virtio_gpu.py    |   2 +
 13 files changed, 12 insertions(+), 784 deletions(-)
 delete mode 100644 linux-headers/asm-arm/bitsperlong.h
 delete mode 100644 linux-headers/asm-arm/kvm.h
 delete mode 100644 linux-headers/asm-arm/mman.h
 delete mode 100644 linux-headers/asm-arm/unistd-common.h
 delete mode 100644 linux-headers/asm-arm/unistd-eabi.h
 delete mode 100644 linux-headers/asm-arm/unistd-oabi.h
 delete mode 100644 linux-headers/asm-arm/unistd.h
#1 lore raw

[PULL 1/5] linux-headers: Remove the 32-bit arm headers

From: Thomas Huth <[email protected]>

KVM support for 32-bit arm has been dropped a while ago, so we don't need these headers in QEMU anymore.

Fixes 82bf7ae84ce ("target/arm: Remove KVM support for 32-bit Arm hosts")

Message-ID: <[email protected]>

---
 configure                             |   1 -
 linux-headers/asm-arm/bitsperlong.h   |   1 -
 linux-headers/asm-arm/kvm.h           | 312 --------------------
 linux-headers/asm-arm/mman.h          |   4 -
 linux-headers/asm-arm/unistd-common.h | 397 --------------------------
 linux-headers/asm-arm/unistd-eabi.h   |   5 -
 linux-headers/asm-arm/unistd-oabi.h   |  17 --
 linux-headers/asm-arm/unistd.h        |  41 ---
 scripts/update-linux-headers.sh       |   5 -
 9 files changed, 783 deletions(-)
 delete mode 100644 linux-headers/asm-arm/bitsperlong.h
 delete mode 100644 linux-headers/asm-arm/kvm.h
 delete mode 100644 linux-headers/asm-arm/mman.h
 delete mode 100644 linux-headers/asm-arm/unistd-common.h
 delete mode 100644 linux-headers/asm-arm/unistd-eabi.h
 delete mode 100644 linux-headers/asm-arm/unistd-oabi.h
 delete mode 100644 linux-headers/asm-arm/unistd.h
configure +0 -1
index 2b2b3d65979..95f67c1a827 100755
@@ -453,7 +453,6 @@ case "$cpu" in
   armv*b|armv*l|arm)
     cpu=arm
     host_arch=arm
-    linux_arch=arm
     ;;
 
   i386|i486|i586|i686)
linux-headers/asm-arm/bitsperlong.h deleted +0 -1
deleted file mode 100644
index 6dc0bb0c13b..00000000000
@@ -1 +0,0 @@
-#include <asm-generic/bitsperlong.h>
linux-headers/asm-arm/kvm.h deleted +0 -312

312 lines not on this page · raw message

linux-headers/asm-arm/mman.h deleted +0 -4
deleted file mode 100644
index 41f99c573b9..00000000000
@@ -1,4 +0,0 @@
-#include <asm-generic/mman.h>
-
-#define arch_mmap_check(addr, len, flags) \
-	(((flags) & MAP_FIXED && (addr) < FIRST_USER_ADDRESS) ? -EINVAL : 0)
linux-headers/asm-arm/unistd-common.h deleted +0 -397

397 lines not on this page · raw message

linux-headers/asm-arm/unistd-eabi.h deleted +0 -5
deleted file mode 100644
index 266f1fcdfb3..00000000000
@@ -1,5 +0,0 @@
-#ifndef _ASM_ARM_UNISTD_EABI_H
-#define _ASM_ARM_UNISTD_EABI_H 1
-
-
-#endif /* _ASM_ARM_UNISTD_EABI_H */
linux-headers/asm-arm/unistd-oabi.h deleted +0 -17
deleted file mode 100644
index 47d9afb96d5..00000000000
@@ -1,17 +0,0 @@
-#ifndef _ASM_ARM_UNISTD_OABI_H
-#define _ASM_ARM_UNISTD_OABI_H 1
-
-#define __NR_time (__NR_SYSCALL_BASE + 13)
-#define __NR_umount (__NR_SYSCALL_BASE + 22)
-#define __NR_stime (__NR_SYSCALL_BASE + 25)
-#define __NR_alarm (__NR_SYSCALL_BASE + 27)
-#define __NR_utime (__NR_SYSCALL_BASE + 30)
-#define __NR_getrlimit (__NR_SYSCALL_BASE + 76)
-#define __NR_select (__NR_SYSCALL_BASE + 82)
-#define __NR_readdir (__NR_SYSCALL_BASE + 89)
-#define __NR_mmap (__NR_SYSCALL_BASE + 90)
-#define __NR_socketcall (__NR_SYSCALL_BASE + 102)
-#define __NR_syscall (__NR_SYSCALL_BASE + 113)
-#define __NR_ipc (__NR_SYSCALL_BASE + 117)
-
-#endif /* _ASM_ARM_UNISTD_OABI_H */
linux-headers/asm-arm/unistd.h deleted +0 -41

41 lines not on this page · raw message

scripts/update-linux-headers.sh +0 -5
index b43b8ef75a6..717c379f9e0 100755
@@ -156,11 +156,6 @@ EOF
         cp "$hdrdir/include/asm/unistd_32.h" "$output/linux-headers/asm-s390/"
         cp "$hdrdir/include/asm/unistd_64.h" "$output/linux-headers/asm-s390/"
     fi
-    if [ $arch = arm ]; then
-        cp "$hdrdir/include/asm/unistd-eabi.h" "$output/linux-headers/asm-arm/"
-        cp "$hdrdir/include/asm/unistd-oabi.h" "$output/linux-headers/asm-arm/"
-        cp "$hdrdir/include/asm/unistd-common.h" "$output/linux-headers/asm-arm/"
-    fi
     if [ $arch = arm64 ]; then
         cp "$hdrdir/include/asm/sve_context.h" "$output/linux-headers/asm-arm64/"
         cp "$hdrdir/include/asm/unistd_64.h" "$output/linux-headers/asm-arm64/"
Signature · 1 line
2.50.0
#2 lore raw

[PULL 2/5] functional: ensure log handlers are closed

In reply to Thomas Huth

From: Daniel P. Berrangé <[email protected]>

This avoids a resource leak warning from python when the log handler is garbage collected.

Message-ID: <[email protected]>

---
 tests/functional/qemu_test/testcase.py | 2 ++
 1 file changed, 2 insertions(+)
tests/functional/qemu_test/testcase.py +2 -0
index 2082c6fce43..71c7160adcf 100644
@@ -232,6 +232,7 @@ def tearDown(self):
             self.socketdir = None
         self.machinelog.removeHandler(self._log_fh)
         self.log.removeHandler(self._log_fh)
+        self._log_fh.close()
 
     def main():
         path = os.path.basename(sys.argv[0])[:-3]
@@ -399,4 +400,5 @@ def tearDown(self):
         for vm in self._vms.values():
             vm.shutdown()
         logging.getLogger('console').removeHandler(self._console_log_fh)
+        self._console_log_fh.close()
         super().tearDown()
Signature · 1 line
2.50.0
#3 lore raw

[PULL 3/5] functional: ensure sockets and files are closed

In reply to Thomas Huth

From: Daniel P. Berrangé <[email protected]>

The multiprocess and virtio_gpu tests open sockets but then forget to close them, which triggers resource leak warnings

The virtio_gpu test also fails to close a log file it opens.

Message-ID: <[email protected]>

---
 tests/functional/test_multiprocess.py | 3 +++
 tests/functional/test_virtio_gpu.py   | 2 ++
 2 files changed, 5 insertions(+)
tests/functional/test_multiprocess.py +3 -0
index 751cf10e635..92d5207b0eb 100755
@@ -83,6 +83,9 @@ def do_test(self, kernel_asset, initrd_asset,
                                           'cat /sys/bus/pci/devices/*/uevent',
                                           'PCI_ID=1000:0012')
 
+        proxy_sock.close()
+        remote_sock.close()
+
     def test_multiprocess(self):
         kernel_command_line = self.KERNEL_COMMON_COMMAND_LINE
         if self.arch == 'x86_64':
tests/functional/test_virtio_gpu.py +2 -0
index 81c9156d638..be96de24da2 100755
@@ -108,6 +108,7 @@ def test_vhost_user_vga_virgl(self):
             shell=False,
             close_fds=False,
         )
+        self._vug_log_file.close()
 
         self.vm.set_console()
         self.vm.add_args("-cpu", "host")
@@ -135,6 +136,7 @@ def test_vhost_user_vga_virgl(self):
                                           "features: +virgl +edid")
         self.vm.shutdown()
         qemu_sock.close()
+        vug_sock.close()
         vugp.terminate()
         vugp.wait()
 
Signature · 1 line
2.50.0
#4 lore raw

[PULL 4/5] functional: always enable all python warnings

In reply to Thomas Huth

From: Daniel P. Berrangé <[email protected]>

Of most importance is that this gives us a heads-up if anything we rely on has been deprecated. The default python behaviour only emits a warning if triggered from __main__ which is very limited.

Setting the env variable further ensures that any python child processes will also display warnings.

Message-ID: <[email protected]>

---
 tests/functional/qemu_test/testcase.py | 4 ++++
 1 file changed, 4 insertions(+)
tests/functional/qemu_test/testcase.py +4 -0
index 71c7160adcf..2a78e735f16 100644
@@ -19,6 +19,7 @@
 from subprocess import run
 import sys
 import tempfile
+import warnings
 import unittest
 import uuid
 
@@ -235,6 +236,9 @@ def tearDown(self):
         self._log_fh.close()
 
     def main():
+        warnings.simplefilter("default")
+        os.environ["PYTHONWARNINGS"] = "default"
+
         path = os.path.basename(sys.argv[0])[:-3]
 
         cache = os.environ.get("QEMU_TEST_PRECACHE", None)
Signature · 1 line
2.50.0
#5 lore raw

[PULL 5/5] docs/devel: fix over-quoting of QEMU_TEST_KEEP_SCRATCH

In reply to Thomas Huth

From: Alex Bennée <[email protected]>

Message-ID: <[email protected]>

---
 docs/devel/testing/functional.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
docs/devel/testing/functional.rst +1 -1
index 9e56dd1b118..3728bab6c0c 100644
@@ -65,7 +65,7 @@ directory should be your build folder. For example::
 
 The test framework will automatically purge any scratch files created during
 the tests. If needing to debug a failed test, it is possible to keep these
-files around on disk by setting ```QEMU_TEST_KEEP_SCRATCH=1``` as an env
+files around on disk by setting ``QEMU_TEST_KEEP_SCRATCH=1`` as an env
 variable.  Any preserved files will be deleted the next time the test is run
 without this variable set.
 
Signature · 1 line
2.50.0