]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/vsock: avoid multi-VM pidfile collisions with QEMU
authorBobby Eshleman <bobbyeshleman@meta.com>
Sat, 8 Nov 2025 16:00:55 +0000 (08:00 -0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 12 Nov 2025 14:19:38 +0000 (06:19 -0800)
commitac8997e943bc035171e76c8457db6fa973c8a9ab
tree286bfb425868805599175429e2ae82b008e32ad7
parent4f76ff14d3d96a21574e66222041757d679a8a10
selftests/vsock: avoid multi-VM pidfile collisions with QEMU

Change QEMU to use generated pidfile names instead of just a single
globally-defined pidfile. This allows multiple QEMU instances to
co-exist with different pidfiles. This is required for future tests that
use multiple VMs to check for CID collissions.

Additionally, this also places the burden of killing the QEMU process
and cleaning up the pidfile on the caller of vm_start(). To help with
this, a function terminate_pidfiles() is introduced that callers use to
perform the cleanup. The terminate_pidfiles() function supports multiple
pidfile removals because future patches will need to process two
pidfiles at a time.

Change QEMU_OPTS to be initialized inside the vm_start(). This allows
the generated pidfile to be passed to the string assignment, and
prepares for future vm-specific options as well (e.g., cid).

Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://patch.msgid.link/20251108-vsock-selftests-fixes-and-improvements-v4-4-d5e8d6c87289@meta.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/vsock/vmtest.sh