From nobody Fri Apr 19 09:24:33 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623286474; cv=none; d=zohomail.com; s=zohoarc; b=K5DmfcZ8rUNkUF6OH2q3EAeaR0D645OOStjGV5M3NI+bR8kO0yo+nebhBZi0mc+zVjx1DeublHP7ECYszeKqa5M3oEBFboo5ifrjKAwDdIxfgmu2zG6n2aHp1e7kQWheNEWxkMR8OWQG41JAFa7zel5Cvqc7Y522mP1rPKNohsU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623286474; h=Content-Type:Content-Transfer-Encoding:Cc: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=6pPkLQN+1+I88h2fyXfx1J7SfMF09T6TVeclkO792zc=; b=kxnK9NO/GFLY7HvqWiRhukz72Hn0A5YO9BkIp5ZDNuo74Bf0cHuDEnqmUBy//GEl3CFW0pP1ZP7ZMPEpRREabHRhY+FO4Mqq2ytmR5HsyeUo+AZQAUe01xn2712/Z/tNi245iQqF+CsBZPzXoIUBQLAWQXSsAB765QdvRe7svHw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623286474188833.8316113622511; Wed, 9 Jun 2021 17:54:34 -0700 (PDT) Received: from localhost ([::1]:36846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lr8xr-0002Du-BX for importer2@patchew.org; Wed, 09 Jun 2021 20:54:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lr8wC-0000GB-Rr for qemu-devel@nongnu.org; Wed, 09 Jun 2021 20:52:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lr8wB-000607-B5 for qemu-devel@nongnu.org; Wed, 09 Jun 2021 20:52:48 -0400 Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-456-IxdLjEo8NcGmSEofBXg1Yw-1; Wed, 09 Jun 2021 20:52:45 -0400 Received: by mail-qv1-f69.google.com with SMTP id t7-20020ad45bc70000b029023930e98a57so4191074qvt.18 for ; Wed, 09 Jun 2021 17:52:45 -0700 (PDT) Received: from localhost.localdomain (bras-base-toroon474qw-grc-88-174-93-75-200.dsl.bell.ca. [174.93.75.200]) by smtp.gmail.com with ESMTPSA id x15sm1279045qkh.19.2021.06.09.17.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 17:52:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623286366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6pPkLQN+1+I88h2fyXfx1J7SfMF09T6TVeclkO792zc=; b=SOc+WYcpsfHyYEVmDh1MlronDb29PTorGXMzdVHvhLYz5E5yJJRwX5jHyW2DkTzfTIHsd2 WNeAWF4DCXGHgtX23yayWIjjSwBux0mNIc4WclODj3PXXJwNxlhImfZKmLuwdPyhNgMC4f x3p+dscd4B+qMlLU26sg5srIrqt22AM= X-MC-Unique: IxdLjEo8NcGmSEofBXg1Yw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6pPkLQN+1+I88h2fyXfx1J7SfMF09T6TVeclkO792zc=; b=l0Oogm2qKWF2ZvSyhoiC2KF/oDK41xA9ekAtnr5wXQfIq91stylrgAnqBPLBQv8NeZ uL7ZQ0AT/sDzuROrmvjjze5y7EOgwnIBbPKCmTAvwvRtKrVhpkYBcFUshcIK6sD1anFB gDWxnSRLzP4uFBcUG6W7lGJAOEs4uoXFEZVWDJ+deXZAfQpWXIKGJWjug+VMjKWSh/qG 1NTlXCjZkF4DSoiJYCt+XOCr6+ivBpigtRi9aHsOPF0Bfc8wg2U/8bgZ1aPncIGiClim C70ulsF/nmMDMKJy04uSHJJmpUujc5re2klNJScpp+vGTVgI+0RPltvondjxhhURdY1L u8zQ== X-Gm-Message-State: AOAM533G5YTb4LcrAYVq3MjUR5EJ/mmidEiDeShKs8Ij+zZ6xGbVoZ4w 7EecJZqHvLNizd3FxeE6ryRr3u7uwt7Ky4lRnv3NhFuDEfe0GcI1VVvB86WeP6sFSEaZChimZBY hq1b76K/3MtNEQxtBcNbwVFZ0h4QkPvnGA5lwR8tJPlEYzYuc2mmi/MWX1cfXXX5j X-Received: by 2002:ad4:4631:: with SMTP id x17mr2886273qvv.28.1623286364805; Wed, 09 Jun 2021 17:52:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFsiaxNdAvAuOHqhfYSkeT//DaETwLmRFT1n7qvb535cep0YtaYjMfHBYGc8VYgBW0pQguWA== X-Received: by 2002:ad4:4631:: with SMTP id x17mr2886242qvv.28.1623286364489; Wed, 09 Jun 2021 17:52:44 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH 1/2] tests: migration-test: Still run the rest even if uffd missing Date: Wed, 9 Jun 2021 20:52:38 -0400 Message-Id: <20210610005239.265588-2-peterx@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210610005239.265588-1-peterx@redhat.com> References: <20210610005239.265588-1-peterx@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Leonardo Bras Soares Passos , "Dr . David Alan Gilbert" , peterx@redhat.com, Juan Quintela Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Currently we'll skip the whole migration-test if uffd missing. It's a bit harsh - we can still run the rest besides postcopy! Enable them when we still can. It'll happen more frequently now after kernel UFFD_USER_MODE_ONLY introduce= d in commit 37cd0575b8510159, as qemu test normally requires kernel faults. One alternative is we disable kvm and create the uffd with UFFD_USER_MODE_ONLY = for all postcopy tests, however to be simple for now just skip postcopy tests o= nly by default. If we wanna run them use "sudo" or root, they'll still work. = In all cases, it's still better than running nothing for migration-test. Signed-off-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert --- tests/qtest/migration-test.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index 2b028df6875..d9225f58d4d 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -1376,10 +1376,6 @@ int main(int argc, char **argv) =20 g_test_init(&argc, &argv, NULL); =20 - if (!ufd_version_check()) { - return g_test_run(); - } - /* * On ppc64, the test only works with kvm-hv, but not with kvm-pr and = TCG * is touchy due to race conditions on dirty bits (especially on PPC f= or @@ -1416,8 +1412,11 @@ int main(int argc, char **argv) =20 module_call_init(MODULE_INIT_QOM); =20 - qtest_add_func("/migration/postcopy/unix", test_postcopy); - qtest_add_func("/migration/postcopy/recovery", test_postcopy_recovery); + if (ufd_version_check()) { + qtest_add_func("/migration/postcopy/unix", test_postcopy); + qtest_add_func("/migration/postcopy/recovery", test_postcopy_recov= ery); + } + qtest_add_func("/migration/bad_dest", test_baddest); qtest_add_func("/migration/precopy/unix", test_precopy_unix); qtest_add_func("/migration/precopy/tcp", test_precopy_tcp); --=20 2.31.1 From nobody Fri Apr 19 09:24:33 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623286484; cv=none; d=zohomail.com; s=zohoarc; b=CrwOz8Mj1o/1TBvcia4PB2dFCE9+XQW/kNdhiDn6VJpVFCHNInoX/Gyb/MnZuI4CK0888xFjnRuHFnwcSvaP6HMf7U93G95v0hklTOc88EAUqp74J8DgAlGh8/y6Eg5Fga4eTE1eX96ZbESJ0OCtBgdCKt07kNtjzG1QzIRrQJA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623286484; h=Content-Type:Content-Transfer-Encoding:Cc: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=Xz7gPKJi1P+S2bCEHZR3IyS2v9tqXbNNUKe6yuo2NRw=; b=XOgSFdkyiyUE0pQVtMuSHWCCwCGFfRtIzrdFkiKV9nAgNUIBS70ujvsWjNXSQFnP0FRui9QYufDofCV5K5LwpgvU0rUuAS5swMF9Eh+hJ+94wmnFVaA8LkIW0Peya0Klhl8ok0O3lmOVeFRtyrmbZQSIGKLcxi2xrsXREobFuFQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623286484758264.1223633692174; Wed, 9 Jun 2021 17:54:44 -0700 (PDT) Received: from localhost ([::1]:37066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lr8y3-0002Mn-Ol for importer2@patchew.org; Wed, 09 Jun 2021 20:54:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lr8wE-0000Hf-Pz for qemu-devel@nongnu.org; Wed, 09 Jun 2021 20:52:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45351) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lr8wD-000621-48 for qemu-devel@nongnu.org; Wed, 09 Jun 2021 20:52:50 -0400 Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-306-RG8p2FvpOASpSIFGc-OeSQ-1; Wed, 09 Jun 2021 20:52:47 -0400 Received: by mail-qk1-f198.google.com with SMTP id 2-20020a3709020000b02903aa9873df32so8643246qkj.15 for ; Wed, 09 Jun 2021 17:52:47 -0700 (PDT) Received: from localhost.localdomain (bras-base-toroon474qw-grc-88-174-93-75-200.dsl.bell.ca. [174.93.75.200]) by smtp.gmail.com with ESMTPSA id x15sm1279045qkh.19.2021.06.09.17.52.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 17:52:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623286368; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xz7gPKJi1P+S2bCEHZR3IyS2v9tqXbNNUKe6yuo2NRw=; b=HgzKAI9TGJhEoNNSOe12TazFLJ+RrpLjqOOQ84OiElGdijOOyEGGVxUZ+MeunB8z4B3Kg3 LWHKzOF2MtRss+e3+ukB4ZZg9gMOpO0tXKGRpCxojXDBoShP5gf6ZmDaPrDa+zHzdXw6Qm ok9prRDyF6WuAFjsPXTDM5QRJ43thFs= X-MC-Unique: RG8p2FvpOASpSIFGc-OeSQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Xz7gPKJi1P+S2bCEHZR3IyS2v9tqXbNNUKe6yuo2NRw=; b=bunJqJ1gU+WT4M2ivl4yP/fQ5uT1XVr3kKDxbU7Tawq/XYyVqRWttpG7bbnpZyvEtp S0fPHN5ps46Nb5iYQw3fSsFKSUgK3AgNZ+k7+SUCMshTbxsVSu1LiLCk9M1woFsPBfVD ybi56LiNdhdmdzXKlJ76XPsHuqoXVMaFF2B63ZZqOGXB1Mq07arTYRvmSAPQuT4xTqcR mFDj00ObG+AaXiM+JQ7Hfjx7XCYo99mV5IMmimRL1szM/bwS4o6504HxHCQ3IDVA1wQ4 IU2H5IOV+Z5Zgwxq011pi/zj7tmtDC4YDxCNHVwPYdMj5RDRCjwpPnCHzyokxfYxnfUH thqw== X-Gm-Message-State: AOAM533eV1WxZnvnjfvqCFpMeDJtqGCxXspI+hopMaiJiRtVyJuBdmmf OfoiQVmhWxDwIefa2z/YfrApbE2wQO/gPBqST+MP0pFMUQgJvFV7L52i2AVLueIgiBZQLGu9ti6 F5n5wq6g29pOfsYRFRh8XKGT5yR3iasMg4RjdZegh7Dio+r5FXJ8s9jbkzDZ/G9jy X-Received: by 2002:a37:dc82:: with SMTP id v124mr2427192qki.342.1623286366425; Wed, 09 Jun 2021 17:52:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoDTrKI1er7am9ktn69pGTR6HS5IpjkptK1pKFIXel8pSauNPXrtsAqAbapH1RG9FZVJPKOw== X-Received: by 2002:a37:dc82:: with SMTP id v124mr2427170qki.342.1623286366174; Wed, 09 Jun 2021 17:52:46 -0700 (PDT) From: Peter Xu To: qemu-devel@nongnu.org Subject: [PATCH 2/2] tests: migration-test: Add dirty ring test Date: Wed, 9 Jun 2021 20:52:39 -0400 Message-Id: <20210610005239.265588-3-peterx@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210610005239.265588-1-peterx@redhat.com> References: <20210610005239.265588-1-peterx@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=peterx@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Leonardo Bras Soares Passos , "Dr . David Alan Gilbert" , peterx@redhat.com, Juan Quintela Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Add dirty ring test if kernel supports it. Add the dirty ring parameter on source should be mostly enough, but let's change the dest too to make them match always. Signed-off-by: Peter Xu Reviewed-by: Dr. David Alan Gilbert --- tests/qtest/migration-test.c | 51 +++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c index d9225f58d4d..cc6e396d1a2 100644 --- a/tests/qtest/migration-test.c +++ b/tests/qtest/migration-test.c @@ -12,6 +12,7 @@ =20 #include "qemu/osdep.h" =20 +#include #include "libqos/libqtest.h" #include "qapi/error.h" #include "qapi/qmp/qdict.h" @@ -467,6 +468,8 @@ typedef struct { bool use_shmem; /* only launch the target process */ bool only_target; + /* Use dirty ring if true; dirty logging otherwise */ + bool use_dirty_ring; char *opts_source; char *opts_target; } MigrateStart; @@ -573,11 +576,13 @@ static int test_migrate_start(QTestState **from, QTes= tState **to, shmem_opts =3D g_strdup(""); } =20 - cmd_source =3D g_strdup_printf("-accel kvm -accel tcg%s%s " + cmd_source =3D g_strdup_printf("-accel kvm%s -accel tcg%s%s " "-name source,debug-threads=3Don " "-m %s " "-serial file:%s/src_serial " "%s %s %s %s", + args->use_dirty_ring ? + ",dirty-ring-size=3D4096" : "", machine_opts ? " -machine " : "", machine_opts ? machine_opts : "", memory_size, tmpfs, @@ -587,12 +592,14 @@ static int test_migrate_start(QTestState **from, QTes= tState **to, *from =3D qtest_init(cmd_source); } =20 - cmd_target =3D g_strdup_printf("-accel kvm -accel tcg%s%s " + cmd_target =3D g_strdup_printf("-accel kvm%s -accel tcg%s%s " "-name target,debug-threads=3Don " "-m %s " "-serial file:%s/dest_serial " "-incoming %s " "%s %s %s %s", + args->use_dirty_ring ? + ",dirty-ring-size=3D4096" : "", machine_opts ? " -machine " : "", machine_opts ? machine_opts : "", memory_size, tmpfs, uri, @@ -785,12 +792,14 @@ static void test_baddest(void) test_migrate_end(from, to, false); } =20 -static void test_precopy_unix(void) +static void test_precopy_unix_common(bool dirty_ring) { g_autofree char *uri =3D g_strdup_printf("unix:%s/migsocket", tmpfs); MigrateStart *args =3D migrate_start_new(); QTestState *from, *to; =20 + args->use_dirty_ring =3D dirty_ring; + if (test_migrate_start(&from, &to, uri, args)) { return; } @@ -825,6 +834,18 @@ static void test_precopy_unix(void) test_migrate_end(from, to, true); } =20 +static void test_precopy_unix(void) +{ + /* Using default dirty logging */ + test_precopy_unix_common(false); +} + +static void test_precopy_unix_dirty_ring(void) +{ + /* Using dirty ring tracking */ + test_precopy_unix_common(true); +} + #if 0 /* Currently upset on aarch64 TCG */ static void test_ignore_shared(void) @@ -1369,6 +1390,25 @@ static void test_multifd_tcp_cancel(void) test_migrate_end(from, to2, true); } =20 +static bool kvm_dirty_ring_supported(void) +{ + int ret, kvm_fd =3D open("/dev/kvm", O_RDONLY); + + if (kvm_fd < 0) { + return false; + } + + ret =3D ioctl(kvm_fd, KVM_CHECK_EXTENSION, KVM_CAP_DIRTY_LOG_RING); + close(kvm_fd); + + /* We test with 4096 slots */ + if (ret < 4096) { + return false; + } + + return true; +} + int main(int argc, char **argv) { char template[] =3D "/tmp/migration-test-XXXXXX"; @@ -1438,6 +1478,11 @@ int main(int argc, char **argv) qtest_add_func("/migration/multifd/tcp/zstd", test_multifd_tcp_zstd); #endif =20 + if (kvm_dirty_ring_supported()) { + qtest_add_func("/migration/dirty_ring", + test_precopy_unix_dirty_ring); + } + ret =3D g_test_run(); =20 g_assert_cmpint(ret, =3D=3D, 0); --=20 2.31.1