From: Alexander Mikhalitsyn <alex@amutable.com>
To: qemu-devel@nongnu.org
Cc: "Stéphane Graber" <stgraber@stgraber.org>,
"Jesper Devantier" <foss@defmacro.it>,
qemu-block@nongnu.org, "Zhao Liu" <zhao1.liu@intel.com>,
"Fabiano Rosas" <farosas@suse.de>, "Peter Xu" <peterx@redhat.com>,
"Keith Busch" <kbusch@kernel.org>,
"Klaus Jensen" <its@irrelevant.dk>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Alexander Mikhalitsyn" <alex@amutable.com>
Subject: [PATCH v2] tests/functional/x86_64: fix race in NVMe live migration test
Date: Thu, 3 Dec 2026 10:53:27 +0100 [thread overview]
Message-ID: <20261203095327.31399-1-alex@amutable.com> (raw)
This test uses /tmp to hold test_nvme_mig_workload.pid file, which
is a PID of a "workload" process (producing heavy read I/O).
Earlier I did a mistake and forgot to mount /tmp as tmpfs, instead
/tmp was using the same storage as root-filesystem (which lives on
NVMe device).
The problem here is that for this device we use "snapshot=on" mode,
so after live migration all data that was written on the underlying
disk is lost. It is not critical for the test itself (because it's
read-only test by design), but very critical for the test logic
that uses /tmp to find out the PID of the workload process to kill it
after live migration. Absence of this file causes test to fail
spontaneously.
Another part of the fix to make test more stable is to set migration
parameters downtime-limit and max-bandwith explicitly. As Alex
and Peter has reported only with this change test becomes stable enough.
[ I personally wasn't able to reproduce the problem on my 2 different
amd64 machines. ]
Link: https://lore.kernel.org/all/20260921190345.1709227-1-alex.bennee@linaro.org/
Reported-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Peter Xu <peterx@redhat.com>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Alexander Mikhalitsyn <alex@amutable.com>
---
tests/functional/x86_64/test_nvme_migration.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tests/functional/x86_64/test_nvme_migration.py b/tests/functional/x86_64/test_nvme_migration.py
index 890f0aab6d..a82551309a 100755
--- a/tests/functional/x86_64/test_nvme_migration.py
+++ b/tests/functional/x86_64/test_nvme_migration.py
@@ -75,6 +75,11 @@ def configure_machine(self, vm):
def launch_source_vm(self, vm):
vm.launch()
+ vm.cmd('migrate-set-parameters', **{
+ 'downtime-limit': 2000000,
+ 'max-bandwidth': 10 * 1024**3,
+ })
+
self.wait_for_console_pattern('Entering emergency mode.', vm)
prompt = '# '
self.wait_for_console_pattern(prompt, vm)
@@ -94,6 +99,8 @@ def launch_source_vm(self, vm):
prompt, vm=vm)
exec_command_and_wait_for_pattern(self, 'mount -t sysfs sysfs /sys',
prompt, vm=vm)
+ exec_command_and_wait_for_pattern(self, 'mount -t tmpfs tmpfs /tmp',
+ prompt, vm=vm)
# Run workload before migration to check if it continues
# to run properly after migration.
--
2.47.3
reply other threads:[~2026-12-03 9:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261203095327.31399-1-alex@amutable.com \
--to=alex@amutable.com \
--cc=alex.bennee@linaro.org \
--cc=farosas@suse.de \
--cc=foss@defmacro.it \
--cc=its@irrelevant.dk \
--cc=kbusch@kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stgraber@stgraber.org \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.