From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 172FA606A322 for ; Thu, 3 Dec 2026 09:54:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=amutable-com.20260707.gappssmtp.com header.i=@amutable-com.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=lU+fmi0u Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xZ3VQ-00062w-ST; Thu, 03 Dec 2026 04:53:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xZ3VN-000625-OT for qemu-devel@nongnu.org; Thu, 03 Dec 2026 04:53:34 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1xZ3VL-00006J-GO for qemu-devel@nongnu.org; Thu, 03 Dec 2026 04:53:33 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4a3517554f7so125929725e9.2 for ; Thu, 03 Dec 2026 01:53:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amutable-com.20260707.gappssmtp.com; s=20260707; t=1796291609; x=1796896409; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=JJf3jhvhCnTzkOxKqeTtWjzfwliNF5fdyo9aG7xl7mo=; b=lU+fmi0u89QFdnAVtG4ICDP+diiEOWYcQKq5cL108rmFKj5Oa+T4T3toFPolGrGKK/ MYAmbNOPk8Yrin61yXzrZBmC2+ZjFwM6kbTLhLnB6ydjmQEA80viecLbGxqlPgGE8IBj nEgsGeqob1Kj7hZNDjmHCTTGKpZSg+lcJut9SgexzSFPq/rrcJZZ4EeVJrXC8Gn4SPWB //3sxWvsV/nnAumWCrO0S8TwMk1Qgj+Hyiutm3f5wbuAsAbJDjvhcmeU6hKQ7ttfEKsR RZDvot7CbkxLIRZrq0foa1AWaBAKqqsm0v36KCAt+FrMhjkCnHAvAGPpezwQPnIT3AtZ l5Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796291609; x=1796896409; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=JJf3jhvhCnTzkOxKqeTtWjzfwliNF5fdyo9aG7xl7mo=; b=b7jUdqM3rZxNFF6X4q1gUB/jeBz7aDazWHfxZMcSfPKpufRzv36y4kFDj546QXhSFL ArTrQJCGbz+7HPfOJtIivbrTHiY7A/Hwo/EMyvS83U+db9ToiITf0aMTkyaL+4N2eg2I +fX1x5TzmzQzqY2LYigMddyTz2tgYOFr7JluWEGQALTmJdznGuzsx0aqKdH8wsu69bQP zGnG+eQbyOR8O/6m3GW86hN8cS5Hw9dj0f6PtMaEWDXSk9N6eyKk7dlfBe/H+cWlHTDJ SaJXVEZwtWNGce2zEiw/LDBrfcFid9m7Pl+gVZ+kgBz0bI+C5eMKsfpfC2pVWNCMVKE7 sg5g== X-Gm-Message-State: APuU4Z9ROoKg/7jKKZhc/hgJjE0tZ2A8AMAbfxwEegsmSkA7TtfhisN7 cCSlOWx8l5PoT8Fh8+9FQqfbDHugGYqEk1gDePd11+Olx6Wy5mQopYnhXfYbi9oKGI/+oBPht7D ArwTu/sfc X-Gm-Gg: AZFdTZfR7Wr9pGpCCSbfRt5R26Uv9SgRsR9RBTpyRHgCkUddGVc46DEs+/c1B8/NhPE 2jCHbdNhHcMeIHI8U73mcCfsKmobYNN4u0d9dF/ratma+TWCrAmttAAMZK6w/qGB1LiWel/KdDN JT059bm16UMuTZRtHD8Fg9Tk+2JIQXw73zqY2F14WP97YF64uuT+9BNkaQF1HgOu2pYvO/Rug7J zxq1LFOI/a2nBvcHURo53Ez+8+ejdL+M/te+dAG6hNBWVh+QHSS0RE1McgxDXJb7RWJptsBMgRw wows53glM6RENWxqe3q/q2ER0AgfdBncrKQYMwnGCY+6l6grO8IK2IWP8cVSOjqXXERJfwAh6jq xzXjXxBJk/UhyZHBQcTQoJYRpB6q/OwPRF+IH5UVoKexBywA9hqJarUiuh3OFj0XNwGz83I/5+p Jcv+ckDzGGRs7CI8ytoKlgz4e5tyk0rTXJGEKQf6I72pr8j0nVeSzpkBD5y4DJlLfVYn39Ab4YF fgeQaSceWCKSFZBxuAvVfoVcq/07sBpaFBVxqoBZUcJf8/JL1KbubLb5JR/x0Yqc3GX2lbyc+MY Fb/QbN0Yg9foZhaClvUqoU2H/1ZbnoHiHGzPsMe2+InoasRDA4S2Yf8quQqo3UGjRXDVFihhSfW UAbUzr/zl9tGwwdgTLQ== X-Received: by 2002:a05:600c:3b99:b0:4a1:777b:8a12 with SMTP id 5b1f17b1804b1-4bb8880b984mr979434495e9.14.1796291609411; Thu, 03 Dec 2026 01:53:29 -0800 (PST) Received: from alex-t14g7.lan (p200300cf572c2800ca1012a07db47e3a.dip0.t-ipconnect.de. [2003:cf:572c:2800:ca10:12a0:7db4:7e3a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab69bf680fsm95370962f8f.14.2026.12.03.01.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 01:53:29 -0800 (PST) From: Alexander Mikhalitsyn To: qemu-devel@nongnu.org Cc: =?UTF-8?q?St=C3=A9phane=20Graber?= , Jesper Devantier , qemu-block@nongnu.org, Zhao Liu , Fabiano Rosas , Peter Xu , Keith Busch , Klaus Jensen , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , Alexander Mikhalitsyn Subject: [PATCH v2] tests/functional/x86_64: fix race in NVMe live migration test Date: Thu, 3 Dec 2026 10:53:27 +0100 Message-ID: <20261203095327.31399-1-alex@amutable.com> X-Mailer: git-send-email 2.47.3 X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex@amutable.com; helo=mail-wm1-x336.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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 Tested-by: Peter Xu Tested-by: Alex Bennée Signed-off-by: Alexander Mikhalitsyn --- 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