From nobody Sun Feb 8 19:25:56 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767731642; cv=none; d=zohomail.com; s=zohoarc; b=YdnaXuF6+xjkExJfOCj9LEQevMk5/4sOSrmwcPXDOzDALXDO3JUTgdbLjI9QgV1G6LDWUsvPs9ncBaWc61jZlIxVALYfLltPRNiaKJVTn1ka7obO+kTVProbO/ai92HNedfbekInFvcPuNfiDHfoA4MX0O0Ry64/KE0vZCttpT0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767731642; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tELp0ADOrzTvawx7SvZTi9dBis++lNC2L7IG7U3eZmM=; b=VhqoumO3SEWO3x9RsnTlYBLbtwVVT2IOo5B9CuYjf4pU7zFjsz7d3J0g6cNGzl5ohcJDNcFhQ/0ZnuFNWxA86WuXI97uPLFt1PWOZHGDvaZzFk1ltsvroB3Yn/k6wwREQ6+7B/Wd5PZ5h1fcJqdlVoAxSM38FsBPo42Gx18AX0s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1767731642386570.1338546492277; Tue, 6 Jan 2026 12:34:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdDkK-00085u-N2; Tue, 06 Jan 2026 15:33:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vdDkF-00083F-AY for qemu-devel@nongnu.org; Tue, 06 Jan 2026 15:33:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vdDkD-0006nQ-LM for qemu-devel@nongnu.org; Tue, 06 Jan 2026 15:33:34 -0500 Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-313-m8hH8dssNzuuwSSGJsetEA-1; Tue, 06 Jan 2026 15:33:31 -0500 Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-2ae546fa935so3069370eec.1 for ; Tue, 06 Jan 2026 12:33:31 -0800 (PST) Received: from x1.com ([142.188.210.156]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b17078dd84sm4819273eec.17.2026.01.06.12.33.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 12:33:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767731612; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tELp0ADOrzTvawx7SvZTi9dBis++lNC2L7IG7U3eZmM=; b=RlKyzzb0f7j3VWJgmzJbRsKUIbNHkNJlaFrau2xWnjNxnyb6LaM1v/BHdhPB7ekkPKg3me AC1EYKAN57wn+96RciKVgyj/nICly4IRHLgrbr30M2RzZ6QevlMYVnsFvyTGQFla0Bc58f S1Nik6wru98vjik1uvRJnzOJQW8A0EA= X-MC-Unique: m8hH8dssNzuuwSSGJsetEA-1 X-Mimecast-MFC-AGG-ID: m8hH8dssNzuuwSSGJsetEA_1767731610 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1767731610; x=1768336410; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tELp0ADOrzTvawx7SvZTi9dBis++lNC2L7IG7U3eZmM=; b=WkTScdouytaK7rmz0Bt4JbUuCn2Di8Q1+4eSgirZZezxTifjNsz33iUKXt9SQ9CMgr MxO03lkkkThEdIsLF8dGhB/NjdTSFWQOPswEFecb2a/diEQZqpJ4QC4Zx83NQkKAIYe5 nCT2pbw2FY59/3mFTFp4iibCh4LzrJtKq3I7niz/bLBQqs+HRKOOIs4viqovWv9aiYtJ OmEV64o9qOWtdGldYlAikESLXLScHHRlljZLvVjZVQ0Udcae0OpwUQwI8FGGZMVchwiQ JUwLIAO8ybhNWz9PFVAOYacjc5xKfSBJX4hhD0CfXPHK5F7uGCKHq1A5OLWo6pugATpO wSog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767731610; x=1768336410; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=tELp0ADOrzTvawx7SvZTi9dBis++lNC2L7IG7U3eZmM=; b=Ur5VaL3ZynxCa+iTe/0wP5FOD9jxMPHh5jmTBADasDIr+NIqLfx6ej7GTqzGCT8hxf ttKLCpO5fFaABjqhqTO3KDLgNrVrPvUzTBcE0dbQI5oSJmTqVkIT2eakGB5tjsunvv47 3DIWfioaVU3vqQ9fpFU/2ICxXzkbdPw9nn+p5ztnaPI4KdwsNUyg2wMQP02beDSiJ9zX u86RszsU7+ZzudbfGmlnXV3h9k251925E4PfAPkiI0CmETjsWPgqadfFZKKgjqmVTITH GsljZsYUblGIVfUA5L29aB8HMXKJBBUVyZT7ZhlAgF1Nj/6R7KcfhO6d/Lzw2e7tKrXO Qdhg== X-Gm-Message-State: AOJu0Yzai0egXx+x1JT8ah8Va7RNNZjyiLlLfil3yDYzL7MAxpmz9JVl k/isLLRKP4fEAMaubj3y30agDnPUMrtzOO8+0zzhYHGprsaBjOsf97RFILpIkW+1vq15UXpHtFZ /0738GERBCntZMge7N9DQ2Ge/866gDHbUiP9ENQ4fvKCpkcAGXXBMvBUqEKB7ac40fvhw/0RdKX hYwKQ7cxvDWv2BnDwskOmRX0HxGN0PTH0n9E0/Dg== X-Gm-Gg: AY/fxX4N674DR+mP6LismD2glm8yWWp884t+GVPTrw2jhVeTAxNzPdeVzMs9tBP/QCV hnvuLzGJlVgTR391W1VnURM9ctREiiUtoLIRarQRXs/uawhzH56kbQnBFVqPrtWQL2oVuByHHO1 ZpJrcCbD4y4zSJlP6LLAYj3kdwlU/gMtd5TYhuxqm2i2LR9vqS+CHpgEtO1kJWlxueb44CHvHPV NkY+8KP9/YebvHnhZu9FKjcmdNuqeX2ACt0WsE21sQPTkBQL7YYiOO3oEU0oNecDsOrhsh8N5+w bNUqE8JzRoOskZg1Ym7v6Y1s6ko7kIcj7HyiRkpJWDBhfTdK4SZnuk5g0SRJiXQ+FkQduj5rlXz W X-Received: by 2002:a05:7300:d0f:b0:2b0:4902:c189 with SMTP id 5a478bee46e88-2b17d30fc64mr120232eec.33.1767731609775; Tue, 06 Jan 2026 12:33:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEpJpL+jaxWStco/1f/gEL+0U/3wwo/KhucjJ17xsv30zUq5g4ij2pi7qZW+3/XEQ5Wu7Cn3w== X-Received: by 2002:a05:7300:d0f:b0:2b0:4902:c189 with SMTP id 5a478bee46e88-2b17d30fc64mr120212eec.33.1767731609193; Tue, 06 Jan 2026 12:33:29 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Lukas Straub , peterx@redhat.com, Juraj Marcin Subject: [PATCH 1/2] tests/migration-test: Remove postcopy_data from MigrateCommon Date: Tue, 6 Jan 2026 15:33:19 -0500 Message-ID: <20260106203320.2110372-2-peterx@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260106203320.2110372-1-peterx@redhat.com> References: <20260106203320.2110372-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1767731643959158500 Content-Type: text/plain; charset="utf-8" Now postcopy is not the only user of start_hook / end_hook that will pass in a opaque pointer. It doesn't need to be defined in MigrateCommon as part of the framework, as all other hook users can pass hook_data around. Do it too for postcopy. Signed-off-by: Peter Xu Reviewed-by: Prasad Pandit --- tests/qtest/migration/framework.h | 1 - tests/qtest/migration/framework.c | 18 ++++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/qtest/migration/framework.h b/tests/qtest/migration/fram= ework.h index ed85ed502d..0d39bb0d3c 100644 --- a/tests/qtest/migration/framework.h +++ b/tests/qtest/migration/framework.h @@ -230,7 +230,6 @@ typedef struct { bool live; =20 /* Postcopy specific fields */ - void *postcopy_data; PostcopyRecoveryFailStage postcopy_recovery_fail_stage; } MigrateCommon; =20 diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/fram= ework.c index e35839c95f..4f46cf8629 100644 --- a/tests/qtest/migration/framework.c +++ b/tests/qtest/migration/framework.c @@ -541,6 +541,7 @@ void migrate_end(QTestState *from, QTestState *to, bool= test_dest) =20 static int migrate_postcopy_prepare(QTestState **from_ptr, QTestState **to_ptr, + void **hook_data, MigrateCommon *args) { QTestState *from, *to; @@ -554,7 +555,7 @@ static int migrate_postcopy_prepare(QTestState **from_p= tr, } =20 if (args->start_hook) { - args->postcopy_data =3D args->start_hook(from, to); + *hook_data =3D args->start_hook(from, to); } =20 migrate_ensure_non_converge(from); @@ -582,7 +583,7 @@ static int migrate_postcopy_prepare(QTestState **from_p= tr, } =20 static void migrate_postcopy_complete(QTestState *from, QTestState *to, - MigrateCommon *args) + void *hook_data, MigrateCommon *args) { MigrationTestEnv *env =3D migration_get_env(); =20 @@ -601,8 +602,7 @@ static void migrate_postcopy_complete(QTestState *from,= QTestState *to, } =20 if (args->end_hook) { - args->end_hook(from, to, args->postcopy_data); - args->postcopy_data =3D NULL; + args->end_hook(from, to, hook_data); } =20 migrate_end(from, to, true); @@ -610,13 +610,14 @@ static void migrate_postcopy_complete(QTestState *fro= m, QTestState *to, =20 void test_postcopy_common(MigrateCommon *args) { + void *hook_data =3D NULL; QTestState *from, *to; =20 - if (migrate_postcopy_prepare(&from, &to, args)) { + if (migrate_postcopy_prepare(&from, &to, &hook_data, args)) { return; } migrate_postcopy_start(from, to, &src_state); - migrate_postcopy_complete(from, to, args); + migrate_postcopy_complete(from, to, hook_data, args); } =20 static void wait_for_postcopy_status(QTestState *one, const char *status) @@ -742,6 +743,7 @@ void test_postcopy_recovery_common(MigrateCommon *args) { QTestState *from, *to; g_autofree char *uri =3D NULL; + void *hook_data =3D NULL; =20 /* * Always enable OOB QMP capability for recovery tests, migrate-recove= r is @@ -752,7 +754,7 @@ void test_postcopy_recovery_common(MigrateCommon *args) /* Always hide errors for postcopy recover tests since they're expecte= d */ args->start.hide_stderr =3D true; =20 - if (migrate_postcopy_prepare(&from, &to, args)) { + if (migrate_postcopy_prepare(&from, &to, &hook_data, args)) { return; } =20 @@ -808,7 +810,7 @@ void test_postcopy_recovery_common(MigrateCommon *args) /* Restore the postcopy bandwidth to unlimited */ migrate_set_parameter_int(from, "max-postcopy-bandwidth", 0); =20 - migrate_postcopy_complete(from, to, args); + migrate_postcopy_complete(from, to, hook_data, args); } =20 int test_precopy_common(MigrateCommon *args) --=20 2.50.1 From nobody Sun Feb 8 19:25:56 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1767731659; cv=none; d=zohomail.com; s=zohoarc; b=mxlqNjdkKLUN9elveF/V4Hpxt1A0dr6YftCqB3IEHkeBbDzuowhcWEkWWjmjrpO+KNDLzfxy7KNsY6Xqn18YQfu6Gz60HqZBipGEKL9Mta3/v23LYzyLohEcDXTAbp+4HtUaTPaXrJRn9ByknTIMHTljDEU+A9KkBUsqNtGoLOA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1767731659; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=B+bbNT2SHlvLODHqdtEMfBZv1WYjcGKdKT9Qdi22zKg=; b=Cgwv0DcdlBddwzlE1iCjhgBQF/0ImXGEKbeekRDTkFZYlYXSD8Pxv8bR1iUAOKdb9o9u62Ql1IZC03kej+n/tXy7kbW5BN2MXUjC+i9eKyUNjHmbFCXNF8UpoqkNlRdMPpOGFgzv7sFsvYFdX1ZqLOcHiDXSHsJxpC0DAa5ZwdI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1767731659559711.9923833728499; Tue, 6 Jan 2026 12:34:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vdDkS-00089Q-MH; Tue, 06 Jan 2026 15:33:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vdDkI-00084j-Hn for qemu-devel@nongnu.org; Tue, 06 Jan 2026 15:33:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vdDkG-0006oB-NP for qemu-devel@nongnu.org; Tue, 06 Jan 2026 15:33:38 -0500 Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-581-qn44PJ7DOPS2oaYviz45sA-1; Tue, 06 Jan 2026 15:33:33 -0500 Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-2ae6ef97ac5so1785964eec.1 for ; Tue, 06 Jan 2026 12:33:33 -0800 (PST) Received: from x1.com ([142.188.210.156]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b17078dd84sm4819273eec.17.2026.01.06.12.33.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jan 2026 12:33:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1767731616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B+bbNT2SHlvLODHqdtEMfBZv1WYjcGKdKT9Qdi22zKg=; b=Ev4Te8hozsqm8C6WZp49O5UQOyvZhLxVEL+XSSR9vZQgl8zIXcCdCHEqANqOClGrN++qhx 1PEt9Q3dtl5O4TWVnvIXzSQj9n4ohsyj0TqR9PyhOm2uNax6soeVTqg2PSch+KHd38ucXJ XlgVtN/9ywsr8xpvlu3Nt+sWIil8sxk= X-MC-Unique: qn44PJ7DOPS2oaYviz45sA-1 X-Mimecast-MFC-AGG-ID: qn44PJ7DOPS2oaYviz45sA_1767731613 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1767731612; x=1768336412; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B+bbNT2SHlvLODHqdtEMfBZv1WYjcGKdKT9Qdi22zKg=; b=hiQ06PCMoqhJRrQevkKrzj0m8RJaJ+uIUv7KFpUhFTQDJUC8SrPKoZirxOjIe9mIOm kSr3XvAj2QTDzVJlNkNj45ecOyE3G4SRI/yWjbLP8RBURrrGNCHYAY4l8QtAE7ZO8jjy RgOoGw7hViMJcer5sj/1a8pL1Y802G+YD/nL2mxl9O/xlV6p1QOfI4X4WzlpBEdMm3pp T/PIjIISg6/hGiABkCFtxDkfGQv1iW/rS12rUiRfJmzbLOc4PzL6UB6QOBtw8pC8bc8t VHVFO1Z8mBkUyxxc9ugb8tx2lz/qDv6rZhdzgPGgVoEAGz8BipfPefPCysLwhk9OgJyt l91Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767731612; x=1768336412; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=B+bbNT2SHlvLODHqdtEMfBZv1WYjcGKdKT9Qdi22zKg=; b=MlyOo/TtG5oRhojMO+afDQYsfWXdVWXBwfJvavuTUAkKBITbZBaGUH01gjUy1sjrR+ DDv4SYhB0aYC630MLD1nypLzyTzG9DCKUUmWbfYMC0zZJZZOW5o0tYYYm5ciE9DVjLj6 6SHDb0LIBgZK7G/LShiRXTlWxFLffjEUg3K8qmO0o/OLP2zlJP9DjWe3Xbm4d182belj WEYgTMlxYyFQDjxfOd7YbAfjtKEDZurgV2w1Jiuz/qZO9d2MR6d3HcGP3mvgnmtsY5Ce MZzT9Fr4skPkQHcWNjgog77Z8eBMFmyMtQp24WQpwrTmcUhoRVtGQ+VIyOl9Ni5lBVYh WiHQ== X-Gm-Message-State: AOJu0YxEu7KyaQYBLyLnBAFuxIuAxzZMTCIb+sFP+TqKN1ngRMtAnVg2 lhxjBN1UjFbLdswlmvs1p+XVYAbSVbzYSgumlR9oU6Mwbe/JGn8bBgkNfEmuHo25iUGn725Z6io sUTgjXCUaG/aBiniHCIVeWn+xlP5jLAWQoAzZB7Bm/uEzsAdqz8JV7yh+cPsXA9Eynht3Cu9Srv OwT1EXwXfXGjVvkyzyUOXAC8ZZ5Rd4qQ6tLvbspw== X-Gm-Gg: AY/fxX7xJZ6aSNb5+tj5XxTC+9e0DFojD6DFg7BhN7at2tb1W4f7i1iAYULI5G9Pslr yfGPR5Bkolldzuf03nWpcG+YzwFRW2ZMcwuVyYn99ZjRSkUMVouPHoCyYYIaajKKZE3EEppYXTa wptp1Y936xuQCeeTTNoXsFKZ4D6pRfgXnU+2AGlepoFf5W0Iex4JUxBD6JxvrCwXRoCZDSKvzJm ZnRQXEY8DUc4qY8kc6vmgt26C0dKMyv6xiHTFQNTFyvm0MW1JRUsvbPdMIbgXxYSeQZAfUGZ1rf 2QuQBt26VlMIHwKINQp/ear/d00d21c2B8F4EgJSzzLTDKCZUkqjsSYhlf09A7QcwZBT8teBeKr L X-Received: by 2002:a05:693c:8391:20b0:2ac:21bf:e937 with SMTP id 5a478bee46e88-2b17d0ca4c4mr152253eec.0.1767731612310; Tue, 06 Jan 2026 12:33:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgSpV6dnm5T4IzlBiPVkNezpU0qWso8Wm5FOQAxw1QL1FWdyGIFreSKrR5ItRt2yy3w9X6Qw== X-Received: by 2002:a05:693c:8391:20b0:2ac:21bf:e937 with SMTP id 5a478bee46e88-2b17d0ca4c4mr152232eec.0.1767731611774; Tue, 06 Jan 2026 12:33:31 -0800 (PST) From: Peter Xu To: qemu-devel@nongnu.org Cc: Fabiano Rosas , Lukas Straub , peterx@redhat.com, Juraj Marcin Subject: [PATCH 2/2] tests/migration-test: Remove postcopy_recovery_fail_stage from MigrateCommon Date: Tue, 6 Jan 2026 15:33:20 -0500 Message-ID: <20260106203320.2110372-3-peterx@redhat.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260106203320.2110372-1-peterx@redhat.com> References: <20260106203320.2110372-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1767731661920158500 Content-Type: text/plain; charset="utf-8" The parameter can be instead passed into the function. Signed-off-by: Peter Xu Reviewed-by: Prasad Pandit --- tests/qtest/migration/framework.h | 6 ++---- tests/qtest/migration/framework.c | 7 ++++--- tests/qtest/migration/postcopy-tests.c | 12 ++++-------- tests/qtest/migration/tls-tests.c | 8 ++++---- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/tests/qtest/migration/framework.h b/tests/qtest/migration/fram= ework.h index 0d39bb0d3c..bc6cf6040f 100644 --- a/tests/qtest/migration/framework.h +++ b/tests/qtest/migration/framework.h @@ -228,9 +228,6 @@ typedef struct { * refer to existing ones with live=3Dtrue), or use live=3Doff by defa= ult. */ bool live; - - /* Postcopy specific fields */ - PostcopyRecoveryFailStage postcopy_recovery_fail_stage; } MigrateCommon; =20 void wait_for_serial(const char *side); @@ -243,7 +240,8 @@ int migrate_start(QTestState **from, QTestState **to, c= onst char *uri, void migrate_end(QTestState *from, QTestState *to, bool test_dest); =20 void test_postcopy_common(MigrateCommon *args); -void test_postcopy_recovery_common(MigrateCommon *args); +void test_postcopy_recovery_common(MigrateCommon *args, + PostcopyRecoveryFailStage fail_stage); int test_precopy_common(MigrateCommon *args); void test_file_common(MigrateCommon *args, bool stop_src); void *migrate_hook_start_precopy_tcp_multifd_common(QTestState *from, diff --git a/tests/qtest/migration/framework.c b/tests/qtest/migration/fram= ework.c index 4f46cf8629..d7a5ae56f9 100644 --- a/tests/qtest/migration/framework.c +++ b/tests/qtest/migration/framework.c @@ -739,7 +739,8 @@ static void postcopy_recover_fail(QTestState *from, QTe= stState *to, #endif } =20 -void test_postcopy_recovery_common(MigrateCommon *args) +void test_postcopy_recovery_common(MigrateCommon *args, + PostcopyRecoveryFailStage fail_stage) { QTestState *from, *to; g_autofree char *uri =3D NULL; @@ -784,12 +785,12 @@ void test_postcopy_recovery_common(MigrateCommon *arg= s) wait_for_postcopy_status(to, "postcopy-paused"); wait_for_postcopy_status(from, "postcopy-paused"); =20 - if (args->postcopy_recovery_fail_stage) { + if (fail_stage) { /* * Test when a wrong socket specified for recover, and then the * ability to kick it out, and continue with a correct socket. */ - postcopy_recover_fail(from, to, args->postcopy_recovery_fail_stage= ); + postcopy_recover_fail(from, to, fail_stage); /* continue with a good recovery */ } =20 diff --git a/tests/qtest/migration/postcopy-tests.c b/tests/qtest/migration= /postcopy-tests.c index 7ae4d765d7..13a5759655 100644 --- a/tests/qtest/migration/postcopy-tests.c +++ b/tests/qtest/migration/postcopy-tests.c @@ -41,30 +41,26 @@ static void test_postcopy_preempt(char *name, MigrateCo= mmon *args) =20 static void test_postcopy_recovery(char *name, MigrateCommon *args) { - test_postcopy_recovery_common(args); + test_postcopy_recovery_common(args, POSTCOPY_FAIL_NONE); } =20 static void test_postcopy_recovery_fail_handshake(char *name, MigrateCommon *args) { - args->postcopy_recovery_fail_stage =3D POSTCOPY_FAIL_RECOVERY; - - test_postcopy_recovery_common(args); + test_postcopy_recovery_common(args, POSTCOPY_FAIL_RECOVERY); } =20 static void test_postcopy_recovery_fail_reconnect(char *name, MigrateCommon *args) { - args->postcopy_recovery_fail_stage =3D POSTCOPY_FAIL_CHANNEL_ESTABLISH; - - test_postcopy_recovery_common(args); + test_postcopy_recovery_common(args, POSTCOPY_FAIL_CHANNEL_ESTABLISH); } =20 static void test_postcopy_preempt_recovery(char *name, MigrateCommon *args) { args->start.caps[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT] =3D true; =20 - test_postcopy_recovery_common(args); + test_postcopy_recovery_common(args, POSTCOPY_FAIL_NONE); } =20 static void migration_test_add_postcopy_smoke(MigrationTestEnv *env) diff --git a/tests/qtest/migration/tls-tests.c b/tests/qtest/migration/tls-= tests.c index 6a20c65104..bf0bb06a29 100644 --- a/tests/qtest/migration/tls-tests.c +++ b/tests/qtest/migration/tls-tests.c @@ -385,7 +385,7 @@ static void test_postcopy_recovery_tls_psk(char *name, = MigrateCommon *args) args->start_hook =3D migrate_hook_start_tls_psk_match; args->end_hook =3D migrate_hook_end_tls_psk; =20 - test_postcopy_recovery_common(args); + test_postcopy_recovery_common(args, POSTCOPY_FAIL_NONE); } =20 static void test_multifd_postcopy_recovery_tls_psk(char *name, @@ -396,7 +396,7 @@ static void test_multifd_postcopy_recovery_tls_psk(char= *name, =20 args->start.caps[MIGRATION_CAPABILITY_MULTIFD] =3D true; =20 - test_postcopy_recovery_common(args); + test_postcopy_recovery_common(args, POSTCOPY_FAIL_NONE); } =20 /* This contains preempt+recovery+tls test altogether */ @@ -407,7 +407,7 @@ static void test_postcopy_preempt_all(char *name, Migra= teCommon *args) =20 args->start.caps[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT] =3D true; =20 - test_postcopy_recovery_common(args); + test_postcopy_recovery_common(args, POSTCOPY_FAIL_NONE); } =20 static void test_multifd_postcopy_preempt_recovery_tls_psk(char *name, @@ -419,7 +419,7 @@ static void test_multifd_postcopy_preempt_recovery_tls_= psk(char *name, args->start.caps[MIGRATION_CAPABILITY_MULTIFD] =3D true; args->start.caps[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT] =3D true; =20 - test_postcopy_recovery_common(args); + test_postcopy_recovery_common(args, POSTCOPY_FAIL_NONE); } =20 static void test_precopy_unix_tls_psk(char *name, MigrateCommon *args) --=20 2.50.1