* [PULL 01/10] travis.yml: Remove the aarch64 job
2025-06-11 12:58 [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...) Thomas Huth
@ 2025-06-11 12:58 ` Thomas Huth
2025-06-11 12:58 ` [PULL 02/10] hw/s390x/s390-virtio-ccw: Remove the deprecated 4.1 machine type Thomas Huth
` (9 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2025-06-11 12:58 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi
From: Thomas Huth <thuth@redhat.com>
According to:
https://docs.travis-ci.com/user/billing-overview/#partner-queue-solution
only s390x and ppc64le are still part of the free OSS tier in Travis.
aarch64 has been removed sometime during the last year. Thus remove
the aarch64 job from our .travis.yml file now to avoid that someone
burns non-OSS CI credits with this job by accident now.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250530115454.187727-1-thuth@redhat.com>
---
.travis.yml | 35 -----------------------------------
1 file changed, 35 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 8fc1ae0cf22..0a634d7b4a0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -79,41 +79,6 @@ after_script:
jobs:
include:
- - name: "[aarch64] GCC check-tcg"
- arch: arm64
- addons:
- apt_packages:
- - libaio-dev
- - libattr1-dev
- - libbrlapi-dev
- - libcacard-dev
- - libcap-ng-dev
- - libfdt-dev
- - libgcrypt20-dev
- - libgnutls28-dev
- - libgtk-3-dev
- - libiscsi-dev
- - liblttng-ust-dev
- - libncurses5-dev
- - libnfs-dev
- - libpixman-1-dev
- - libpng-dev
- - librados-dev
- - libsdl2-dev
- - libseccomp-dev
- - liburcu-dev
- - libusb-1.0-0-dev
- - libvdeplug-dev
- - libvte-2.91-dev
- - ninja-build
- - python3-tomli
- # Tests dependencies
- - genisoimage
- env:
- - TEST_CMD="make check check-tcg V=1"
- - CONFIG="--disable-containers --enable-fdt=system
- --target-list=${MAIN_SYSTEM_TARGETS} --cxx=/bin/false"
-
- name: "[ppc64] Clang check-tcg"
arch: ppc64le
compiler: clang
--
2.49.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PULL 02/10] hw/s390x/s390-virtio-ccw: Remove the deprecated 4.1 machine type
2025-06-11 12:58 [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...) Thomas Huth
2025-06-11 12:58 ` [PULL 01/10] travis.yml: Remove the aarch64 job Thomas Huth
@ 2025-06-11 12:58 ` Thomas Huth
2025-06-11 12:58 ` [PULL 03/10] tests/functional: Use the 'none' machine for the VNC test Thomas Huth
` (8 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2025-06-11 12:58 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi
From: Thomas Huth <thuth@redhat.com>
With the upcoming release of QEMU 10.1, the s390-ccw-virtio-4.1 machine
will be older than 6 years, so according to our machine support policy,
it can be removed now. The V4_1 CPU feature group gets merged into the
minimum CPU feature group now.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250519054744.36715-1-thuth@redhat.com>
---
hw/s390x/s390-virtio-ccw.c | 14 --------------
target/s390x/gen-features.c | 4 ----
2 files changed, 18 deletions(-)
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index f69a4d8ed31..ce3c13defb5 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -1145,20 +1145,6 @@ static void ccw_machine_4_2_class_options(MachineClass *mc)
}
DEFINE_CCW_MACHINE(4, 2);
-static void ccw_machine_4_1_instance_options(MachineState *machine)
-{
- static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V4_1 };
- ccw_machine_4_2_instance_options(machine);
- s390_set_qemu_cpu_model(0x2964, 13, 2, qemu_cpu_feat);
-}
-
-static void ccw_machine_4_1_class_options(MachineClass *mc)
-{
- ccw_machine_4_2_class_options(mc);
- compat_props_add(mc->compat_props, hw_compat_4_1, hw_compat_4_1_len);
-}
-DEFINE_CCW_MACHINE(4, 1);
-
static void ccw_machine_register_types(void)
{
type_register_static(&ccw_machine_info);
diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c
index a814ece82f2..8218e6470ec 100644
--- a/target/s390x/gen-features.c
+++ b/target/s390x/gen-features.c
@@ -884,9 +884,6 @@ static uint16_t qemu_MIN[] = {
*/
S390_FEAT_FLOATING_POINT_EXT,
S390_FEAT_ZPCI,
-};
-
-static uint16_t qemu_V4_1[] = {
S390_FEAT_STFLE_53,
S390_FEAT_VECTOR,
};
@@ -1049,7 +1046,6 @@ static FeatGroupDefSpec FeatGroupDef[] = {
*******************************/
static FeatGroupDefSpec QemuFeatDef[] = {
QEMU_FEAT_INITIALIZER(MIN),
- QEMU_FEAT_INITIALIZER(V4_1),
QEMU_FEAT_INITIALIZER(V6_0),
QEMU_FEAT_INITIALIZER(V6_2),
QEMU_FEAT_INITIALIZER(V7_0),
--
2.49.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PULL 03/10] tests/functional: Use the 'none' machine for the VNC test
2025-06-11 12:58 [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...) Thomas Huth
2025-06-11 12:58 ` [PULL 01/10] travis.yml: Remove the aarch64 job Thomas Huth
2025-06-11 12:58 ` [PULL 02/10] hw/s390x/s390-virtio-ccw: Remove the deprecated 4.1 machine type Thomas Huth
@ 2025-06-11 12:58 ` Thomas Huth
2025-06-11 12:58 ` [PULL 04/10] tests/functional: Speed up the avr_mega2560 test Thomas Huth
` (7 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2025-06-11 12:58 UTC (permalink / raw)
To: qemu-devel
Cc: Stefan Hajnoczi, Daniel P. Berrangé,
Philippe Mathieu-Daudé
From: Thomas Huth <thuth@redhat.com>
The VNC test currently fails if the default machine ("pc" for x86)
has not been compiled into the binary. Since we also can test VNC
when QEMU just shows the default monitor, let's avoid this problem
by simply using the "none" machine (which is always available)
here instead.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250603103449.32499-1-thuth@redhat.com>
---
tests/functional/test_vnc.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/functional/test_vnc.py b/tests/functional/test_vnc.py
index 5c0ee5f9272..f1dd1597cf1 100755
--- a/tests/functional/test_vnc.py
+++ b/tests/functional/test_vnc.py
@@ -31,6 +31,7 @@ def check_connect(port: int) -> bool:
class Vnc(QemuSystemTest):
def test_no_vnc_change_password(self):
+ self.set_machine('none')
self.vm.add_args('-nodefaults', '-S')
self.vm.launch()
@@ -62,6 +63,7 @@ def launch_guarded(self):
raise excp
def test_change_password_requires_a_password(self):
+ self.set_machine('none')
self.vm.add_args('-nodefaults', '-S', '-vnc', ':1,to=999')
self.launch_guarded()
self.assertTrue(self.vm.qmp('query-vnc')['return']['enabled'])
@@ -74,6 +76,7 @@ def test_change_password_requires_a_password(self):
'Could not set password')
def test_change_password(self):
+ self.set_machine('none')
self.vm.add_args('-nodefaults', '-S', '-vnc', ':1,to=999,password=on')
self.launch_guarded()
self.assertTrue(self.vm.qmp('query-vnc')['return']['enabled'])
@@ -103,6 +106,7 @@ def do_test_change_listen(self, a, b, c):
self.assertTrue(check_connect(c))
def test_change_listen(self):
+ self.set_machine('none')
with Ports() as ports:
a, b, c = ports.find_free_ports(3)
self.do_test_change_listen(a, b, c)
--
2.49.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PULL 04/10] tests/functional: Speed up the avr_mega2560 test
2025-06-11 12:58 [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...) Thomas Huth
` (2 preceding siblings ...)
2025-06-11 12:58 ` [PULL 03/10] tests/functional: Use the 'none' machine for the VNC test Thomas Huth
@ 2025-06-11 12:58 ` Thomas Huth
2025-06-11 12:58 ` [PULL 05/10] tests/functional: add skipLockedMemoryTest decorator Thomas Huth
` (6 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2025-06-11 12:58 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi, Philippe Mathieu-Daudé, Mark Cave-Ayland
From: Thomas Huth <thuth@redhat.com>
We can simply check for the expected pattern on the console,
no need to wait for two seconds here to search for the pattern
in the log at the end.
While we're at it, also remove the obsolete "timeout" variable
from this test.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250603184710.25651-1-thuth@redhat.com>
---
tests/functional/test_avr_mega2560.py | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/tests/functional/test_avr_mega2560.py b/tests/functional/test_avr_mega2560.py
index 8e47b4200b1..6359b72af39 100755
--- a/tests/functional/test_avr_mega2560.py
+++ b/tests/functional/test_avr_mega2560.py
@@ -18,12 +18,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-import time
+from qemu_test import QemuSystemTest, Asset, wait_for_console_pattern
-from qemu_test import QemuSystemTest, Asset
class AVR6Machine(QemuSystemTest):
- timeout = 5
ASSET_ROM = Asset(('https://github.com/seharris/qemu-avr-tests'
'/raw/36c3e67b8755dcf/free-rtos/Demo'
@@ -40,13 +38,12 @@ def test_freertos(self):
self.set_machine('arduino-mega-2560-v3')
self.vm.add_args('-bios', rom_path)
self.vm.add_args('-nographic')
+ self.vm.set_console()
self.vm.launch()
- time.sleep(2)
- self.vm.shutdown()
+ wait_for_console_pattern(self,
+ 'XABCDEFGHIJKLMNOPQRSTUVWXABCDEFGHIJKLMNOPQRSTUVWXA')
- self.assertIn('ABCDEFGHIJKLMNOPQRSTUVWXABCDEFGHIJKLMNOPQRSTUVWX',
- self.vm.get_log())
if __name__ == '__main__':
QemuSystemTest.main()
--
2.49.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PULL 05/10] tests/functional: add skipLockedMemoryTest decorator
2025-06-11 12:58 [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...) Thomas Huth
` (3 preceding siblings ...)
2025-06-11 12:58 ` [PULL 04/10] tests/functional: Speed up the avr_mega2560 test Thomas Huth
@ 2025-06-11 12:58 ` Thomas Huth
2025-06-11 12:58 ` [PULL 06/10] tests/functional: add memlock tests Thomas Huth
` (5 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2025-06-11 12:58 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi, Alexandr Moshkov
From: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
Used in future commit to skipping execution of a tests if the system's
locked memory limit is below the required threshold.
Signed-off-by: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250605065908.299979-2-dtalexundeer@yandex-team.ru>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/functional/qemu_test/__init__.py | 2 +-
tests/functional/qemu_test/decorators.py | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/tests/functional/qemu_test/__init__.py b/tests/functional/qemu_test/__init__.py
index af41c2c6a22..6e666a059fc 100644
--- a/tests/functional/qemu_test/__init__.py
+++ b/tests/functional/qemu_test/__init__.py
@@ -15,6 +15,6 @@
from .linuxkernel import LinuxKernelTest
from .decorators import skipIfMissingCommands, skipIfNotMachine, \
skipFlakyTest, skipUntrustedTest, skipBigDataTest, skipSlowTest, \
- skipIfMissingImports, skipIfOperatingSystem
+ skipIfMissingImports, skipIfOperatingSystem, skipLockedMemoryTest
from .archive import archive_extract
from .uncompress import uncompress
diff --git a/tests/functional/qemu_test/decorators.py b/tests/functional/qemu_test/decorators.py
index 50d29de533d..c0d1567b142 100644
--- a/tests/functional/qemu_test/decorators.py
+++ b/tests/functional/qemu_test/decorators.py
@@ -5,6 +5,7 @@
import importlib
import os
import platform
+import resource
from unittest import skipIf, skipUnless
from .cmd import which
@@ -131,3 +132,20 @@ def skipIfMissingImports(*args):
return skipUnless(has_imports, 'required import(s) "%s" not installed' %
", ".join(args))
+
+'''
+Decorator to skip execution of a test if the system's
+locked memory limit is below the required threshold.
+Takes required locked memory threshold in kB.
+Example:
+
+ @skipLockedMemoryTest(2_097_152)
+'''
+def skipLockedMemoryTest(locked_memory):
+ # get memlock hard limit in bytes
+ _, ulimit_memory = resource.getrlimit(resource.RLIMIT_MEMLOCK)
+
+ return skipUnless(
+ ulimit_memory == resource.RLIM_INFINITY or ulimit_memory >= locked_memory * 1024,
+ f'Test required {locked_memory} kB of available locked memory',
+ )
--
2.49.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PULL 06/10] tests/functional: add memlock tests
2025-06-11 12:58 [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...) Thomas Huth
` (4 preceding siblings ...)
2025-06-11 12:58 ` [PULL 05/10] tests/functional: add skipLockedMemoryTest decorator Thomas Huth
@ 2025-06-11 12:58 ` Thomas Huth
2025-10-24 7:45 ` Philippe Mathieu-Daudé
2025-06-11 12:58 ` [PULL 07/10] tests/vm/README: fix documentation path in tests/vm/README Thomas Huth
` (4 subsequent siblings)
10 siblings, 1 reply; 14+ messages in thread
From: Thomas Huth @ 2025-06-11 12:58 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi, Alexandr Moshkov
From: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
Add new tests to check the correctness of the `-overcommit memlock`
option (possible values: off, on, on-fault) by using
`/proc/{qemu_pid}/status` file to check in VmSize, VmRSS and VmLck
values:
* if `memlock=off`, then VmLck = 0;
* if `memlock=on`, then VmLck > 0 and almost all memory is resident;
* if `memlock=on-fault`, then VmLck > 0 and only few memory is resident.
Signed-off-by: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
Message-ID: <20250605065908.299979-3-dtalexundeer@yandex-team.ru>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/functional/meson.build | 1 +
tests/functional/test_memlock.py | 79 ++++++++++++++++++++++++++++++++
2 files changed, 80 insertions(+)
create mode 100755 tests/functional/test_memlock.py
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 557d59ddf4d..c3fca446cff 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -312,6 +312,7 @@ tests_x86_64_system_quick = [
'virtio_version',
'x86_cpu_model_versions',
'vnc',
+ 'memlock',
]
tests_x86_64_system_thorough = [
diff --git a/tests/functional/test_memlock.py b/tests/functional/test_memlock.py
new file mode 100755
index 00000000000..2b515ff979f
--- /dev/null
+++ b/tests/functional/test_memlock.py
@@ -0,0 +1,79 @@
+#!/usr/bin/env python3
+#
+# Functional test that check overcommit memlock options
+#
+# Copyright (c) Yandex Technologies LLC, 2025
+#
+# Author:
+# Alexandr Moshkov <dtalexundeer@yandex-team.ru>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import re
+
+from typing import Dict
+
+from qemu_test import QemuSystemTest
+from qemu_test import skipLockedMemoryTest
+
+
+STATUS_VALUE_PATTERN = re.compile(r'^(\w+):\s+(\d+) kB', re.MULTILINE)
+
+
+@skipLockedMemoryTest(2_097_152) # 2GB
+class MemlockTest(QemuSystemTest):
+ """
+ Runs a guest with memlock options.
+ Then verify, that this options is working correctly
+ by checking the status file of the QEMU process.
+ """
+
+ def common_vm_setup_with_memlock(self, memlock):
+ self.vm.add_args('-overcommit', f'mem-lock={memlock}')
+ self.vm.launch()
+
+ def test_memlock_off(self):
+ self.common_vm_setup_with_memlock('off')
+
+ status = self.get_process_status_values(self.vm.get_pid())
+
+ self.assertTrue(status['VmLck'] == 0)
+
+ def test_memlock_on(self):
+ self.common_vm_setup_with_memlock('on')
+
+ status = self.get_process_status_values(self.vm.get_pid())
+
+ # VmLck > 0 kB and almost all memory is resident
+ self.assertTrue(status['VmLck'] > 0)
+ self.assertTrue(status['VmRSS'] >= status['VmSize'] * 0.70)
+
+ def test_memlock_onfault(self):
+ self.common_vm_setup_with_memlock('on-fault')
+
+ status = self.get_process_status_values(self.vm.get_pid())
+
+ # VmLck > 0 kB and only few memory is resident
+ self.assertTrue(status['VmLck'] > 0)
+ self.assertTrue(status['VmRSS'] <= status['VmSize'] * 0.30)
+
+ def get_process_status_values(self, pid: int) -> Dict[str, int]:
+ result = {}
+ raw_status = self._get_raw_process_status(pid)
+
+ for line in raw_status.split('\n'):
+ if m := STATUS_VALUE_PATTERN.match(line):
+ result[m.group(1)] = int(m.group(2))
+
+ return result
+
+ def _get_raw_process_status(self, pid: int) -> str:
+ try:
+ with open(f'/proc/{pid}/status', 'r') as f:
+ return f.read()
+ except FileNotFoundError:
+ self.skipTest("Can't open status file of the process")
+
+
+if __name__ == '__main__':
+ MemlockTest.main()
--
2.49.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PULL 06/10] tests/functional: add memlock tests
2025-06-11 12:58 ` [PULL 06/10] tests/functional: add memlock tests Thomas Huth
@ 2025-10-24 7:45 ` Philippe Mathieu-Daudé
2025-10-24 7:51 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-24 7:45 UTC (permalink / raw)
To: Thomas Huth, qemu-devel
Cc: Stefan Hajnoczi, Alexandr Moshkov, Michael Tokarev,
Manos Pitsidianakis
Hi Alexandr,
On 11/6/25 14:58, Thomas Huth wrote:
> From: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
>
> Add new tests to check the correctness of the `-overcommit memlock`
> option (possible values: off, on, on-fault) by using
> `/proc/{qemu_pid}/status` file to check in VmSize, VmRSS and VmLck
> values:
>
> * if `memlock=off`, then VmLck = 0;
> * if `memlock=on`, then VmLck > 0 and almost all memory is resident;
> * if `memlock=on-fault`, then VmLck > 0 and only few memory is resident.
>
> Signed-off-by: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
> Message-ID: <20250605065908.299979-3-dtalexundeer@yandex-team.ru>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
> tests/functional/meson.build | 1 +
> tests/functional/test_memlock.py | 79 ++++++++++++++++++++++++++++++++
> 2 files changed, 80 insertions(+)
> create mode 100755 tests/functional/test_memlock.py
>
> diff --git a/tests/functional/meson.build b/tests/functional/meson.build
> index 557d59ddf4d..c3fca446cff 100644
> --- a/tests/functional/meson.build
> +++ b/tests/functional/meson.build
> @@ -312,6 +312,7 @@ tests_x86_64_system_quick = [
> 'virtio_version',
> 'x86_cpu_model_versions',
> 'vnc',
> + 'memlock',
> ]
>
> tests_x86_64_system_thorough = [
> diff --git a/tests/functional/test_memlock.py b/tests/functional/test_memlock.py
> new file mode 100755
> index 00000000000..2b515ff979f
> --- /dev/null
> +++ b/tests/functional/test_memlock.py
> @@ -0,0 +1,79 @@
> +#!/usr/bin/env python3
> +#
> +# Functional test that check overcommit memlock options
> +#
> +# Copyright (c) Yandex Technologies LLC, 2025
> +#
> +# Author:
> +# Alexandr Moshkov <dtalexundeer@yandex-team.ru>
> +#
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +
> +import re
> +
> +from typing import Dict
> +
> +from qemu_test import QemuSystemTest
> +from qemu_test import skipLockedMemoryTest
> +
> +
> +STATUS_VALUE_PATTERN = re.compile(r'^(\w+):\s+(\d+) kB', re.MULTILINE)
> +
> +
> +@skipLockedMemoryTest(2_097_152) # 2GB
> +class MemlockTest(QemuSystemTest):
> + """
> + Runs a guest with memlock options.
> + Then verify, that this options is working correctly
> + by checking the status file of the QEMU process.
> + """
> +
> + def common_vm_setup_with_memlock(self, memlock):
> + self.vm.add_args('-overcommit', f'mem-lock={memlock}')
This test fails on Darwin:
qemu-system-x86_64: mlockall: Function not implemented
qemu-system-x86_64: locking memory failed
Please consider using the @skipIfOperatingSystem("Darwin") decorator,
...
> + self.vm.launch()
> +
> + def test_memlock_off(self):
> + self.common_vm_setup_with_memlock('off')
> +
> + status = self.get_process_status_values(self.vm.get_pid())
> +
> + self.assertTrue(status['VmLck'] == 0)
> +
> + def test_memlock_on(self):
> + self.common_vm_setup_with_memlock('on')
> +
> + status = self.get_process_status_values(self.vm.get_pid())
> +
> + # VmLck > 0 kB and almost all memory is resident
> + self.assertTrue(status['VmLck'] > 0)
> + self.assertTrue(status['VmRSS'] >= status['VmSize'] * 0.70)
> +
> + def test_memlock_onfault(self):
> + self.common_vm_setup_with_memlock('on-fault')
> +
> + status = self.get_process_status_values(self.vm.get_pid())
> +
> + # VmLck > 0 kB and only few memory is resident
> + self.assertTrue(status['VmLck'] > 0)
> + self.assertTrue(status['VmRSS'] <= status['VmSize'] * 0.30)
> +
> + def get_process_status_values(self, pid: int) -> Dict[str, int]:
> + result = {}
> + raw_status = self._get_raw_process_status(pid)
> +
> + for line in raw_status.split('\n'):
> + if m := STATUS_VALUE_PATTERN.match(line):
> + result[m.group(1)] = int(m.group(2))
> +
> + return result
> +
> + def _get_raw_process_status(self, pid: int) -> str:
> + try:
> + with open(f'/proc/{pid}/status', 'r') as f:
... or even better implement skipUntilOperatingSystem() and use
it instead, since this test is clearly Linux-focused.
> + return f.read()
> + except FileNotFoundError:
> + self.skipTest("Can't open status file of the process")
> +
> +
> +if __name__ == '__main__':
> + MemlockTest.main()
Regards,
Phil.
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PULL 06/10] tests/functional: add memlock tests
2025-10-24 7:45 ` Philippe Mathieu-Daudé
@ 2025-10-24 7:51 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 14+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-24 7:51 UTC (permalink / raw)
To: Thomas Huth, qemu-devel
Cc: Stefan Hajnoczi, Alexandr Moshkov, Michael Tokarev,
Manos Pitsidianakis
On 24/10/25 09:45, Philippe Mathieu-Daudé wrote:
> Hi Alexandr,
>
> On 11/6/25 14:58, Thomas Huth wrote:
>> From: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
>>
>> Add new tests to check the correctness of the `-overcommit memlock`
>> option (possible values: off, on, on-fault) by using
>> `/proc/{qemu_pid}/status` file to check in VmSize, VmRSS and VmLck
>> values:
>>
>> * if `memlock=off`, then VmLck = 0;
>> * if `memlock=on`, then VmLck > 0 and almost all memory is resident;
>> * if `memlock=on-fault`, then VmLck > 0 and only few memory is resident.
>>
>> Signed-off-by: Alexandr Moshkov <dtalexundeer@yandex-team.ru>
>> Message-ID: <20250605065908.299979-3-dtalexundeer@yandex-team.ru>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>> tests/functional/meson.build | 1 +
>> tests/functional/test_memlock.py | 79 ++++++++++++++++++++++++++++++++
>> 2 files changed, 80 insertions(+)
>> create mode 100755 tests/functional/test_memlock.py
>>
>> diff --git a/tests/functional/meson.build b/tests/functional/meson.build
>> index 557d59ddf4d..c3fca446cff 100644
>> --- a/tests/functional/meson.build
>> +++ b/tests/functional/meson.build
>> @@ -312,6 +312,7 @@ tests_x86_64_system_quick = [
>> 'virtio_version',
>> 'x86_cpu_model_versions',
>> 'vnc',
>> + 'memlock',
>> ]
>> tests_x86_64_system_thorough = [
>> diff --git a/tests/functional/test_memlock.py b/tests/functional/
>> test_memlock.py
>> new file mode 100755
>> index 00000000000..2b515ff979f
>> --- /dev/null
>> +++ b/tests/functional/test_memlock.py
>> @@ -0,0 +1,79 @@
>> +#!/usr/bin/env python3
>> +#
>> +# Functional test that check overcommit memlock options
>> +#
>> +# Copyright (c) Yandex Technologies LLC, 2025
>> +#
>> +# Author:
>> +# Alexandr Moshkov <dtalexundeer@yandex-team.ru>
>> +#
>> +# SPDX-License-Identifier: GPL-2.0-or-later
>> +
>> +import re
>> +
>> +from typing import Dict
>> +
>> +from qemu_test import QemuSystemTest
>> +from qemu_test import skipLockedMemoryTest
>> +
>> +
>> +STATUS_VALUE_PATTERN = re.compile(r'^(\w+):\s+(\d+) kB', re.MULTILINE)
>> +
>> +
>> +@skipLockedMemoryTest(2_097_152) # 2GB
>> +class MemlockTest(QemuSystemTest):
>> + """
>> + Runs a guest with memlock options.
>> + Then verify, that this options is working correctly
>> + by checking the status file of the QEMU process.
>> + """
>> +
>> + def common_vm_setup_with_memlock(self, memlock):
>> + self.vm.add_args('-overcommit', f'mem-lock={memlock}')
>
> This test fails on Darwin:
>
> qemu-system-x86_64: mlockall: Function not implemented
> qemu-system-x86_64: locking memory failed
>
> Please consider using the @skipIfOperatingSystem("Darwin") decorator,
> ...
>
>> + self.vm.launch()
>> +
>> + def test_memlock_off(self):
>> + self.common_vm_setup_with_memlock('off')
>> +
>> + status = self.get_process_status_values(self.vm.get_pid())
>> +
>> + self.assertTrue(status['VmLck'] == 0)
>> +
>> + def test_memlock_on(self):
>> + self.common_vm_setup_with_memlock('on')
>> +
>> + status = self.get_process_status_values(self.vm.get_pid())
>> +
>> + # VmLck > 0 kB and almost all memory is resident
>> + self.assertTrue(status['VmLck'] > 0)
>> + self.assertTrue(status['VmRSS'] >= status['VmSize'] * 0.70)
>> +
>> + def test_memlock_onfault(self):
>> + self.common_vm_setup_with_memlock('on-fault')
>> +
>> + status = self.get_process_status_values(self.vm.get_pid())
>> +
>> + # VmLck > 0 kB and only few memory is resident
>> + self.assertTrue(status['VmLck'] > 0)
>> + self.assertTrue(status['VmRSS'] <= status['VmSize'] * 0.30)
>> +
>> + def get_process_status_values(self, pid: int) -> Dict[str, int]:
>> + result = {}
>> + raw_status = self._get_raw_process_status(pid)
>> +
>> + for line in raw_status.split('\n'):
>> + if m := STATUS_VALUE_PATTERN.match(line):
>> + result[m.group(1)] = int(m.group(2))
>> +
>> + return result
>> +
>> + def _get_raw_process_status(self, pid: int) -> str:
>> + try:
>> + with open(f'/proc/{pid}/status', 'r') as f:
>
> ... or even better implement skipUntilOperatingSystem() and use
Sorry, I meant:
skipUntilOperatingSystem -> skipUnlessOperatingSystem
> it instead, since this test is clearly Linux-focused.
>
>> + return f.read()
>> + except FileNotFoundError:
>> + self.skipTest("Can't open status file of the process")
>> +
>> +
>> +if __name__ == '__main__':
>> + MemlockTest.main()
> Regards,
>
> Phil.
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PULL 07/10] tests/vm/README: fix documentation path in tests/vm/README
2025-06-11 12:58 [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...) Thomas Huth
` (5 preceding siblings ...)
2025-06-11 12:58 ` [PULL 06/10] tests/functional: add memlock tests Thomas Huth
@ 2025-06-11 12:58 ` Thomas Huth
2025-06-11 12:58 ` [PULL 08/10] MAINTAINERS: Update the paths to the testing documentation files Thomas Huth
` (3 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2025-06-11 12:58 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi, Haseung Bong
From: Haseung Bong <hasueng@gmail.com>
The README file in tests/vm/ points to a non-existent file,
docs/devel/testing.rst. Update the README to point to
docs/devel/testing/main.rst, which now contains information
about VM testing.
Signed-off-by: Haseung Bong <hasueng@gmail.com>
Fixes: ff41da50308 ("docs/devel: Split testing docs from the build docs and move to separate folder")
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250607060456.28902-1-hasueng@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/vm/README | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/vm/README b/tests/vm/README
index f9c04cc0e75..14ac323309e 100644
--- a/tests/vm/README
+++ b/tests/vm/README
@@ -1 +1 @@
-See docs/devel/testing.rst for help.
+See docs/devel/testing/main.rst for help.
--
2.49.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PULL 08/10] MAINTAINERS: Update the paths to the testing documentation files
2025-06-11 12:58 [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...) Thomas Huth
` (6 preceding siblings ...)
2025-06-11 12:58 ` [PULL 07/10] tests/vm/README: fix documentation path in tests/vm/README Thomas Huth
@ 2025-06-11 12:58 ` Thomas Huth
2025-06-11 12:58 ` [PULL 09/10] MAINTAINERS: Update Akihiko Odaki's affiliation Thomas Huth
` (2 subsequent siblings)
10 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2025-06-11 12:58 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi, Ani Sinha
From: Thomas Huth <thuth@redhat.com>
When the testing docs were moved to a separate subfolder, the entries
in the MAINTAINERS file were missed. Update them now.
Fixes: ff41da50308 ("docs/devel: Split testing docs from the build docs and move to separate folder")
Reviewed-by: Ani Sinha <anisinha@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20250610053734.10417-1-thuth@redhat.com>
---
MAINTAINERS | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index aa6763077ea..eb2b338fb11 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2124,7 +2124,7 @@ M: Michael S. Tsirkin <mst@redhat.com>
S: Supported
F: tests/functional/acpi-bits/*
F: tests/functional/test_acpi_bits.py
-F: docs/devel/acpi-bits.rst
+F: docs/devel/testing/acpi-bits.rst
ACPI/HEST/GHES
R: Dongjiu Geng <gengdongjiu1@gmail.com>
@@ -3440,8 +3440,8 @@ F: system/qtest.c
F: include/system/qtest.h
F: accel/qtest/
F: tests/qtest/
-F: docs/devel/qgraph.rst
-F: docs/devel/qtest.rst
+F: docs/devel/testing/qgraph.rst
+F: docs/devel/testing/qtest.rst
X: tests/qtest/bios-tables-test*
X: tests/qtest/migration-*
@@ -3459,7 +3459,7 @@ F: tests/qtest/fuzz-*test.c
F: tests/docker/test-fuzz
F: scripts/oss-fuzz/
F: hw/mem/sparse-mem.c
-F: docs/devel/fuzzing.rst
+F: docs/devel/testing/fuzzing.rst
Register API
M: Alistair Francis <alistair@alistair23.me>
@@ -4078,7 +4078,7 @@ M: Stefan Hajnoczi <stefanha@redhat.com>
L: qemu-block@nongnu.org
S: Supported
F: block/blkverify.c
-F: docs/devel/blkverify.rst
+F: docs/devel/testing/blkverify.rst
bochs
M: Stefan Hajnoczi <stefanha@redhat.com>
@@ -4156,7 +4156,7 @@ M: Hanna Reitz <hreitz@redhat.com>
L: qemu-block@nongnu.org
S: Supported
F: block/blkdebug.c
-F: docs/devel/blkdebug.rst
+F: docs/devel/testing/blkdebug.rst
vpc
M: Kevin Wolf <kwolf@redhat.com>
@@ -4276,7 +4276,8 @@ F: tests/vm/
F: tests/lcitool/
F: tests/functional/test_*_tuxrun.py
F: scripts/archive-source.sh
-F: docs/devel/testing.rst
+F: docs/devel/testing/ci*
+F: docs/devel/testing/main.rst
W: https://gitlab.com/qemu-project/qemu/pipelines
W: https://travis-ci.org/qemu/qemu
--
2.49.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PULL 09/10] MAINTAINERS: Update Akihiko Odaki's affiliation
2025-06-11 12:58 [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...) Thomas Huth
` (7 preceding siblings ...)
2025-06-11 12:58 ` [PULL 08/10] MAINTAINERS: Update the paths to the testing documentation files Thomas Huth
@ 2025-06-11 12:58 ` Thomas Huth
2025-06-11 12:58 ` [PULL 10/10] scripts/meson-buildoptions: Sort coroutine_backend choices lexicographically Thomas Huth
2025-06-11 18:22 ` [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...) Stefan Hajnoczi
10 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2025-06-11 12:58 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi, Akihiko Odaki, Philippe Mathieu-Daudé
From: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
My contract with Daynix Computing Ltd. will expire by the end of May,
2025. As I may contribute to QEMU for my research, use my email address
at the lab.
As I'm the only maintainer of igb and no longer financially supported to
maintain it, change its status to Odd Fixes until someone steps up.
Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20250531-rsg-v1-1-e0bae1e1d90e@rsg.ci.i.u-tokyo.ac.jp>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
MAINTAINERS | 16 ++++++++--------
.mailmap | 3 ++-
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index eb2b338fb11..8d2fd4d57d9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2519,7 +2519,7 @@ F: tests/qtest/fuzz-megasas-test.c
Network packet abstractions
M: Dmitry Fleytman <dmitry.fleytman@gmail.com>
-R: Akihiko Odaki <akihiko.odaki@daynix.com>
+R: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
S: Maintained
F: include/net/eth.h
F: net/eth.c
@@ -2549,13 +2549,13 @@ F: docs/specs/rocker.rst
e1000x
M: Dmitry Fleytman <dmitry.fleytman@gmail.com>
-R: Akihiko Odaki <akihiko.odaki@daynix.com>
+R: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
S: Maintained
F: hw/net/e1000x*
e1000e
M: Dmitry Fleytman <dmitry.fleytman@gmail.com>
-R: Akihiko Odaki <akihiko.odaki@daynix.com>
+R: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
S: Maintained
F: hw/net/e1000e*
F: tests/qtest/fuzz-e1000e-test.c
@@ -2563,9 +2563,9 @@ F: tests/qtest/e1000e-test.c
F: tests/qtest/libqos/e1000e.*
igb
-M: Akihiko Odaki <akihiko.odaki@daynix.com>
+M: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
R: Sriram Yagnaraman <sriram.yagnaraman@ericsson.com>
-S: Maintained
+S: Odd Fixes
F: docs/system/devices/igb.rst
F: hw/net/igb*
F: tests/functional/test_netdev_ethtool.py
@@ -2910,7 +2910,7 @@ Core Audio framework backend
M: Gerd Hoffmann <kraxel@redhat.com>
M: Philippe Mathieu-Daudé <philmd@linaro.org>
R: Christian Schoenebeck <qemu_oss@crudebyte.com>
-R: Akihiko Odaki <akihiko.odaki@daynix.com>
+R: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
S: Odd Fixes
F: audio/coreaudio.m
@@ -3211,7 +3211,7 @@ F: tests/functional/test_vnc.py
Cocoa graphics
M: Peter Maydell <peter.maydell@linaro.org>
M: Philippe Mathieu-Daudé <philmd@linaro.org>
-R: Akihiko Odaki <akihiko.odaki@daynix.com>
+R: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
S: Odd Fixes
F: ui/cocoa.m
@@ -3738,7 +3738,7 @@ F: util/iova-tree.c
elf2dmp
M: Viktor Prutyanov <viktor.prutyanov@phystech.edu>
-R: Akihiko Odaki <akihiko.odaki@daynix.com>
+R: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
S: Maintained
F: contrib/elf2dmp/
diff --git a/.mailmap b/.mailmap
index 33fe75400fe..e7271852dc6 100644
--- a/.mailmap
+++ b/.mailmap
@@ -67,7 +67,8 @@ Andrey Drobyshev <andrey.drobyshev@virtuozzo.com> Andrey Drobyshev via <qemu-blo
BALATON Zoltan <balaton@eik.bme.hu> BALATON Zoltan via <qemu-ppc@nongnu.org>
# Next, replace old addresses by a more recent one.
-Akihiko Odaki <akihiko.odaki@daynix.com> <akihiko.odaki@gmail.com>
+Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> <akihiko.odaki@daynix.com>
+Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> <akihiko.odaki@gmail.com>
Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <aleksandar.markovic@mips.com>
Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <aleksandar.markovic@imgtec.com>
Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> <amarkovic@wavecomp.com>
--
2.49.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PULL 10/10] scripts/meson-buildoptions: Sort coroutine_backend choices lexicographically
2025-06-11 12:58 [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...) Thomas Huth
` (8 preceding siblings ...)
2025-06-11 12:58 ` [PULL 09/10] MAINTAINERS: Update Akihiko Odaki's affiliation Thomas Huth
@ 2025-06-11 12:58 ` Thomas Huth
2025-06-11 18:22 ` [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...) Stefan Hajnoczi
10 siblings, 0 replies; 14+ messages in thread
From: Thomas Huth @ 2025-06-11 12:58 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi, Bernhard Beschow
From: Bernhard Beschow <shentey@gmail.com>
When changing meson_options.txt, this script gets updated automatically
by QEMU tooling which sorts the choices lexicographically.
Fixes: ccc403ed5844 ("meson: Add wasm build in build scripts")
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Message-ID: <20250610204131.2862-4-shentey@gmail.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
scripts/meson-buildoptions.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index f09ef9604f0..73e0770f42b 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -80,7 +80,7 @@ meson_options_help() {
printf "%s\n" ' --tls-priority=VALUE Default TLS protocol/cipher priority string'
printf "%s\n" ' [NORMAL]'
printf "%s\n" ' --with-coroutine=CHOICE coroutine backend to use (choices:'
- printf "%s\n" ' auto/sigaltstack/ucontext/windows/wasm)'
+ printf "%s\n" ' auto/sigaltstack/ucontext/wasm/windows)'
printf "%s\n" ' --with-pkgversion=VALUE use specified string as sub-version of the'
printf "%s\n" ' package'
printf "%s\n" ' --with-suffix=VALUE Suffix for QEMU data/modules/config directories'
--
2.49.0
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...)
2025-06-11 12:58 [PULL 00/10] Misc patches (functional tests, travis.yml, MAINTAINERS, ...) Thomas Huth
` (9 preceding siblings ...)
2025-06-11 12:58 ` [PULL 10/10] scripts/meson-buildoptions: Sort coroutine_backend choices lexicographically Thomas Huth
@ 2025-06-11 18:22 ` Stefan Hajnoczi
10 siblings, 0 replies; 14+ messages in thread
From: Stefan Hajnoczi @ 2025-06-11 18:22 UTC (permalink / raw)
To: Thomas Huth; +Cc: qemu-devel, Stefan Hajnoczi
[-- Attachment #1: Type: text/plain, Size: 116 bytes --]
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/10.1 for any user-visible changes.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread