From nobody Mon Feb 9 16:18:39 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1658252530; cv=none; d=zohomail.com; s=zohoarc; b=VdtdYIW1C1YNgy3L2HGEjF8TNbuACovZTceA/lY1rgu0rKDTFCGwGtBCiywZ6pqMHzmdt7Qqv+NxVIFncPImaN3ayW1o2PaohRHh1kJj4HpfXFVih37D/kYTNFfgQCf6QECtdIRr291AHBOdcUnAn2jTUhzuJ+UigsawcIV9Tuk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658252530; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HvWHYcne9tO1NS5J2QNhcR4xi2pNzO2vWlRHWLOLvl4=; b=h0hKaIX/l0eyScsgz+3A6qjd4j92oWEqR4MIpXygqkUXKe9ENbtpe40NxGdw+20Ch2BMFapoaBb0cBaEK+1FtcmjUKYZzQ6PfoWpr7mYhTijKKP7c6r0ipyU4A/8K2locpq0uzh8X99Vy1FmP5YYQNuwM6AuJ0LU7A9Ibc9gRtw= 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 1658252530520664.3120865517185; Tue, 19 Jul 2022 10:42:10 -0700 (PDT) Received: from localhost ([::1]:59184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDrEX-0007E7-23 for importer@patchew.org; Tue, 19 Jul 2022 13:42:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDqce-0006rP-2p for qemu-devel@nongnu.org; Tue, 19 Jul 2022 13:03:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:26484) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDqcb-0002xB-AL for qemu-devel@nongnu.org; Tue, 19 Jul 2022 13:02:59 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-523-kdnPPhVVO26TDpiifr52OA-1; Tue, 19 Jul 2022 13:02:54 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 52D188039AD; Tue, 19 Jul 2022 17:02:54 +0000 (UTC) Received: from dgilbert-t580.localhost (unknown [10.33.36.162]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5FE5640CF8E5; Tue, 19 Jul 2022 17:02:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658250176; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HvWHYcne9tO1NS5J2QNhcR4xi2pNzO2vWlRHWLOLvl4=; b=RYyNnZd9qFL0n23JUCIteFtWVGGWNGHJLigHVORE4Xd19u4PHSIri8U4kGjxYxgpIAU+s/ 137mdUBcxZoim1xaDJIOsHew4NwGIOj+1c7zHV2AyNDSstDNzGaoEy+MShQG78Bi6XeDWc Y27xqIMN8VMdwphJr/lc1kVYOBjblzw= X-MC-Unique: kdnPPhVVO26TDpiifr52OA-1 From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, leobras@redhat.com, quintela@redhat.com, berrange@redhat.com, peterx@redhat.com, iii@linux.ibm.com, huangy81@chinatelecom.cn Subject: [PULL 23/29] tests: Add postcopy preempt tests Date: Tue, 19 Jul 2022 18:02:15 +0100 Message-Id: <20220719170221.576190-24-dgilbert@redhat.com> In-Reply-To: <20220719170221.576190-1-dgilbert@redhat.com> References: <20220719170221.576190-1-dgilbert@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 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=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1658252531410100001 Content-Type: text/plain; charset="utf-8" From: Peter Xu Four tests are added for preempt mode: - Postcopy plain - Postcopy recovery - Postcopy tls - Postcopy tls+recovery Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Peter Xu Message-Id: <20220707185530.27801-1-peterx@redhat.com> Signed-off-by: Dr. David Alan Gilbert dgilbert: Manual merge --- tests/qtest/migration-test.c | 57 ++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index e9350ea8c6..02f2ef9f49 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -576,6 +576,7 @@ typedef struct { =20 /* Postcopy specific fields */ void *postcopy_data; + bool postcopy_preempt; } MigrateCommon; =20 static int test_migrate_start(QTestState **from, QTestState **to, @@ -1081,6 +1082,11 @@ static int migrate_postcopy_prepare(QTestState **fro= m_ptr, migrate_set_capability(to, "postcopy-ram", true); migrate_set_capability(to, "postcopy-blocktime", true); =20 + if (args->postcopy_preempt) { + migrate_set_capability(from, "postcopy-preempt", true); + migrate_set_capability(to, "postcopy-preempt", true); + } + migrate_ensure_non_converge(from); =20 /* Wait for the first serial output from the source */ @@ -1146,6 +1152,26 @@ static void test_postcopy_tls_psk(void) } #endif =20 +static void test_postcopy_preempt(void) +{ + MigrateCommon args =3D { + .postcopy_preempt =3D true, + }; + + test_postcopy_common(&args); +} + +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, + }; + + test_postcopy_common(&args); +} + static void test_postcopy_recovery_common(MigrateCommon *args) { QTestState *from, *to; @@ -1225,6 +1251,27 @@ static void test_postcopy_recovery_tls_psk(void) test_postcopy_recovery_common(&args); } =20 +static void test_postcopy_preempt_recovery(void) +{ + MigrateCommon args =3D { + .postcopy_preempt =3D true, + }; + + test_postcopy_recovery_common(&args); +} + +/* This contains preempt+recovery+tls test altogether */ +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, + }; + + test_postcopy_recovery_common(&args); +} + static void test_baddest(void) { MigrateStart args =3D { @@ -2425,10 +2472,12 @@ int main(int argc, char **argv) module_call_init(MODULE_INIT_QOM); =20 qtest_add_func("/migration/postcopy/unix", test_postcopy); + qtest_add_func("/migration/postcopy/plain", test_postcopy); qtest_add_func("/migration/postcopy/recovery/plain", test_postcopy_recovery); - - qtest_add_func("/migration/postcopy/plain", test_postcopy); + qtest_add_func("/migration/postcopy/preempt/plain", test_postcopy_pree= mpt); + qtest_add_func("/migration/postcopy/preempt/recovery/plain", + test_postcopy_preempt_recovery); =20 qtest_add_func("/migration/bad_dest", test_baddest); qtest_add_func("/migration/precopy/unix/plain", test_precopy_unix_plai= n); @@ -2444,6 +2493,10 @@ int main(int argc, char **argv) qtest_add_func("/migration/postcopy/tls/psk", test_postcopy_tls_psk); qtest_add_func("/migration/postcopy/recovery/tls/psk", test_postcopy_recovery_tls_psk); + qtest_add_func("/migration/postcopy/preempt/tls/psk", + test_postcopy_preempt_tls_psk); + qtest_add_func("/migration/postcopy/preempt/recovery/tls/psk", + test_postcopy_preempt_all); #ifdef CONFIG_TASN1 qtest_add_func("/migration/precopy/unix/tls/x509/default-host", test_precopy_unix_tls_x509_default_host); --=20 2.36.1