On 06/02/2025 10.35, Daniel P. Berrangé wrote:
On Wed, Feb 05, 2025 at 10:24:08AM -0800, Richard Henderson wrote:
On 2/5/25 07:59, Daniel P. Berrangé wrote:
+
+'''
+Decorator to skip execution of a test on 32-bit targets
+Example:
+
+ @skipIf32BitTarget()
+'''
+def skipIf32BitTarget():
+ enoughBits = sys.maxsize > 2**32
This will work for true 32-bit hosts, and possibly for containers running
emulation, but it won't work for cross-compilation (x86_64 to i686 or
aarch64 to arm).
Perhaps "file qemu-system-foo" | grep "ELF 32-bit" ?
I don't know that we've actually selected the executable at this point though...
The QEMU_TEST_QEMU_BINARY env variable exists at all times, though
grepping for ELF format feels a bit icky.
We also know the location of the build directory, so was wondering if
anything there tells us whether the host target is 64-bit, but it
appears not be the case.
Maybe it's sufficient to wait for Richard's patch to get merged:
https://lore.kernel.org/qemu-devel/20250204215359.1238808-11-richard.hender...@linaro.org/
?
Thomas