From nobody Sat Nov 23 19:29:35 2024 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=none dis=none) header.from=suse.de ARC-Seal: i=1; a=rsa-sha256; t=1731527398; cv=none; d=zohomail.com; s=zohoarc; b=CRKfPtSoi9KsED7uwSS+e8SPIq24cTuc+LAYMKxDPvGu10ReZ+Bo7AdEPgZ7mNC6zWt/FFS+r72qWB1mOG+lmef025JhP3AGxUeNr6qq9gq91igzY4uOilB0+ILJXVdNK9ESRwYFl3u35Mg/eSsIw4UxQBhIi3+Ga4z9ai4rkPE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731527398; 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=cioe6gcRKqDTQnSSMU3xF24zVaXBik7TNej2YQYerdY=; b=iJtnZ/bUKEyR3oByJvHj1TgS5U2RE8VHBHPa6URzQlq0XfVkXHlyfzv78oRGA3LYc2t4fCDazVXEvOcBNPpNMsUpDEgDeMuTdmQdqTQ8SW3Z3H8LFpEKkN3EpXKH32qpxomY4CvPcreR8/H4uk2GbyYqKZijIOcMW9HdL5Rl+Fo= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1731527398185922.2905650463996; Wed, 13 Nov 2024 11:49:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBJKB-0006J9-A0; Wed, 13 Nov 2024 14:46:47 -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 1tBJK9-0006IX-Hb for qemu-devel@nongnu.org; Wed, 13 Nov 2024 14:46:45 -0500 Received: from smtp-out2.suse.de ([195.135.223.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tBJK5-00037n-Ew for qemu-devel@nongnu.org; Wed, 13 Nov 2024 14:46:45 -0500 Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 0AA3A1F445; Wed, 13 Nov 2024 19:46:39 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 5BE2113301; Wed, 13 Nov 2024 19:46:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id CAGZCB0CNWfLcQAAD6G6ig (envelope-from ); Wed, 13 Nov 2024 19:46:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1731527199; h=from:from:reply-to: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=cioe6gcRKqDTQnSSMU3xF24zVaXBik7TNej2YQYerdY=; b=g2fKL0BBpvgXRG8dGKMFVlS8CJzkV/1EeFcLBhO6Oc2co3LaV0imKE7p055rDuXjVjykG+ tUkTsfolBHT1jFaio5dB4w4MOOPjkiLWhV7xu7n3sDmpovx4IOxM7zF6aABOuQDXaYpglA m/qrQXfa40NAj39NK3NT2JsjeWr2xVY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1731527199; h=from:from:reply-to: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=cioe6gcRKqDTQnSSMU3xF24zVaXBik7TNej2YQYerdY=; b=2h5f6KYmrtpOVuhDIrcZH0Qr7hhYskrX1oGCm1EgaW6476SyliawO6ogc1z7X2OMwiFZQb xjtN7Sxc/fJ0Z/CQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=g2fKL0BB; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=2h5f6KYm DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1731527199; h=from:from:reply-to: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=cioe6gcRKqDTQnSSMU3xF24zVaXBik7TNej2YQYerdY=; b=g2fKL0BBpvgXRG8dGKMFVlS8CJzkV/1EeFcLBhO6Oc2co3LaV0imKE7p055rDuXjVjykG+ tUkTsfolBHT1jFaio5dB4w4MOOPjkiLWhV7xu7n3sDmpovx4IOxM7zF6aABOuQDXaYpglA m/qrQXfa40NAj39NK3NT2JsjeWr2xVY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1731527199; h=from:from:reply-to: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=cioe6gcRKqDTQnSSMU3xF24zVaXBik7TNej2YQYerdY=; b=2h5f6KYmrtpOVuhDIrcZH0Qr7hhYskrX1oGCm1EgaW6476SyliawO6ogc1z7X2OMwiFZQb xjtN7Sxc/fJ0Z/CQ== From: Fabiano Rosas To: qemu-devel@nongnu.org Cc: Peter Xu , Peter Maydell , =?UTF-8?q?Daniel=20P=20=2E=20Berrang=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v2 02/22] tests/qtest/migration: Standardize hook names Date: Wed, 13 Nov 2024 16:46:10 -0300 Message-Id: <20241113194630.3385-3-farosas@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20241113194630.3385-1-farosas@suse.de> References: <20241113194630.3385-1-farosas@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 0AA3A1F445 X-Spam-Score: -3.01 X-Rspamd-Action: no action X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; MIME_TRACE(0.00)[0:+]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:25478, ipnet:::/0, country:RU]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCPT_COUNT_FIVE(0.00)[5]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim, suse.de:mid, suse.de:email, imap1.dmz-prg2.suse.org:rdns, imap1.dmz-prg2.suse.org:helo] X-Rspamd-Server: rspamd1.dmz-prg2.suse.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=195.135.223.131; envelope-from=farosas@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, 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: 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 @suse.de) X-ZM-MESSAGEID: 1731527399516116600 Content-Type: text/plain; charset="utf-8" Standardize the hook names: - change the names to .start|end_hook to match test_migrate_start|end() - use the migrate_hook_start_ and migrate_hook_end_ prefixes Signed-off-by: Fabiano Rosas --- tests/qtest/migration-test.c | 299 ++++++++++++++++++----------------- 1 file changed, 150 insertions(+), 149 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 74d3000198..68fa24edb4 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -631,9 +631,9 @@ typedef void * (*TestMigrateStartHook)(QTestState *from, * @opaque is a pointer to state previously returned * by the TestMigrateStartHook if any, or NULL. */ -typedef void (*TestMigrateFinishHook)(QTestState *from, - QTestState *to, - void *opaque); +typedef void (*TestMigrateEndHook)(QTestState *from, + QTestState *to, + void *opaque); =20 typedef struct { /* Optional: fine tune start parameters */ @@ -660,7 +660,7 @@ typedef struct { /* Optional: callback to run at start to set migration parameters */ TestMigrateStartHook start_hook; /* Optional: callback to run at finish to cleanup */ - TestMigrateFinishHook finish_hook; + TestMigrateEndHook end_hook; =20 /* * Optional: normally we expect the migration process to complete. @@ -919,7 +919,7 @@ struct TestMigrateTLSPSKData { }; =20 static void * -test_migrate_tls_psk_start_common(QTestState *from, +migrate_hook_start_tls_psk_common(QTestState *from, QTestState *to, bool mismatch) { @@ -964,23 +964,23 @@ test_migrate_tls_psk_start_common(QTestState *from, } =20 static void * -test_migrate_tls_psk_start_match(QTestState *from, +migrate_hook_start_tls_psk_match(QTestState *from, QTestState *to) { - return test_migrate_tls_psk_start_common(from, to, false); + return migrate_hook_start_tls_psk_common(from, to, false); } =20 static void * -test_migrate_tls_psk_start_mismatch(QTestState *from, +migrate_hook_start_tls_psk_mismatch(QTestState *from, QTestState *to) { - return test_migrate_tls_psk_start_common(from, to, true); + return migrate_hook_start_tls_psk_common(from, to, true); } =20 static void -test_migrate_tls_psk_finish(QTestState *from, - QTestState *to, - void *opaque) +migrate_hook_end_tls_psk(QTestState *from, + QTestState *to, + void *opaque) { struct TestMigrateTLSPSKData *data =3D opaque; =20 @@ -1021,7 +1021,7 @@ typedef struct { } TestMigrateTLSX509; =20 static void * -test_migrate_tls_x509_start_common(QTestState *from, +migrate_hook_start_tls_x509_common(QTestState *from, QTestState *to, TestMigrateTLSX509 *args) { @@ -1114,7 +1114,7 @@ test_migrate_tls_x509_start_common(QTestState *from, * whatever host we were telling QEMU to connect to (if any) */ static void * -test_migrate_tls_x509_start_default_host(QTestState *from, +migrate_hook_start_tls_x509_default_host(QTestState *from, QTestState *to) { TestMigrateTLSX509 args =3D { @@ -1122,7 +1122,7 @@ test_migrate_tls_x509_start_default_host(QTestState *= from, .clientcert =3D true, .certipaddr =3D "127.0.0.1" }; - return test_migrate_tls_x509_start_common(from, to, &args); + return migrate_hook_start_tls_x509_common(from, to, &args); } =20 /* @@ -1131,7 +1131,7 @@ test_migrate_tls_x509_start_default_host(QTestState *= from, * so we must give QEMU an explicit hostname to validate */ static void * -test_migrate_tls_x509_start_override_host(QTestState *from, +migrate_hook_start_tls_x509_override_host(QTestState *from, QTestState *to) { TestMigrateTLSX509 args =3D { @@ -1139,7 +1139,7 @@ test_migrate_tls_x509_start_override_host(QTestState = *from, .clientcert =3D true, .certhostname =3D "qemu.org", }; - return test_migrate_tls_x509_start_common(from, to, &args); + return migrate_hook_start_tls_x509_common(from, to, &args); } =20 /* @@ -1148,7 +1148,7 @@ test_migrate_tls_x509_start_override_host(QTestState = *from, * expect the client to reject the server */ static void * -test_migrate_tls_x509_start_mismatch_host(QTestState *from, +migrate_hook_start_tls_x509_mismatch_host(QTestState *from, QTestState *to) { TestMigrateTLSX509 args =3D { @@ -1156,11 +1156,11 @@ test_migrate_tls_x509_start_mismatch_host(QTestStat= e *from, .clientcert =3D true, .certipaddr =3D "10.0.0.1", }; - return test_migrate_tls_x509_start_common(from, to, &args); + return migrate_hook_start_tls_x509_common(from, to, &args); } =20 static void * -test_migrate_tls_x509_start_friendly_client(QTestState *from, +migrate_hook_start_tls_x509_friendly_client(QTestState *from, QTestState *to) { TestMigrateTLSX509 args =3D { @@ -1169,11 +1169,11 @@ test_migrate_tls_x509_start_friendly_client(QTestSt= ate *from, .authzclient =3D true, .certipaddr =3D "127.0.0.1", }; - return test_migrate_tls_x509_start_common(from, to, &args); + return migrate_hook_start_tls_x509_common(from, to, &args); } =20 static void * -test_migrate_tls_x509_start_hostile_client(QTestState *from, +migrate_hook_start_tls_x509_hostile_client(QTestState *from, QTestState *to) { TestMigrateTLSX509 args =3D { @@ -1183,7 +1183,7 @@ test_migrate_tls_x509_start_hostile_client(QTestState= *from, .authzclient =3D true, .certipaddr =3D "127.0.0.1", }; - return test_migrate_tls_x509_start_common(from, to, &args); + return migrate_hook_start_tls_x509_common(from, to, &args); } =20 /* @@ -1191,13 +1191,13 @@ test_migrate_tls_x509_start_hostile_client(QTestSta= te *from, * and no server verification */ static void * -test_migrate_tls_x509_start_allow_anon_client(QTestState *from, +migrate_hook_start_tls_x509_allow_anon_client(QTestState *from, QTestState *to) { TestMigrateTLSX509 args =3D { .certipaddr =3D "127.0.0.1", }; - return test_migrate_tls_x509_start_common(from, to, &args); + return migrate_hook_start_tls_x509_common(from, to, &args); } =20 /* @@ -1205,20 +1205,20 @@ test_migrate_tls_x509_start_allow_anon_client(QTest= State *from, * and server verification rejecting */ static void * -test_migrate_tls_x509_start_reject_anon_client(QTestState *from, +migrate_hook_start_tls_x509_reject_anon_client(QTestState *from, QTestState *to) { TestMigrateTLSX509 args =3D { .verifyclient =3D true, .certipaddr =3D "127.0.0.1", }; - return test_migrate_tls_x509_start_common(from, to, &args); + return migrate_hook_start_tls_x509_common(from, to, &args); } =20 static void -test_migrate_tls_x509_finish(QTestState *from, - QTestState *to, - void *opaque) +migrate_hook_end_tls_x509(QTestState *from, + QTestState *to, + void *opaque) { TestMigrateTLSX509Data *data =3D opaque; =20 @@ -1314,8 +1314,8 @@ static void migrate_postcopy_complete(QTestState *fro= m, QTestState *to, read_blocktime(to); } =20 - if (args->finish_hook) { - args->finish_hook(from, to, args->postcopy_data); + if (args->end_hook) { + args->end_hook(from, to, args->postcopy_data); args->postcopy_data =3D NULL; } =20 @@ -1362,8 +1362,8 @@ static void test_postcopy_preempt(void) static void test_postcopy_tls_psk(void) { MigrateCommon args =3D { - .start_hook =3D test_migrate_tls_psk_start_match, - .finish_hook =3D test_migrate_tls_psk_finish, + .start_hook =3D migrate_hook_start_tls_psk_match, + .end_hook =3D migrate_hook_end_tls_psk, }; =20 test_postcopy_common(&args); @@ -1373,8 +1373,8 @@ static void test_postcopy_preempt_tls_psk(void) { MigrateCommon args =3D { .postcopy_preempt =3D true, - .start_hook =3D test_migrate_tls_psk_start_match, - .finish_hook =3D test_migrate_tls_psk_finish, + .start_hook =3D migrate_hook_start_tls_psk_match, + .end_hook =3D migrate_hook_end_tls_psk, }; =20 test_postcopy_common(&args); @@ -1596,8 +1596,8 @@ static void test_postcopy_recovery_fail_reconnect(voi= d) static void test_postcopy_recovery_tls_psk(void) { MigrateCommon args =3D { - .start_hook =3D test_migrate_tls_psk_start_match, - .finish_hook =3D test_migrate_tls_psk_finish, + .start_hook =3D migrate_hook_start_tls_psk_match, + .end_hook =3D migrate_hook_end_tls_psk, }; =20 test_postcopy_recovery_common(&args); @@ -1619,8 +1619,8 @@ static void test_postcopy_preempt_all(void) { MigrateCommon args =3D { .postcopy_preempt =3D true, - .start_hook =3D test_migrate_tls_psk_start_match, - .finish_hook =3D test_migrate_tls_psk_finish, + .start_hook =3D migrate_hook_start_tls_psk_match, + .end_hook =3D migrate_hook_end_tls_psk, }; =20 test_postcopy_recovery_common(&args); @@ -1794,8 +1794,8 @@ static void test_precopy_common(MigrateCommon *args) } =20 finish: - if (args->finish_hook) { - args->finish_hook(from, to, data_hook); + if (args->end_hook) { + args->end_hook(from, to, data_hook); } =20 test_migrate_end(from, to, args->result =3D=3D MIG_TEST_SUCCEED); @@ -1899,8 +1899,8 @@ static void test_file_common(MigrateCommon *args, boo= l stop_src) } =20 finish: - if (args->finish_hook) { - args->finish_hook(from, to, data_hook); + if (args->end_hook) { + args->end_hook(from, to, data_hook); } =20 test_migrate_end(from, to, args->result =3D=3D MIG_TEST_SUCCEED); @@ -1977,8 +1977,8 @@ static void test_precopy_unix_tls_psk(void) MigrateCommon args =3D { .connect_uri =3D uri, .listen_uri =3D uri, - .start_hook =3D test_migrate_tls_psk_start_match, - .finish_hook =3D test_migrate_tls_psk_finish, + .start_hook =3D migrate_hook_start_tls_psk_match, + .end_hook =3D migrate_hook_end_tls_psk, }; =20 test_precopy_common(&args); @@ -1994,8 +1994,8 @@ static void test_precopy_unix_tls_x509_default_host(v= oid) }, .connect_uri =3D uri, .listen_uri =3D uri, - .start_hook =3D test_migrate_tls_x509_start_default_host, - .finish_hook =3D test_migrate_tls_x509_finish, + .start_hook =3D migrate_hook_start_tls_x509_default_host, + .end_hook =3D migrate_hook_end_tls_x509, .result =3D MIG_TEST_FAIL_DEST_QUIT_ERR, }; =20 @@ -2008,8 +2008,8 @@ static void test_precopy_unix_tls_x509_override_host(= void) MigrateCommon args =3D { .connect_uri =3D uri, .listen_uri =3D uri, - .start_hook =3D test_migrate_tls_x509_start_override_host, - .finish_hook =3D test_migrate_tls_x509_finish, + .start_hook =3D migrate_hook_start_tls_x509_override_host, + .end_hook =3D migrate_hook_end_tls_x509, }; =20 test_precopy_common(&args); @@ -2056,7 +2056,7 @@ static void test_ignore_shared(void) #endif =20 static void * -test_migrate_xbzrle_start(QTestState *from, +migrate_hook_start_xbzrle(QTestState *from, QTestState *to) { migrate_set_parameter_int(from, "xbzrle-cache-size", 33554432); @@ -2073,7 +2073,7 @@ static void test_precopy_unix_xbzrle(void) MigrateCommon args =3D { .connect_uri =3D uri, .listen_uri =3D uri, - .start_hook =3D test_migrate_xbzrle_start, + .start_hook =3D migrate_hook_start_xbzrle, .iterations =3D 2, /* * XBZRLE needs pages to be modified when doing the 2nd+ round @@ -2120,7 +2120,7 @@ static void fdset_add_fds(QTestState *qts, const char= *file, int flags, } } =20 -static void *file_offset_fdset_start_hook(QTestState *from, QTestState *to) +static void *file_offset_fdset_start(QTestState *from, QTestState *to) { g_autofree char *file =3D g_strdup_printf("%s/%s", tmpfs, FILE_TEST_FI= LENAME); =20 @@ -2137,7 +2137,7 @@ static void test_precopy_file_offset_fdset(void) MigrateCommon args =3D { .connect_uri =3D uri, .listen_uri =3D "defer", - .start_hook =3D file_offset_fdset_start_hook, + .start_hook =3D file_offset_fdset_start, }; =20 test_file_common(&args, false); @@ -2323,7 +2323,8 @@ static void multifd_mapped_ram_fdset_end(QTestState *= from, QTestState *to, qobject_unref(resp); } =20 -static void *multifd_mapped_ram_fdset_dio(QTestState *from, QTestState *to) +static void *multifd_mapped_ram_fdset_dio_start(QTestState *from, + QTestState *to) { g_autofree char *file =3D g_strdup_printf("%s/%s", tmpfs, FILE_TEST_FI= LENAME); =20 @@ -2337,7 +2338,7 @@ static void *multifd_mapped_ram_fdset_dio(QTestState = *from, QTestState *to) return NULL; } =20 -static void *multifd_mapped_ram_fdset(QTestState *from, QTestState *to) +static void *multifd_mapped_ram_fdset_start(QTestState *from, QTestState *= to) { g_autofree char *file =3D g_strdup_printf("%s/%s", tmpfs, FILE_TEST_FI= LENAME); =20 @@ -2356,8 +2357,8 @@ static void test_multifd_file_mapped_ram_fdset(void) MigrateCommon args =3D { .connect_uri =3D uri, .listen_uri =3D "defer", - .start_hook =3D multifd_mapped_ram_fdset, - .finish_hook =3D multifd_mapped_ram_fdset_end, + .start_hook =3D multifd_mapped_ram_fdset_start, + .end_hook =3D multifd_mapped_ram_fdset_end, }; =20 test_file_common(&args, true); @@ -2370,8 +2371,8 @@ static void test_multifd_file_mapped_ram_fdset_dio(vo= id) MigrateCommon args =3D { .connect_uri =3D uri, .listen_uri =3D "defer", - .start_hook =3D multifd_mapped_ram_fdset_dio, - .finish_hook =3D multifd_mapped_ram_fdset_end, + .start_hook =3D multifd_mapped_ram_fdset_dio_start, + .end_hook =3D multifd_mapped_ram_fdset_end, }; =20 if (!probe_o_direct_support(tmpfs)) { @@ -2392,7 +2393,7 @@ static void test_precopy_tcp_plain(void) test_precopy_common(&args); } =20 -static void *test_migrate_switchover_ack_start(QTestState *from, QTestStat= e *to) +static void *migrate_hook_start_switchover_ack(QTestState *from, QTestStat= e *to) { =20 migrate_set_capability(from, "return-path", true); @@ -2408,7 +2409,7 @@ static void test_precopy_tcp_switchover_ack(void) { MigrateCommon args =3D { .listen_uri =3D "tcp:127.0.0.1:0", - .start_hook =3D test_migrate_switchover_ack_start, + .start_hook =3D migrate_hook_start_switchover_ack, /* * Source VM must be running in order to consider the switchover A= CK * when deciding to do switchover or not. @@ -2424,8 +2425,8 @@ static void test_precopy_tcp_tls_psk_match(void) { MigrateCommon args =3D { .listen_uri =3D "tcp:127.0.0.1:0", - .start_hook =3D test_migrate_tls_psk_start_match, - .finish_hook =3D test_migrate_tls_psk_finish, + .start_hook =3D migrate_hook_start_tls_psk_match, + .end_hook =3D migrate_hook_end_tls_psk, }; =20 test_precopy_common(&args); @@ -2438,8 +2439,8 @@ static void test_precopy_tcp_tls_psk_mismatch(void) .hide_stderr =3D true, }, .listen_uri =3D "tcp:127.0.0.1:0", - .start_hook =3D test_migrate_tls_psk_start_mismatch, - .finish_hook =3D test_migrate_tls_psk_finish, + .start_hook =3D migrate_hook_start_tls_psk_mismatch, + .end_hook =3D migrate_hook_end_tls_psk, .result =3D MIG_TEST_FAIL, }; =20 @@ -2451,8 +2452,8 @@ static void test_precopy_tcp_tls_x509_default_host(vo= id) { MigrateCommon args =3D { .listen_uri =3D "tcp:127.0.0.1:0", - .start_hook =3D test_migrate_tls_x509_start_default_host, - .finish_hook =3D test_migrate_tls_x509_finish, + .start_hook =3D migrate_hook_start_tls_x509_default_host, + .end_hook =3D migrate_hook_end_tls_x509, }; =20 test_precopy_common(&args); @@ -2462,8 +2463,8 @@ static void test_precopy_tcp_tls_x509_override_host(v= oid) { MigrateCommon args =3D { .listen_uri =3D "tcp:127.0.0.1:0", - .start_hook =3D test_migrate_tls_x509_start_override_host, - .finish_hook =3D test_migrate_tls_x509_finish, + .start_hook =3D migrate_hook_start_tls_x509_override_host, + .end_hook =3D migrate_hook_end_tls_x509, }; =20 test_precopy_common(&args); @@ -2476,8 +2477,8 @@ static void test_precopy_tcp_tls_x509_mismatch_host(v= oid) .hide_stderr =3D true, }, .listen_uri =3D "tcp:127.0.0.1:0", - .start_hook =3D test_migrate_tls_x509_start_mismatch_host, - .finish_hook =3D test_migrate_tls_x509_finish, + .start_hook =3D migrate_hook_start_tls_x509_mismatch_host, + .end_hook =3D migrate_hook_end_tls_x509, .result =3D MIG_TEST_FAIL_DEST_QUIT_ERR, }; =20 @@ -2488,8 +2489,8 @@ static void test_precopy_tcp_tls_x509_friendly_client= (void) { MigrateCommon args =3D { .listen_uri =3D "tcp:127.0.0.1:0", - .start_hook =3D test_migrate_tls_x509_start_friendly_client, - .finish_hook =3D test_migrate_tls_x509_finish, + .start_hook =3D migrate_hook_start_tls_x509_friendly_client, + .end_hook =3D migrate_hook_end_tls_x509, }; =20 test_precopy_common(&args); @@ -2502,8 +2503,8 @@ static void test_precopy_tcp_tls_x509_hostile_client(= void) .hide_stderr =3D true, }, .listen_uri =3D "tcp:127.0.0.1:0", - .start_hook =3D test_migrate_tls_x509_start_hostile_client, - .finish_hook =3D test_migrate_tls_x509_finish, + .start_hook =3D migrate_hook_start_tls_x509_hostile_client, + .end_hook =3D migrate_hook_end_tls_x509, .result =3D MIG_TEST_FAIL, }; =20 @@ -2514,8 +2515,8 @@ static void test_precopy_tcp_tls_x509_allow_anon_clie= nt(void) { MigrateCommon args =3D { .listen_uri =3D "tcp:127.0.0.1:0", - .start_hook =3D test_migrate_tls_x509_start_allow_anon_client, - .finish_hook =3D test_migrate_tls_x509_finish, + .start_hook =3D migrate_hook_start_tls_x509_allow_anon_client, + .end_hook =3D migrate_hook_end_tls_x509, }; =20 test_precopy_common(&args); @@ -2528,8 +2529,8 @@ static void test_precopy_tcp_tls_x509_reject_anon_cli= ent(void) .hide_stderr =3D true, }, .listen_uri =3D "tcp:127.0.0.1:0", - .start_hook =3D test_migrate_tls_x509_start_reject_anon_client, - .finish_hook =3D test_migrate_tls_x509_finish, + .start_hook =3D migrate_hook_start_tls_x509_reject_anon_client, + .end_hook =3D migrate_hook_end_tls_x509, .result =3D MIG_TEST_FAIL, }; =20 @@ -2539,8 +2540,8 @@ static void test_precopy_tcp_tls_x509_reject_anon_cli= ent(void) #endif /* CONFIG_GNUTLS */ =20 #ifndef _WIN32 -static void *test_migrate_fd_start_hook(QTestState *from, - QTestState *to) +static void *migrate_hook_start_fd(QTestState *from, + QTestState *to) { int ret; int pair[2]; @@ -2567,9 +2568,9 @@ static void *test_migrate_fd_start_hook(QTestState *f= rom, return NULL; } =20 -static void test_migrate_fd_finish_hook(QTestState *from, - QTestState *to, - void *opaque) +static void migrate_hook_end_fd(QTestState *from, + QTestState *to, + void *opaque) { QDict *rsp; const char *error_desc; @@ -2599,8 +2600,8 @@ static void test_migrate_precopy_fd_socket(void) MigrateCommon args =3D { .listen_uri =3D "defer", .connect_uri =3D "fd:fd-mig", - .start_hook =3D test_migrate_fd_start_hook, - .finish_hook =3D test_migrate_fd_finish_hook + .start_hook =3D migrate_hook_start_fd, + .end_hook =3D migrate_hook_end_fd, }; test_precopy_common(&args); } @@ -2639,7 +2640,7 @@ static void test_migrate_precopy_fd_file(void) .listen_uri =3D "defer", .connect_uri =3D "fd:fd-mig", .start_hook =3D migrate_precopy_fd_file_start, - .finish_hook =3D test_migrate_fd_finish_hook + .end_hook =3D migrate_hook_end_fd, }; test_file_common(&args, true); } @@ -2886,7 +2887,7 @@ static void test_migrate_auto_converge(void) } =20 static void * -test_migrate_precopy_tcp_multifd_start_common(QTestState *from, +migrate_hook_start_precopy_tcp_multifd_common(QTestState *from, QTestState *to, const char *method) { @@ -2906,32 +2907,32 @@ test_migrate_precopy_tcp_multifd_start_common(QTest= State *from, } =20 static void * -test_migrate_precopy_tcp_multifd_start(QTestState *from, +migrate_hook_start_precopy_tcp_multifd(QTestState *from, QTestState *to) { - return test_migrate_precopy_tcp_multifd_start_common(from, to, "none"); + return migrate_hook_start_precopy_tcp_multifd_common(from, to, "none"); } =20 static void * -test_migrate_precopy_tcp_multifd_start_zero_page_legacy(QTestState *from, +migrate_hook_start_precopy_tcp_multifd_zero_page_legacy(QTestState *from, QTestState *to) { - test_migrate_precopy_tcp_multifd_start_common(from, to, "none"); + migrate_hook_start_precopy_tcp_multifd_common(from, to, "none"); migrate_set_parameter_str(from, "zero-page-detection", "legacy"); return NULL; } =20 static void * -test_migration_precopy_tcp_multifd_start_no_zero_page(QTestState *from, +test_migration_precopy_tcp_multifd_no_zero_page_start(QTestState *from, QTestState *to) { - test_migrate_precopy_tcp_multifd_start_common(from, to, "none"); + migrate_hook_start_precopy_tcp_multifd_common(from, to, "none"); migrate_set_parameter_str(from, "zero-page-detection", "none"); return NULL; } =20 static void * -test_migrate_precopy_tcp_multifd_zlib_start(QTestState *from, +migrate_hook_start_precopy_tcp_multifd_zlib(QTestState *from, QTestState *to) { /* @@ -2941,47 +2942,47 @@ test_migrate_precopy_tcp_multifd_zlib_start(QTestSt= ate *from, migrate_set_parameter_int(from, "multifd-zlib-level", 2); migrate_set_parameter_int(to, "multifd-zlib-level", 2); =20 - return test_migrate_precopy_tcp_multifd_start_common(from, to, "zlib"); + return migrate_hook_start_precopy_tcp_multifd_common(from, to, "zlib"); } =20 #ifdef CONFIG_ZSTD static void * -test_migrate_precopy_tcp_multifd_zstd_start(QTestState *from, +migrate_hook_start_precopy_tcp_multifd_zstd(QTestState *from, QTestState *to) { migrate_set_parameter_int(from, "multifd-zstd-level", 2); migrate_set_parameter_int(to, "multifd-zstd-level", 2); =20 - return test_migrate_precopy_tcp_multifd_start_common(from, to, "zstd"); + return migrate_hook_start_precopy_tcp_multifd_common(from, to, "zstd"); } #endif /* CONFIG_ZSTD */ =20 #ifdef CONFIG_QATZIP static void * -test_migrate_precopy_tcp_multifd_qatzip_start(QTestState *from, +migrate_hook_start_precopy_tcp_multifd_qatzip(QTestState *from, QTestState *to) { migrate_set_parameter_int(from, "multifd-qatzip-level", 2); migrate_set_parameter_int(to, "multifd-qatzip-level", 2); =20 - return test_migrate_precopy_tcp_multifd_start_common(from, to, "qatzip= "); + return migrate_hook_start_precopy_tcp_multifd_common(from, to, "qatzip= "); } #endif =20 #ifdef CONFIG_QPL static void * -test_migrate_precopy_tcp_multifd_qpl_start(QTestState *from, +migrate_hook_start_precopy_tcp_multifd_qpl(QTestState *from, QTestState *to) { - return test_migrate_precopy_tcp_multifd_start_common(from, to, "qpl"); + return migrate_hook_start_precopy_tcp_multifd_common(from, to, "qpl"); } #endif /* CONFIG_QPL */ #ifdef CONFIG_UADK static void * -test_migrate_precopy_tcp_multifd_uadk_start(QTestState *from, +migrate_hook_start_precopy_tcp_multifd_uadk(QTestState *from, QTestState *to) { - return test_migrate_precopy_tcp_multifd_start_common(from, to, "uadk"); + return migrate_hook_start_precopy_tcp_multifd_common(from, to, "uadk"); } #endif /* CONFIG_UADK */ =20 @@ -2989,7 +2990,7 @@ static void test_multifd_tcp_uri_none(void) { MigrateCommon args =3D { .listen_uri =3D "defer", - .start_hook =3D test_migrate_precopy_tcp_multifd_start, + .start_hook =3D migrate_hook_start_precopy_tcp_multifd, /* * Multifd is more complicated than most of the features, it * directly takes guest page buffers when sending, make sure @@ -3004,7 +3005,7 @@ static void test_multifd_tcp_zero_page_legacy(void) { MigrateCommon args =3D { .listen_uri =3D "defer", - .start_hook =3D test_migrate_precopy_tcp_multifd_start_zero_page_l= egacy, + .start_hook =3D migrate_hook_start_precopy_tcp_multifd_zero_page_l= egacy, /* * Multifd is more complicated than most of the features, it * directly takes guest page buffers when sending, make sure @@ -3019,7 +3020,7 @@ static void test_multifd_tcp_no_zero_page(void) { MigrateCommon args =3D { .listen_uri =3D "defer", - .start_hook =3D test_migration_precopy_tcp_multifd_start_no_zero_p= age, + .start_hook =3D test_migration_precopy_tcp_multifd_no_zero_page_st= art, /* * Multifd is more complicated than most of the features, it * directly takes guest page buffers when sending, make sure @@ -3034,7 +3035,7 @@ static void test_multifd_tcp_channels_none(void) { MigrateCommon args =3D { .listen_uri =3D "defer", - .start_hook =3D test_migrate_precopy_tcp_multifd_start, + .start_hook =3D migrate_hook_start_precopy_tcp_multifd, .live =3D true, .connect_channels =3D ("[ { 'channel-type': 'main'," " 'addr': { 'transport': 'socket'," @@ -3049,7 +3050,7 @@ static void test_multifd_tcp_zlib(void) { MigrateCommon args =3D { .listen_uri =3D "defer", - .start_hook =3D test_migrate_precopy_tcp_multifd_zlib_start, + .start_hook =3D migrate_hook_start_precopy_tcp_multifd_zlib, }; test_precopy_common(&args); } @@ -3059,7 +3060,7 @@ static void test_multifd_tcp_zstd(void) { MigrateCommon args =3D { .listen_uri =3D "defer", - .start_hook =3D test_migrate_precopy_tcp_multifd_zstd_start, + .start_hook =3D migrate_hook_start_precopy_tcp_multifd_zstd, }; test_precopy_common(&args); } @@ -3070,7 +3071,7 @@ static void test_multifd_tcp_qatzip(void) { MigrateCommon args =3D { .listen_uri =3D "defer", - .start_hook =3D test_migrate_precopy_tcp_multifd_qatzip_start, + .start_hook =3D migrate_hook_start_precopy_tcp_multifd_qatzip, }; test_precopy_common(&args); } @@ -3081,7 +3082,7 @@ static void test_multifd_tcp_qpl(void) { MigrateCommon args =3D { .listen_uri =3D "defer", - .start_hook =3D test_migrate_precopy_tcp_multifd_qpl_start, + .start_hook =3D migrate_hook_start_precopy_tcp_multifd_qpl, }; test_precopy_common(&args); } @@ -3092,7 +3093,7 @@ static void test_multifd_tcp_uadk(void) { MigrateCommon args =3D { .listen_uri =3D "defer", - .start_hook =3D test_migrate_precopy_tcp_multifd_uadk_start, + .start_hook =3D migrate_hook_start_precopy_tcp_multifd_uadk, }; test_precopy_common(&args); } @@ -3100,60 +3101,60 @@ static void test_multifd_tcp_uadk(void) =20 #ifdef CONFIG_GNUTLS static void * -test_migrate_multifd_tcp_tls_psk_start_match(QTestState *from, +migrate_hook_start_multifd_tcp_tls_psk_match(QTestState *from, QTestState *to) { - test_migrate_precopy_tcp_multifd_start_common(from, to, "none"); - return test_migrate_tls_psk_start_match(from, to); + migrate_hook_start_precopy_tcp_multifd_common(from, to, "none"); + return migrate_hook_start_tls_psk_match(from, to); } =20 static void * -test_migrate_multifd_tcp_tls_psk_start_mismatch(QTestState *from, +migrate_hook_start_multifd_tcp_tls_psk_mismatch(QTestState *from, QTestState *to) { - test_migrate_precopy_tcp_multifd_start_common(from, to, "none"); - return test_migrate_tls_psk_start_mismatch(from, to); + migrate_hook_start_precopy_tcp_multifd_common(from, to, "none"); + return migrate_hook_start_tls_psk_mismatch(from, to); } =20 #ifdef CONFIG_TASN1 static void * -test_migrate_multifd_tls_x509_start_default_host(QTestState *from, +migrate_hook_start_multifd_tls_x509_default_host(QTestState *from, QTestState *to) { - test_migrate_precopy_tcp_multifd_start_common(from, to, "none"); - return test_migrate_tls_x509_start_default_host(from, to); + migrate_hook_start_precopy_tcp_multifd_common(from, to, "none"); + return migrate_hook_start_tls_x509_default_host(from, to); } =20 static void * -test_migrate_multifd_tls_x509_start_override_host(QTestState *from, +migrate_hook_start_multifd_tls_x509_override_host(QTestState *from, QTestState *to) { - test_migrate_precopy_tcp_multifd_start_common(from, to, "none"); - return test_migrate_tls_x509_start_override_host(from, to); + migrate_hook_start_precopy_tcp_multifd_common(from, to, "none"); + return migrate_hook_start_tls_x509_override_host(from, to); } =20 static void * -test_migrate_multifd_tls_x509_start_mismatch_host(QTestState *from, +migrate_hook_start_multifd_tls_x509_mismatch_host(QTestState *from, QTestState *to) { - test_migrate_precopy_tcp_multifd_start_common(from, to, "none"); - return test_migrate_tls_x509_start_mismatch_host(from, to); + migrate_hook_start_precopy_tcp_multifd_common(from, to, "none"); + return migrate_hook_start_tls_x509_mismatch_host(from, to); } =20 static void * -test_migrate_multifd_tls_x509_start_allow_anon_client(QTestState *from, +migrate_hook_start_multifd_tls_x509_allow_anon_client(QTestState *from, QTestState *to) { - test_migrate_precopy_tcp_multifd_start_common(from, to, "none"); - return test_migrate_tls_x509_start_allow_anon_client(from, to); + migrate_hook_start_precopy_tcp_multifd_common(from, to, "none"); + return migrate_hook_start_tls_x509_allow_anon_client(from, to); } =20 static void * -test_migrate_multifd_tls_x509_start_reject_anon_client(QTestState *from, +migrate_hook_start_multifd_tls_x509_reject_anon_client(QTestState *from, QTestState *to) { - test_migrate_precopy_tcp_multifd_start_common(from, to, "none"); - return test_migrate_tls_x509_start_reject_anon_client(from, to); + migrate_hook_start_precopy_tcp_multifd_common(from, to, "none"); + return migrate_hook_start_tls_x509_reject_anon_client(from, to); } #endif /* CONFIG_TASN1 */ =20 @@ -3161,8 +3162,8 @@ static void test_multifd_tcp_tls_psk_match(void) { MigrateCommon args =3D { .listen_uri =3D "defer", - .start_hook =3D test_migrate_multifd_tcp_tls_psk_start_match, - .finish_hook =3D test_migrate_tls_psk_finish, + .start_hook =3D migrate_hook_start_multifd_tcp_tls_psk_match, + .end_hook =3D migrate_hook_end_tls_psk, }; test_precopy_common(&args); } @@ -3174,8 +3175,8 @@ static void test_multifd_tcp_tls_psk_mismatch(void) .hide_stderr =3D true, }, .listen_uri =3D "defer", - .start_hook =3D test_migrate_multifd_tcp_tls_psk_start_mismatch, - .finish_hook =3D test_migrate_tls_psk_finish, + .start_hook =3D migrate_hook_start_multifd_tcp_tls_psk_mismatch, + .end_hook =3D migrate_hook_end_tls_psk, .result =3D MIG_TEST_FAIL, }; test_precopy_common(&args); @@ -3186,8 +3187,8 @@ static void test_multifd_tcp_tls_x509_default_host(vo= id) { MigrateCommon args =3D { .listen_uri =3D "defer", - .start_hook =3D test_migrate_multifd_tls_x509_start_default_host, - .finish_hook =3D test_migrate_tls_x509_finish, + .start_hook =3D migrate_hook_start_multifd_tls_x509_default_host, + .end_hook =3D migrate_hook_end_tls_x509, }; test_precopy_common(&args); } @@ -3196,8 +3197,8 @@ static void test_multifd_tcp_tls_x509_override_host(v= oid) { MigrateCommon args =3D { .listen_uri =3D "defer", - .start_hook =3D test_migrate_multifd_tls_x509_start_override_host, - .finish_hook =3D test_migrate_tls_x509_finish, + .start_hook =3D migrate_hook_start_multifd_tls_x509_override_host, + .end_hook =3D migrate_hook_end_tls_x509, }; test_precopy_common(&args); } @@ -3222,8 +3223,8 @@ static void test_multifd_tcp_tls_x509_mismatch_host(v= oid) .hide_stderr =3D true, }, .listen_uri =3D "defer", - .start_hook =3D test_migrate_multifd_tls_x509_start_mismatch_host, - .finish_hook =3D test_migrate_tls_x509_finish, + .start_hook =3D migrate_hook_start_multifd_tls_x509_mismatch_host, + .end_hook =3D migrate_hook_end_tls_x509, .result =3D MIG_TEST_FAIL, }; test_precopy_common(&args); @@ -3233,8 +3234,8 @@ static void test_multifd_tcp_tls_x509_allow_anon_clie= nt(void) { MigrateCommon args =3D { .listen_uri =3D "defer", - .start_hook =3D test_migrate_multifd_tls_x509_start_allow_anon_cli= ent, - .finish_hook =3D test_migrate_tls_x509_finish, + .start_hook =3D migrate_hook_start_multifd_tls_x509_allow_anon_cli= ent, + .end_hook =3D migrate_hook_end_tls_x509, }; test_precopy_common(&args); } @@ -3246,8 +3247,8 @@ static void test_multifd_tcp_tls_x509_reject_anon_cli= ent(void) .hide_stderr =3D true, }, .listen_uri =3D "defer", - .start_hook =3D test_migrate_multifd_tls_x509_start_reject_anon_cl= ient, - .finish_hook =3D test_migrate_tls_x509_finish, + .start_hook =3D migrate_hook_start_multifd_tls_x509_reject_anon_cl= ient, + .end_hook =3D migrate_hook_end_tls_x509, .result =3D MIG_TEST_FAIL, }; test_precopy_common(&args); --=20 2.35.3