From nobody Tue Nov 26 02:19:41 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=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1710179576; cv=none; d=zohomail.com; s=zohoarc; b=Rgai4RLBi70vor1iaLCQU8S5B7nlUiULEqQU/ezmBuN9IAttJlz19jt9QRATvZSIgINS6TP65ghTAzgXO6GE8sa8349uKNLomtQ1HLhZ9vjjhqZdKGXqJdzrGxj9TPXRtE5KbdbMlYOY9uM8OjjqstOsHiCQjBO4pfCXe+YmQs8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710179576; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FLlBgyBUTZ2VoVYLUX1GtBuTOq7vOLX5VzP19Gzxn68=; b=czABGRAjoXGbJpNuJSuwxBBZcEORyPdFu6CrjlzIOWDYoBEdvhRubpZgIvTr27eh0yGHvg0NapPsH3n0/XosrMzIbBl1Oxe6dfzbC43lAvhtRUeBQWn70jXm/cma4VaR74N+04wvt9qHXjggCOMXgIAqLJSLjLKEy/ubKJHQ72E= 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 1710179576657137.36956653800144; Mon, 11 Mar 2024 10:52:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjjm1-0001yt-GS; Mon, 11 Mar 2024 13:49:17 -0400 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 1rjjlw-0001xL-7l for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:13 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjjlt-0008UE-Kz for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:11 -0400 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42BG430Q008556; Mon, 11 Mar 2024 17:49:03 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wrftdc22d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:03 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 42BHkjb0028544; Mon, 11 Mar 2024 17:49:03 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wre763321-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:02 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 42BHlHcg020033; Mon, 11 Mar 2024 17:49:02 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wre763302-2; Mon, 11 Mar 2024 17:49:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=FLlBgyBUTZ2VoVYLUX1GtBuTOq7vOLX5VzP19Gzxn68=; b=OfTItMQpurPK6cpJUjCp3d90+acs65LYJLiFV+iuAdsZJM81RF/G2jB0QymFInICOWNL wMXT84e1hfo3mjnNLtFZ6gXhsz0H/yDVQNghZhdfKFFuLmu0z3pQf0wjbd2hJMaJcUJ3 TlRqnZ6KeduOCW5w5dCuJUdVRwrUgdE66aPlxNUl17AIRbgx+vUNGc/6qKHxXARGL9P6 Yjp9DVkJ2y+4E7eb79PfKYMmsEIFALEHnyJJc5HAU9SQ0ydfOs9ribflriD03lnJSbhP uLoCto4PLf2WnbNc1gcBgZAN7WfjiBxCNxfVyNpl5ETzEFvpdq5axpJJ8UjyRFNAgsrf bA== From: Steve Sistare To: qemu-devel@nongnu.org Cc: Alex Williamson , Cedric Le Goater , "Michael S. Tsirkin" , David Hildenbrand , Peter Xu , Fabiano Rosas , Hailiang Zhang , Zhang Chen , Li Zhijian , Jason Wang , Hyman Huang , Song Gao , Alistair Francis , Steve Sistare Subject: [PATCH V2 01/11] migration: remove migration.h references Date: Mon, 11 Mar 2024 10:48:48 -0700 Message-Id: <1710179338-294359-2-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> References: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-11_10,2024-03-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403110136 X-Proofpoint-ORIG-GUID: 1shvOFzZFuCWOFACUkZeuQab5RFt9Osd X-Proofpoint-GUID: 1shvOFzZFuCWOFACUkZeuQab5RFt9Osd 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=205.220.177.32; envelope-from=steven.sistare@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, 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, 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1710179578374100003 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Remove migration.h from files that no longer need it due to previous commits. Signed-off-by: Steve Sistare --- hw/vfio/container.c | 1 - hw/virtio/vhost-user.c | 1 - hw/virtio/virtio-balloon.c | 1 - system/qdev-monitor.c | 1 - target/loongarch/kvm/kvm.c | 1 - tests/unit/test-vmstate.c | 1 - 6 files changed, 6 deletions(-) diff --git a/hw/vfio/container.c b/hw/vfio/container.c index bd25b9f..ff081a1 100644 --- a/hw/vfio/container.c +++ b/hw/vfio/container.c @@ -32,7 +32,6 @@ #include "sysemu/reset.h" #include "trace.h" #include "qapi/error.h" -#include "migration/migration.h" #include "pci.h" =20 VFIOGroupList vfio_group_list =3D diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index a1eea85..1af8621 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -26,7 +26,6 @@ #include "qemu/sockets.h" #include "sysemu/runstate.h" #include "sysemu/cryptodev.h" -#include "migration/migration.h" #include "migration/postcopy-ram.h" #include "trace.h" #include "exec/ramblock.h" diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index a59ff17..609e39a 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -31,7 +31,6 @@ #include "trace.h" #include "qemu/error-report.h" #include "migration/misc.h" -#include "migration/migration.h" =20 #include "hw/virtio/virtio-bus.h" #include "hw/virtio/virtio-access.h" diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index a13db76..948d393 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -38,7 +38,6 @@ #include "qemu/option_int.h" #include "sysemu/block-backend.h" #include "migration/misc.h" -#include "migration/migration.h" #include "qemu/cutils.h" #include "hw/qdev-properties.h" #include "hw/clock.h" diff --git a/target/loongarch/kvm/kvm.c b/target/loongarch/kvm/kvm.c index c19978a..11a69a3 100644 --- a/target/loongarch/kvm/kvm.c +++ b/target/loongarch/kvm/kvm.c @@ -22,7 +22,6 @@ #include "hw/irq.h" #include "qemu/log.h" #include "hw/loader.h" -#include "migration/migration.h" #include "sysemu/runstate.h" #include "cpu-csr.h" #include "kvm_loongarch.h" diff --git a/tests/unit/test-vmstate.c b/tests/unit/test-vmstate.c index c4f9faa..63f28f2 100644 --- a/tests/unit/test-vmstate.c +++ b/tests/unit/test-vmstate.c @@ -24,7 +24,6 @@ =20 #include "qemu/osdep.h" =20 -#include "../migration/migration.h" #include "migration/vmstate.h" #include "migration/qemu-file-types.h" #include "../migration/qemu-file.h" --=20 1.8.3.1 From nobody Tue Nov 26 02:19:41 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=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1710179368; cv=none; d=zohomail.com; s=zohoarc; b=LWG0Vnm+KMowe9lV3ZBkJ78IYvPpqJiL2NQgeyB4XQ2nK6M+1lH7pGnkphE7hZQpGl3DkLS4KQ8h8sjXeR5vGdl3CYFqLBXrjWxc0CqHE0khyhCKc/Ikv0dsT0mQqKEVqLBYbnFFwk2C7J/MltvN/7B/6r/vduAkvpRHW0kaD5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710179368; h=Content-Type: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=gxgLnnp934i6FDmq9Wme3lEwAj4uQvZ6UCowlpA+g+g=; b=lyTlz3IPXLM/2Po1Fr2SCkZ9/SngPPZ683PYgGmH6NlX7oKNTu5CNK4DhEidJaUualXsg0J+KZyPCEiwGG4W+g3C2zcmlBEqpBMSzXGc+1xuUbYzfOTwXhtVvaQ0PXesVLrTwha1x6kfLijyGFt1/mEvF8KDjWJhNvuvvr0kALo= 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 1710179368594618.4702555969048; Mon, 11 Mar 2024 10:49:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjjm0-0001yN-Uz; Mon, 11 Mar 2024 13:49:17 -0400 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 1rjjlz-0001xs-Te for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:15 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjjlx-0008Ub-QK for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:15 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42BG3pdt020981; Mon, 11 Mar 2024 17:49:06 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wrfcuc0yu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:05 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 42BHexvJ028568; Mon, 11 Mar 2024 17:49:04 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wre763339-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:04 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 42BHlHci020033; Mon, 11 Mar 2024 17:49:04 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wre763302-3; Mon, 11 Mar 2024 17:49:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2023-11-20; bh=gxgLnnp934i6FDmq9Wme3lEwAj4uQvZ6UCowlpA+g+g=; b=RRsWT9RZ5011ziiTukroXzHu6R2ctC2PkdqSwWlKgyO77GY6Yl3YQ1NDMwxNUamiPItK Q0tyX8ChxN9NvZV5NSgSTGvS7XHQkuXY71LbRn7yohqd0IIVEVx/RPQE6TEvBhtgFwKW kfaEQuehKrc2N4MlZ4T6E2kNHUlDN2bC7BMJ4AEhnv0nHx57cXXq1WjB/1SE6gv5li3V h8vD5muXTp0NqMnfXJRz2h5ctiv2TO9FcafhiSaRToyGWRz1cb6+PCRy/S96HFfpZrE6 IquMVCfotohDscluY4K7dVH1tsh9VEqoYFLNqjST9yJKpByoaK93le2bOYcgCouy8qzX Tg== From: Steve Sistare To: qemu-devel@nongnu.org Cc: Alex Williamson , Cedric Le Goater , "Michael S. Tsirkin" , David Hildenbrand , Peter Xu , Fabiano Rosas , Hailiang Zhang , Zhang Chen , Li Zhijian , Jason Wang , Hyman Huang , Song Gao , Alistair Francis , Steve Sistare Subject: [PATCH V2 02/11] migration: export migration_is_setup_or_active Date: Mon, 11 Mar 2024 10:48:49 -0700 Message-Id: <1710179338-294359-3-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> References: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-11_10,2024-03-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403110136 X-Proofpoint-ORIG-GUID: o2O7xd7zDaSiYlxho-6rYlDt6kyJNJll X-Proofpoint-GUID: o2O7xd7zDaSiYlxho-6rYlDt6kyJNJll 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=205.220.177.32; envelope-from=steven.sistare@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, 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, 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1710179369812100003 Delete the MigrationState parameter from migration_is_setup_or_active and move it to the public API in misc.h. Signed-off-by: Steve Sistare Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/vfio/common.c | 2 +- include/migration/misc.h | 1 + migration/migration.c | 12 ++++++------ migration/migration.h | 1 - migration/ram.c | 5 ++--- net/vhost-vdpa.c | 3 +-- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 059bfdc..896eab8 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -152,7 +152,7 @@ static void vfio_set_migration_error(int err) { MigrationState *ms =3D migrate_get_current(); =20 - if (migration_is_setup_or_active(ms->state)) { + if (migration_is_setup_or_active()) { WITH_QEMU_LOCK_GUARD(&ms->qemu_file_lock) { if (ms->to_dst_file) { qemu_file_set_error(ms->to_dst_file, err); diff --git a/include/migration/misc.h b/include/migration/misc.h index 4c226a4..79cff62 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -61,6 +61,7 @@ void migration_object_init(void); void migration_shutdown(void); bool migration_is_idle(void); bool migration_is_active(MigrationState *); +bool migration_is_setup_or_active(void); bool migrate_mode_is_cpr(MigrationState *); =20 typedef enum MigrationEventType { diff --git a/migration/migration.c b/migration/migration.c index a49fcd5..af21403 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1081,9 +1081,11 @@ void migrate_send_rp_resume_ack(MigrationIncomingSta= te *mis, uint32_t value) * Return true if we're already in the middle of a migration * (i.e. any of the active or setup states) */ -bool migration_is_setup_or_active(int state) +bool migration_is_setup_or_active(void) { - switch (state) { + MigrationState *s =3D current_migration; + + switch (s->state) { case MIGRATION_STATUS_ACTIVE: case MIGRATION_STATUS_POSTCOPY_ACTIVE: case MIGRATION_STATUS_POSTCOPY_PAUSED: @@ -1601,10 +1603,8 @@ bool migration_incoming_postcopy_advised(void) =20 bool migration_in_bg_snapshot(void) { - MigrationState *s =3D migrate_get_current(); - return migrate_background_snapshot() && - migration_is_setup_or_active(s->state); + migration_is_setup_or_active(); } =20 bool migration_is_idle(void) @@ -2297,7 +2297,7 @@ static void *source_return_path_thread(void *opaque) trace_source_return_path_thread_entry(); rcu_register_thread(); =20 - while (migration_is_setup_or_active(ms->state)) { + while (migration_is_setup_or_active()) { trace_source_return_path_thread_loop_top(); =20 header_type =3D qemu_get_be16(rp); diff --git a/migration/migration.h b/migration/migration.h index 65c0b61..736460a 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -479,7 +479,6 @@ bool migrate_has_error(MigrationState *s); =20 void migrate_fd_connect(MigrationState *s, Error *error_in); =20 -bool migration_is_setup_or_active(int state); bool migration_is_running(int state); =20 int migrate_init(MigrationState *s, Error **errp); diff --git a/migration/ram.c b/migration/ram.c index c79e3de..b8a5b67 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2909,10 +2909,9 @@ void qemu_guest_free_page_hint(void *addr, size_t le= n) RAMBlock *block; ram_addr_t offset; size_t used_len, start, npages; - MigrationState *s =3D migrate_get_current(); =20 /* This function is currently expected to be used during live migratio= n */ - if (!migration_is_setup_or_active(s->state)) { + if (!migration_is_setup_or_active()) { return; } =20 @@ -3257,7 +3256,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) =20 out: if (ret >=3D 0 - && migration_is_setup_or_active(migrate_get_current()->state)) { + && migration_is_setup_or_active()) { if (migrate_multifd() && migrate_multifd_flush_after_each_section(= ) && !migrate_mapped_ram()) { ret =3D multifd_send_sync_main(); diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index e6bdb45..8564817 100644 --- a/net/vhost-vdpa.c +++ b/net/vhost-vdpa.c @@ -26,7 +26,6 @@ #include #include "standard-headers/linux/virtio_net.h" #include "monitor/monitor.h" -#include "migration/migration.h" #include "migration/misc.h" #include "hw/virtio/vhost.h" =20 @@ -355,7 +354,7 @@ static int vhost_vdpa_net_data_start(NetClientState *nc) assert(nc->info->type =3D=3D NET_CLIENT_DRIVER_VHOST_VDPA); =20 if (s->always_svq || - migration_is_setup_or_active(migrate_get_current()->state)) { + migration_is_setup_or_active()) { v->shadow_vqs_enabled =3D true; } else { v->shadow_vqs_enabled =3D false; --=20 1.8.3.1 From nobody Tue Nov 26 02:19:41 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=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1710179370; cv=none; d=zohomail.com; s=zohoarc; b=jA/Tn83ai4WqZhWhbAVGZtyVFHdoTsIXjtvVMg4UgQ3vpSLZyQu6R3Q7IF5k/TX/X1HPv8t/mMv8y2pJ9J3Am+xx7Q7kMDBGokgDfcgXZz9PJW7ulyJFmgxkJdi06YsvnlhrrVnrtCKYxBEIjEuHKQe6CDNApMHfC9pYQaz+hqA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710179370; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=f8GCt+gZn671HVbv/xnXQbZVpwcvOqcAziuggFQOfUk=; b=Rmt4ECQA2FI/M/Xfhfp+22llcQlYygxNxT4tCHTORAEarJqax8QghzDUSQnsJpLA6YisEjjDeTiXPMJvrpEHmpmAfSKe/igAlBeekX8HP3qxcQ+VnrmVB02sYzxD5TlvJzYCGMmIAV7onVpwM/syqCjEJpySF2hvYoBPANmWTDE= 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 1710179370592984.2501894133669; Mon, 11 Mar 2024 10:49:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjjm2-0001z5-Uj; Mon, 11 Mar 2024 13:49:18 -0400 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 1rjjm0-0001yL-Nt for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:16 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjjly-0008Uo-C4 for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:15 -0400 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42BG40Fp008047; Mon, 11 Mar 2024 17:49:07 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wrftdc22s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:07 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 42BHkjb3028544; Mon, 11 Mar 2024 17:49:06 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wre76334n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:06 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 42BHlHck020033; Mon, 11 Mar 2024 17:49:06 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wre763302-4; Mon, 11 Mar 2024 17:49:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=f8GCt+gZn671HVbv/xnXQbZVpwcvOqcAziuggFQOfUk=; b=MG2pIIMb+8ahRNuV7qW0kkvB+6HuSryKzhan0Yg1JUXfBsDXbncdBmn7VWmDHbMjcQmD ne64zD0NzIxUanjL4y5FuNAT/dd8GgNuoeJZdIemj2w4ouPLHMj9dnxJNe+2/UDGO7PV P+uNbBQ+3ZruJPq/7XMAKqoHx6uWJ2wLF90Dg9LawW9+O7NdxEsyaru87ErGSYYgQqKd dZ5eCbHB4sD0EZ0Zb+OBOYCv7SCxgcjQ811jzBr5FXLryfZzWQ7Zj7ZHEsXVzBOwpXEx qxNDse8Hf/OAPmnEGJfzzUwYG3qSFLNNw2nM7qC8c+YGus3tqFOeNG2VncVEW6BwBKOZ tA== From: Steve Sistare To: qemu-devel@nongnu.org Cc: Alex Williamson , Cedric Le Goater , "Michael S. Tsirkin" , David Hildenbrand , Peter Xu , Fabiano Rosas , Hailiang Zhang , Zhang Chen , Li Zhijian , Jason Wang , Hyman Huang , Song Gao , Alistair Francis , Steve Sistare Subject: [PATCH V2 03/11] migration: export migration_is_active Date: Mon, 11 Mar 2024 10:48:50 -0700 Message-Id: <1710179338-294359-4-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> References: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-11_10,2024-03-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403110136 X-Proofpoint-ORIG-GUID: Q2jEYgQLbrNFgRAnVA59tM2moubwSzwA X-Proofpoint-GUID: Q2jEYgQLbrNFgRAnVA59tM2moubwSzwA 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=205.220.177.32; envelope-from=steven.sistare@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, 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, 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1710179371792100007 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Delete the MigrationState parameter from migration_is_active so it can be exported and used without including migration.h. Signed-off-by: Steve Sistare --- hw/vfio/common.c | 4 ++-- include/migration/misc.h | 2 +- migration/migration.c | 10 ++++++---- system/dirtylimit.c | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 896eab8..2dbbf62 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -182,7 +182,7 @@ static bool vfio_devices_all_dirty_tracking(VFIOContain= erBase *bcontainer) VFIODevice *vbasedev; MigrationState *ms =3D migrate_get_current(); =20 - if (ms->state !=3D MIGRATION_STATUS_ACTIVE && + if (!migration_is_active() && ms->state !=3D MIGRATION_STATUS_DEVICE) { return false; } @@ -225,7 +225,7 @@ vfio_devices_all_running_and_mig_active(const VFIOConta= inerBase *bcontainer) { VFIODevice *vbasedev; =20 - if (!migration_is_active(migrate_get_current())) { + if (!migration_is_active()) { return false; } =20 diff --git a/include/migration/misc.h b/include/migration/misc.h index 79cff62..e1f1bf8 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -60,7 +60,7 @@ void dump_vmstate_json_to_file(FILE *out_fp); void migration_object_init(void); void migration_shutdown(void); bool migration_is_idle(void); -bool migration_is_active(MigrationState *); +bool migration_is_active(void); bool migration_is_setup_or_active(void); bool migrate_mode_is_cpr(MigrationState *); =20 diff --git a/migration/migration.c b/migration/migration.c index af21403..17859cb 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1406,7 +1406,7 @@ static void migrate_fd_cleanup(MigrationState *s) qemu_fclose(tmp); } =20 - assert(!migration_is_active(s)); + assert(!migration_is_active()); =20 if (s->state =3D=3D MIGRATION_STATUS_CANCELLING) { migrate_set_state(&s->state, MIGRATION_STATUS_CANCELLING, @@ -1637,8 +1637,10 @@ bool migration_is_idle(void) return false; } =20 -bool migration_is_active(MigrationState *s) +bool migration_is_active(void) { + MigrationState *s =3D current_migration; + return (s->state =3D=3D MIGRATION_STATUS_ACTIVE || s->state =3D=3D MIGRATION_STATUS_POSTCOPY_ACTIVE); } @@ -3461,7 +3463,7 @@ static void *migration_thread(void *opaque) =20 trace_migration_thread_setup_complete(); =20 - while (migration_is_active(s)) { + while (migration_is_active()) { if (urgent || !migration_rate_exceeded(s->to_dst_file)) { MigIterateState iter_state =3D migration_iteration_run(s); if (iter_state =3D=3D MIG_ITERATE_SKIP) { @@ -3607,7 +3609,7 @@ static void *bg_migration_thread(void *opaque) migration_bh_schedule(bg_migration_vm_start_bh, s); bql_unlock(); =20 - while (migration_is_active(s)) { + while (migration_is_active()) { MigIterateState iter_state =3D bg_migration_iteration_run(s); if (iter_state =3D=3D MIG_ITERATE_SKIP) { continue; diff --git a/system/dirtylimit.c b/system/dirtylimit.c index 774ff44..051e031 100644 --- a/system/dirtylimit.c +++ b/system/dirtylimit.c @@ -83,7 +83,7 @@ static void vcpu_dirty_rate_stat_collect(void) int64_t period =3D DIRTYLIMIT_CALC_TIME_MS; =20 if (migrate_dirty_limit() && - migration_is_active(s)) { + migration_is_active()) { period =3D s->parameters.x_vcpu_dirty_limit_period; } =20 --=20 1.8.3.1 From nobody Tue Nov 26 02:19:41 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=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1710179662; cv=none; d=zohomail.com; s=zohoarc; b=C+TZ0tv8BbEJAVvhiE/fbxDoU+StK/de9NRTNYRumv3ZpDdun+Z3maNrz7VZsxxo2S1FN6nTzZeH5QFKyj87hZJa8hRmiVZWXfiqJMe38SsvZWkClvt6GnHbEg5ofWjGJQDxmE32RqpMUJLryobJnLmXdJaUla8ONc39SguMHwE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710179662; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IVKZLe22DQsufeVB6WmtLdyngoZnPDBPar2qUtXJ1t0=; b=ginCuo6e7alt6//uWLmTffyLZYbU62sZEC6pdnk5Db1CADpK51TDZCi/jvfEuEBJz4LcBmVhlwsx1VYJ0Kp93FX23CFChqM+l291NtoCULknCTF6xx1FJ1cdnUpce86q0yj7NN78myFB1O1M/4zFph1dZxANCcL5/AgqgbhAQbE= 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 1710179662183891.2826385061089; Mon, 11 Mar 2024 10:54:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjjm4-0001zU-1e; Mon, 11 Mar 2024 13:49:20 -0400 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 1rjjm1-0001yw-MF for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:17 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjjly-0008Ux-U1 for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:16 -0400 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42BG40VH008055; Mon, 11 Mar 2024 17:49:09 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wrftdc22x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:09 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 42BHcAAA028515; Mon, 11 Mar 2024 17:49:08 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wre76335h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:08 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 42BHlHcm020033; Mon, 11 Mar 2024 17:49:07 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wre763302-5; Mon, 11 Mar 2024 17:49:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=IVKZLe22DQsufeVB6WmtLdyngoZnPDBPar2qUtXJ1t0=; b=kQPzX53cls/VsFNd40+K3UcRaee+PjWnHcY90Hk0cWUhg/0q0xyRJv16LFO1JLZWxyUy LMGIsyXRoU2pV9JmrrlJc7zSW9vYupsitOVE8quktbbcz3Z9/6SxcWBQ7puTvao6VfHL IS9nmlIIEs6N794yxJODsWIgA4TZW2jzXzQ2vKK9/Eme31XklsHBqQT+Dfyl4r7qvaMN gP3jaGqyZm0P2TWVpjaminCK14VLx58iVt4QJNHT49k8dWl7I4UrN/UZmyJyCziLZ7V5 DNZ15zMVhF1k4l7+/DZcSlSzOHl5NXVDVYMHP1WkCIQwn9tETnk91/WddTmKPYrE4lRe Vg== From: Steve Sistare To: qemu-devel@nongnu.org Cc: Alex Williamson , Cedric Le Goater , "Michael S. Tsirkin" , David Hildenbrand , Peter Xu , Fabiano Rosas , Hailiang Zhang , Zhang Chen , Li Zhijian , Jason Wang , Hyman Huang , Song Gao , Alistair Francis , Steve Sistare Subject: [PATCH V2 04/11] migration: export migration_is_running Date: Mon, 11 Mar 2024 10:48:51 -0700 Message-Id: <1710179338-294359-5-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> References: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-11_10,2024-03-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403110136 X-Proofpoint-ORIG-GUID: HoiCUWpiS3xV9YqQM1q4V9FzplbRid1M X-Proofpoint-GUID: HoiCUWpiS3xV9YqQM1q4V9FzplbRid1M 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=205.220.177.32; envelope-from=steven.sistare@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, 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, 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1710179662660100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Delete the MigrationState parameter from migration_is_running and move it to the public API in misc.h. Signed-off-by: Steve Sistare --- include/migration/misc.h | 1 + migration/migration.c | 10 ++++++---- migration/migration.h | 2 -- migration/options.c | 4 ++-- migration/savevm.c | 2 +- system/dirtylimit.c | 2 +- target/riscv/kvm/kvm-cpu.c | 4 ++-- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index e1f1bf8..7526977 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -106,6 +106,7 @@ int migration_call_notifiers(MigrationState *s, Migrati= onEventType type, bool migration_in_setup(MigrationState *); bool migration_has_finished(MigrationState *); bool migration_has_failed(MigrationState *); +bool migration_is_running(void); /* ...and after the device transmission */ /* True if incoming migration entered POSTCOPY_INCOMING_DISCARD */ bool migration_in_incoming_postcopy(void); diff --git a/migration/migration.c b/migration/migration.c index 17859cb..546ba86 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1103,9 +1103,11 @@ bool migration_is_setup_or_active(void) } } =20 -bool migration_is_running(int state) +bool migration_is_running(void) { - switch (state) { + MigrationState *s =3D current_migration; + + switch (s->state) { case MIGRATION_STATUS_ACTIVE: case MIGRATION_STATUS_POSTCOPY_ACTIVE: case MIGRATION_STATUS_POSTCOPY_PAUSED: @@ -1477,7 +1479,7 @@ static void migrate_fd_cancel(MigrationState *s) =20 do { old_state =3D s->state; - if (!migration_is_running(old_state)) { + if (!migration_is_running()) { break; } /* If the migration is paused, kick it out of the pause */ @@ -1962,7 +1964,7 @@ static bool migrate_prepare(MigrationState *s, bool b= lk, bool blk_inc, return true; } =20 - if (migration_is_running(s->state)) { + if (migration_is_running()) { error_setg(errp, QERR_MIGRATION_ACTIVE); return false; } diff --git a/migration/migration.h b/migration/migration.h index 736460a..e4983db 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -479,8 +479,6 @@ bool migrate_has_error(MigrationState *s); =20 void migrate_fd_connect(MigrationState *s, Error *error_in); =20 -bool migration_is_running(int state); - int migrate_init(MigrationState *s, Error **errp); bool migration_is_blocked(Error **errp); /* True if outgoing migration has entered postcopy phase */ diff --git a/migration/options.c b/migration/options.c index 40eb930..642cfb0 100644 --- a/migration/options.c +++ b/migration/options.c @@ -681,7 +681,7 @@ bool migrate_cap_set(int cap, bool value, Error **errp) MigrationState *s =3D migrate_get_current(); bool new_caps[MIGRATION_CAPABILITY__MAX]; =20 - if (migration_is_running(s->state)) { + if (migration_is_running()) { error_setg(errp, QERR_MIGRATION_ACTIVE); return false; } @@ -725,7 +725,7 @@ void qmp_migrate_set_capabilities(MigrationCapabilitySt= atusList *params, MigrationCapabilityStatusList *cap; bool new_caps[MIGRATION_CAPABILITY__MAX]; =20 - if (migration_is_running(s->state) || migration_in_colo_state()) { + if (migration_is_running() || migration_in_colo_state()) { error_setg(errp, QERR_MIGRATION_ACTIVE); return; } diff --git a/migration/savevm.c b/migration/savevm.c index dc1fb9c..71974b6 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1705,7 +1705,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **err= p) MigrationState *ms =3D migrate_get_current(); MigrationStatus status; =20 - if (migration_is_running(ms->state)) { + if (migration_is_running()) { error_setg(errp, QERR_MIGRATION_ACTIVE); return -EINVAL; } diff --git a/system/dirtylimit.c b/system/dirtylimit.c index 051e031..1622bb7 100644 --- a/system/dirtylimit.c +++ b/system/dirtylimit.c @@ -451,7 +451,7 @@ static bool dirtylimit_is_allowed(void) { MigrationState *ms =3D migrate_get_current(); =20 - if (migration_is_running(ms->state) && + if (migration_is_running() && (!qemu_thread_is_self(&ms->thread)) && migrate_dirty_limit() && dirtylimit_in_service()) { diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index 422e4f1..cf046db 100644 --- a/target/riscv/kvm/kvm-cpu.c +++ b/target/riscv/kvm/kvm-cpu.c @@ -44,7 +44,7 @@ #include "kvm_riscv.h" #include "sbi_ecall_interface.h" #include "chardev/char-fe.h" -#include "migration/migration.h" +#include "migration/misc.h" #include "sysemu/runstate.h" #include "hw/riscv/numa.h" =20 @@ -700,7 +700,7 @@ static void kvm_riscv_put_regs_timer(CPUState *cs) * frequency. Therefore, we should check whether they are the same here * during the migration. */ - if (migration_is_running(migrate_get_current()->state)) { + if (migration_is_running()) { KVM_RISCV_GET_TIMER(cs, frequency, reg); if (reg !=3D env->kvm_timer_frequency) { error_report("Dst Hosts timer frequency !=3D Src Hosts"); --=20 1.8.3.1 From nobody Tue Nov 26 02:19:41 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=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1710179662; cv=none; d=zohomail.com; s=zohoarc; b=AnxNfx3f6FDWbmw5jH4JmXdtygmYzguUu3APzwnhCKrDHr/FQywA5xtaVGWN+5K6U1u4+8nW9iFjbn05SFy2cvvDwLNK4xIDdhtiGbi7lvAh5lb2ljA22XdQZdXFTI9paHCj896cNJIp8aMEMz/Mzd/dLvIjVti+88n8nm6iw+A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710179662; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kPPyuXR3TbfdMvzDMiVFYZPVWKrI1P7MQXcb2jd/PGA=; b=j5FsuZzquXYaHXweGvfaQyvS54BE63NDTjYXdQz81HX/eXZRGMCiK1vBnd6iFvKhTd6vkWvjqDXThlqMwU/F2uiVZn1tx+EYXIem+jnqDFdj7rMbOA+zkO0fR0ZXGenkRpQD4ideL02c8jYRQYR162aB9RrzBI460OfHBZemUK8= 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 1710179662605943.9518820237729; Mon, 11 Mar 2024 10:54:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjjm4-0001zy-Gx; Mon, 11 Mar 2024 13:49:20 -0400 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 1rjjm3-0001z6-1A for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:19 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjjm0-0008VJ-Nc for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:18 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42BG46gw011922; Mon, 11 Mar 2024 17:49:11 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wre6ec108-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:10 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 42BHhxF0028547; Mon, 11 Mar 2024 17:49:10 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wre76336g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:10 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 42BHlHco020033; Mon, 11 Mar 2024 17:49:09 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wre763302-6; Mon, 11 Mar 2024 17:49:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=kPPyuXR3TbfdMvzDMiVFYZPVWKrI1P7MQXcb2jd/PGA=; b=h83aJwBKCWg+z2/t5GR79gJhVB6BmnUzpfFsAy6J6fxwRKb3rxaqaqU4AS7cHk0AOqSu 3Nw52L8Y01MONK5DxkStj0FqdsyuwpBPtEsh3gRPbycSvtbsNEgO9hPCaoSFlAEFQCy4 B7rmGG49CT3YVS4bXr4W04qrqjlHtU2Yt9X/gu52PkfDptJRlIrFwp+XiNB4QFTQVf5y 8P1chAp42eUDfxZhwoXZkYsJFCRK8d3y1ehmkpYMVvDQed5W9PEhoVKFCoOLQXocNmoV 2EC/DgcIGcNCtqE9NipNznJ8LXkHI4kEWQG3PDkv3ob7Zryd+5LIvIMwqkqy42L1M9wB yg== From: Steve Sistare To: qemu-devel@nongnu.org Cc: Alex Williamson , Cedric Le Goater , "Michael S. Tsirkin" , David Hildenbrand , Peter Xu , Fabiano Rosas , Hailiang Zhang , Zhang Chen , Li Zhijian , Jason Wang , Hyman Huang , Song Gao , Alistair Francis , Steve Sistare Subject: [PATCH V2 05/11] migration: export vcpu_dirty_limit_period Date: Mon, 11 Mar 2024 10:48:52 -0700 Message-Id: <1710179338-294359-6-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> References: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-11_10,2024-03-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403110136 X-Proofpoint-GUID: ovxtNXj30D8fbF3Pgmcz7GCtug6p1XtE X-Proofpoint-ORIG-GUID: ovxtNXj30D8fbF3Pgmcz7GCtug6p1XtE 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=205.220.177.32; envelope-from=steven.sistare@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, 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, 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1710179664620100007 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Define and export vcpu_dirty_limit_period to eliminate a dependency on MigrationState. Signed-off-by: Steve Sistare --- include/migration/client-options.h | 1 + migration/options.c | 7 +++++++ system/dirtylimit.c | 3 +-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/migration/client-options.h b/include/migration/client-= options.h index 887fea1..59f4b55 100644 --- a/include/migration/client-options.h +++ b/include/migration/client-options.h @@ -20,5 +20,6 @@ bool migrate_switchover_ack(void); /* parameters */ =20 MigMode migrate_mode(void); +uint64_t migrate_vcpu_dirty_limit_period(void); =20 #endif diff --git a/migration/options.c b/migration/options.c index 642cfb0..09178c6 100644 --- a/migration/options.c +++ b/migration/options.c @@ -924,6 +924,13 @@ const char *migrate_tls_hostname(void) return s->parameters.tls_hostname; } =20 +uint64_t migrate_vcpu_dirty_limit_period(void) +{ + MigrationState *s =3D migrate_get_current(); + + return s->parameters.x_vcpu_dirty_limit_period; +} + uint64_t migrate_xbzrle_cache_size(void) { MigrationState *s =3D migrate_get_current(); diff --git a/system/dirtylimit.c b/system/dirtylimit.c index 1622bb7..b0afaa0 100644 --- a/system/dirtylimit.c +++ b/system/dirtylimit.c @@ -77,14 +77,13 @@ static bool dirtylimit_quit; =20 static void vcpu_dirty_rate_stat_collect(void) { - MigrationState *s =3D migrate_get_current(); VcpuStat stat; int i =3D 0; int64_t period =3D DIRTYLIMIT_CALC_TIME_MS; =20 if (migrate_dirty_limit() && migration_is_active()) { - period =3D s->parameters.x_vcpu_dirty_limit_period; + period =3D migrate_vcpu_dirty_limit_period(); } =20 /* calculate vcpu dirtyrate */ --=20 1.8.3.1 From nobody Tue Nov 26 02:19:41 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=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1710179580; cv=none; d=zohomail.com; s=zohoarc; b=XH/TVne1IgXVfI5m0X19ob+GfSYSShTvdq/1/1HMu3HUauv1PESUsCgZazdDewe50ydsYUQv1++6Fm5J/48UHwv49VsqvsFydS6c7AmDl0VB12QbhuLw2kgIKLe9cA7E5MOAJiURp0RwqtaTAWxdTOZXEGwCvkB9uLeR8Q6+eWc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710179580; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zkKxsXar5+UvJQxlj+egXI79LphE/bIcj+yssMuzZok=; b=liAt65TKXtdTOApxjcxtHeYi9hD+lEs5kOzMSzGXVp1BvY40c9JrPnzIvJzD/KieEBFpxEkhib8ccNp4Pk6qKxatEeuZAxMw0rrEeEsdbKUxG2TxN96RhoNj7TBFHFvKznBHcSNr3f1t33+YZQvP599LEy8YdouHgA3aMR+5VUU= 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 1710179580812452.9203972068875; Mon, 11 Mar 2024 10:53:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjjm6-00020O-78; Mon, 11 Mar 2024 13:49:22 -0400 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 1rjjm4-0001zc-94 for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:20 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjjm2-0008Vo-Jx for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:20 -0400 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42BG40Ao008065; Mon, 11 Mar 2024 17:49:12 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wrftdc234-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:12 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 42BHVj70028519; Mon, 11 Mar 2024 17:49:11 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wre76337j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:11 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 42BHlHcq020033; Mon, 11 Mar 2024 17:49:11 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wre763302-7; Mon, 11 Mar 2024 17:49:11 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=zkKxsXar5+UvJQxlj+egXI79LphE/bIcj+yssMuzZok=; b=YLCbgwXCVX/Yo/R0yNk4hn0/K+kuLTiGHPKgHSmbNBRJA0+Yae6IvF0vKjXi7y65w4I7 AnMbnHOZyTk4SaV8Mz+efw5oTZqH1WsD81sLB4cxSPJcP7uYA8Rkj/2bomSu8V0tSfUF GdmJC7Ys8R/eItZNp2jJFuAyZKrlh94XrwdGTRzkpHPe/VA8Ye81HsUOBCfqjfwWYHTf Hkw3oNQi5Bi7l1FcLd/6RilbOT42byVtwFeaDUnEsVzkwc7+ISab5Ji/Prz0JlwzOFCi 5pgLydLZf1EBFJUVF/0x8Oyfr+ChxWsNJiMnZ49hflw5BpXEDw+XHaLALUeMdcEXv9XB XA== From: Steve Sistare To: qemu-devel@nongnu.org Cc: Alex Williamson , Cedric Le Goater , "Michael S. Tsirkin" , David Hildenbrand , Peter Xu , Fabiano Rosas , Hailiang Zhang , Zhang Chen , Li Zhijian , Jason Wang , Hyman Huang , Song Gao , Alistair Francis , Steve Sistare Subject: [PATCH V2 06/11] migration: migration_thread_is_self Date: Mon, 11 Mar 2024 10:48:53 -0700 Message-Id: <1710179338-294359-7-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> References: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-11_10,2024-03-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403110136 X-Proofpoint-ORIG-GUID: Bbtgc4ejMVfV18yiwEUswp4hp5d7FyXU X-Proofpoint-GUID: Bbtgc4ejMVfV18yiwEUswp4hp5d7FyXU 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=205.220.177.32; envelope-from=steven.sistare@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, 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, 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1710179582356100006 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Define and export migration_thread_is_self to eliminate a dependency on MigrationState. Signed-off-by: Steve Sistare --- include/migration/misc.h | 1 + migration/migration.c | 7 +++++++ system/dirtylimit.c | 5 +---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index 7526977..c4b5416 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -61,6 +61,7 @@ void migration_object_init(void); void migration_shutdown(void); bool migration_is_idle(void); bool migration_is_active(void); +bool migration_thread_is_self(void); bool migration_is_setup_or_active(void); bool migrate_mode_is_cpr(MigrationState *); =20 diff --git a/migration/migration.c b/migration/migration.c index 546ba86..afe72af 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1647,6 +1647,13 @@ bool migration_is_active(void) s->state =3D=3D MIGRATION_STATUS_POSTCOPY_ACTIVE); } =20 +bool migration_thread_is_self(void) +{ + MigrationState *s =3D current_migration; + + return qemu_thread_is_self(&s->thread); +} + bool migrate_mode_is_cpr(MigrationState *s) { return s->parameters.mode =3D=3D MIG_MODE_CPR_REBOOT; diff --git a/system/dirtylimit.c b/system/dirtylimit.c index b0afaa0..ab20da3 100644 --- a/system/dirtylimit.c +++ b/system/dirtylimit.c @@ -25,7 +25,6 @@ #include "sysemu/kvm.h" #include "trace.h" #include "migration/misc.h" -#include "migration/migration.h" =20 /* * Dirtylimit stop working if dirty page rate error @@ -448,10 +447,8 @@ static void dirtylimit_cleanup(void) */ static bool dirtylimit_is_allowed(void) { - MigrationState *ms =3D migrate_get_current(); - if (migration_is_running() && - (!qemu_thread_is_self(&ms->thread)) && + !migration_thread_is_self() && migrate_dirty_limit() && dirtylimit_in_service()) { return false; --=20 1.8.3.1 From nobody Tue Nov 26 02:19:41 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=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1710179402; cv=none; d=zohomail.com; s=zohoarc; b=FmTK0WYbN1Pm+7VDMoiR6lkFAnEMtpnv96zsS3eS50wvolUf5rpMySgvGzvQaxnqZ1Qz08E9+ZNGUK8HdD3vNr1yQXEIDFJ7qz7od/xKegvWSJymrr9zGljWHAjXxOZQ+jpel1Bow6GSAE17FBU1uWM/MH5/ZInPDT7y3PUdB2I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710179402; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RHRxpHlsXEWnYO63GLr863Gs5AzWehL5+ShkwOEx400=; b=Jyo9jQa5xeRXGHx9dzkamlWGzXg/R5F13v9SlQluXYO5pokaEKKFOJanbA0bU/joj8m5dK9DTInq28BCSzK3S9YSkK9CyHhKAoOoM+HWIazD5RsdEKEgIxjs+qTMFbXRGZdCqEcNgsmZe/yDXLRnaoNkYC0nuf892eRG8rN5nls= 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 1710179402906900.176401384564; Mon, 11 Mar 2024 10:50:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjjmB-00024T-OP; Mon, 11 Mar 2024 13:49:29 -0400 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 1rjjm7-00020x-PZ for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:23 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjjm6-0008WH-9C for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:23 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42BG3q6W020998; Mon, 11 Mar 2024 17:49:14 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wrfcuc10j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:14 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 42BHTh3Z028534; Mon, 11 Mar 2024 17:49:14 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wre76339a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:13 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 42BHlHcs020033; Mon, 11 Mar 2024 17:49:13 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wre763302-8; Mon, 11 Mar 2024 17:49:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=RHRxpHlsXEWnYO63GLr863Gs5AzWehL5+ShkwOEx400=; b=UYJZ+a5zJY4VA1K6PfwVWRrphCRH3Ho5SoDP0xP8GZmt3jI7/VFM7fxqE8p1snxwLu5e 2zqM5zmuLjiovb0y5qDXxWsEKM+4VSfeZoNrwOG17q3aXunjwnM12ZtpIeV8VfHWt4F4 t4Ooe732afvXLGQGw8tUKm/5drG27V4TgEUns9wNkEiDHhBVG9NPSHfUnnGQNd1qkeeO JeHoJNC6QJ4eSf/Und5gROaaNT6OEBxhXenrlnvF6A4vyTEs4Wr6opG9DD4qFGU2NI2h 55cWsMVvK0uPMFinG9VhaEkOANYWDIH6BQUmm4QSzQtIm4YajFkyPYc6oKctBrRY+V2v dg== From: Steve Sistare To: qemu-devel@nongnu.org Cc: Alex Williamson , Cedric Le Goater , "Michael S. Tsirkin" , David Hildenbrand , Peter Xu , Fabiano Rosas , Hailiang Zhang , Zhang Chen , Li Zhijian , Jason Wang , Hyman Huang , Song Gao , Alistair Francis , Steve Sistare Subject: [PATCH V2 07/11] migration: migration_is_device Date: Mon, 11 Mar 2024 10:48:54 -0700 Message-Id: <1710179338-294359-8-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> References: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-11_10,2024-03-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403110136 X-Proofpoint-ORIG-GUID: b11IbecLZZszaLtqHmFgE7b6bNqoLW50 X-Proofpoint-GUID: b11IbecLZZszaLtqHmFgE7b6bNqoLW50 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=205.220.177.32; envelope-from=steven.sistare@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, 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, 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1710179403863100003 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Define and export migration_is_device to eliminate a dependency on MigrationState. Signed-off-by: Steve Sistare --- hw/vfio/common.c | 4 +--- include/migration/misc.h | 1 + migration/migration.c | 7 +++++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 2dbbf62..de01068 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -180,10 +180,8 @@ bool vfio_device_state_is_precopy(VFIODevice *vbasedev) static bool vfio_devices_all_dirty_tracking(VFIOContainerBase *bcontainer) { VFIODevice *vbasedev; - MigrationState *ms =3D migrate_get_current(); =20 - if (!migration_is_active() && - ms->state !=3D MIGRATION_STATUS_DEVICE) { + if (!migration_is_active() && !migration_is_device()) { return false; } =20 diff --git a/include/migration/misc.h b/include/migration/misc.h index c4b5416..28cfaed 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -61,6 +61,7 @@ void migration_object_init(void); void migration_shutdown(void); bool migration_is_idle(void); bool migration_is_active(void); +bool migration_is_device(void); bool migration_thread_is_self(void); bool migration_is_setup_or_active(void); bool migrate_mode_is_cpr(MigrationState *); diff --git a/migration/migration.c b/migration/migration.c index afe72af..db1e627 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1647,6 +1647,13 @@ bool migration_is_active(void) s->state =3D=3D MIGRATION_STATUS_POSTCOPY_ACTIVE); } =20 +bool migration_is_device(void) +{ + MigrationState *s =3D current_migration; + + return s->state =3D=3D MIGRATION_STATUS_DEVICE; +} + bool migration_thread_is_self(void) { MigrationState *s =3D current_migration; --=20 1.8.3.1 From nobody Tue Nov 26 02:19:41 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=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1710179458; cv=none; d=zohomail.com; s=zohoarc; b=Sv/EKjEbzi2os8+AgkmIxcZzakXp3E9+2g9E8p2taWeRyBztpplkSe2je3TNJRPhohOyKhj443nUB0lai0jpNP62quNZ/UwmPmvcsIkcdsus46o4Wgv6AvAj1CLpNrfh2xgzg/2mVQiLxUhzPDbfD6P6DjpSwdgepTNFywsTbLE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710179458; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CuhO/cQkNxrFoaRQrZcF9qAKyADhyJaFMiQAufOkxlk=; b=QWa0mfQhlLbkXJhe+zG2XZaMoMRxedCT03VhIJFG3/DBXrN/PrA11sQJ0JYbuFJZPG+XEV4qrAkLtVfODT29Uw2xbtjwl9KDJ2X0a5kjP6w0ginlqH7CpULcbcTGjeJ5TSs86IBX4dcPit8Phbd9s0bKFJP9qpYKyla7TBrB+qE= 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 1710179458571822.3510747930168; Mon, 11 Mar 2024 10:50:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjjmb-0002PQ-Tj; Mon, 11 Mar 2024 13:49:54 -0400 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 1rjjm9-000249-DN for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:26 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjjm7-0008WP-2h for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:24 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42BG3r5r021055; Mon, 11 Mar 2024 17:49:17 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wrfcuc10r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:16 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 42BHNlvm028520; Mon, 11 Mar 2024 17:49:16 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wre7633af-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:15 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 42BHlHcu020033; Mon, 11 Mar 2024 17:49:15 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wre763302-9; Mon, 11 Mar 2024 17:49:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=CuhO/cQkNxrFoaRQrZcF9qAKyADhyJaFMiQAufOkxlk=; b=HWUYbgalM+oUaMWOy/5HwbyAR/NVkQlMu2YDowSiB6RMmLSNZsUi4x2nZgwB+8AmXs0P uTKy1Q5JnTqMR4tV8m8ZCyDRnNf5NgAwJB3CqY9RBr8bCtmdTQyJnweoC8ahXH94UEUj qpayMu371lJ0keCs/VOi9wWyza2n4jNgXcl8sGYEKUZ+9FwL5oPXqZiUjiyN7Z4fqCEt H9/tYdjofqcsBdeWBM2zCaRPMvfUXQcoyKGKpChTxbnz+Cq3w6U+n0vJmK/08Pv9xsBO wwwXV6E68K2u1vuW7h+3DZYZDStIL8hpAUnetlVNapgxqH7SQfYatC8nC4sW67HKU0G7 iA== From: Steve Sistare To: qemu-devel@nongnu.org Cc: Alex Williamson , Cedric Le Goater , "Michael S. Tsirkin" , David Hildenbrand , Peter Xu , Fabiano Rosas , Hailiang Zhang , Zhang Chen , Li Zhijian , Jason Wang , Hyman Huang , Song Gao , Alistair Francis , Steve Sistare Subject: [PATCH V2 08/11] migration: migration_file_set_error Date: Mon, 11 Mar 2024 10:48:55 -0700 Message-Id: <1710179338-294359-9-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> References: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-11_10,2024-03-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403110136 X-Proofpoint-ORIG-GUID: yFvKnZxwAW5ZcnkGPnygLfPQGMKLhloe X-Proofpoint-GUID: yFvKnZxwAW5ZcnkGPnygLfPQGMKLhloe 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=205.220.177.32; envelope-from=steven.sistare@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, 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, 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1710179460038100003 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Define and export migration_file_set_error to eliminate a dependency on MigrationState. Signed-off-by: Steve Sistare --- hw/vfio/common.c | 9 +-------- hw/vfio/migration.c | 11 +++-------- include/migration/misc.h | 2 ++ migration/migration.c | 11 +++++++++++ 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index de01068..b44204e 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -39,7 +39,6 @@ #include "sysemu/runstate.h" #include "trace.h" #include "qapi/error.h" -#include "migration/migration.h" #include "migration/misc.h" #include "migration/blocker.h" #include "migration/qemu-file.h" @@ -150,14 +149,8 @@ bool vfio_viommu_preset(VFIODevice *vbasedev) =20 static void vfio_set_migration_error(int err) { - MigrationState *ms =3D migrate_get_current(); - if (migration_is_setup_or_active()) { - WITH_QEMU_LOCK_GUARD(&ms->qemu_file_lock) { - if (ms->to_dst_file) { - qemu_file_set_error(ms->to_dst_file, err); - } - } + migration_file_set_error(err); } } =20 diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 5d4a23c..c5cb61d 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -17,13 +17,12 @@ =20 #include "sysemu/runstate.h" #include "hw/vfio/vfio-common.h" -#include "migration/migration.h" +#include "migration/misc.h" #include "migration/savevm.h" #include "migration/vmstate.h" #include "migration/qemu-file.h" #include "migration/register.h" #include "migration/blocker.h" -#include "migration/misc.h" #include "qapi/error.h" #include "exec/ramlist.h" #include "exec/ram_addr.h" @@ -712,9 +711,7 @@ static void vfio_vmstate_change_prepare(void *opaque, b= ool running, * Migration should be aborted in this case, but vm_state_notify() * currently does not support reporting failures. */ - if (migrate_get_current()->to_dst_file) { - qemu_file_set_error(migrate_get_current()->to_dst_file, ret); - } + migration_file_set_error(ret); } =20 trace_vfio_vmstate_change_prepare(vbasedev->name, running, @@ -744,9 +741,7 @@ static void vfio_vmstate_change(void *opaque, bool runn= ing, RunState state) * Migration should be aborted in this case, but vm_state_notify() * currently does not support reporting failures. */ - if (migrate_get_current()->to_dst_file) { - qemu_file_set_error(migrate_get_current()->to_dst_file, ret); - } + migration_file_set_error(ret); } =20 trace_vfio_vmstate_change(vbasedev->name, running, RunState_str(state), diff --git a/include/migration/misc.h b/include/migration/misc.h index 28cfaed..e521cd5 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -109,6 +109,8 @@ bool migration_in_setup(MigrationState *); bool migration_has_finished(MigrationState *); bool migration_has_failed(MigrationState *); bool migration_is_running(void); +void migration_file_set_error(int err); + /* ...and after the device transmission */ /* True if incoming migration entered POSTCOPY_INCOMING_DISCARD */ bool migration_in_incoming_postcopy(void); diff --git a/migration/migration.c b/migration/migration.c index db1e627..216f63d 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3038,6 +3038,17 @@ static MigThrError postcopy_pause(MigrationState *s) } } =20 +void migration_file_set_error(int err) +{ + MigrationState *s =3D current_migration; + + WITH_QEMU_LOCK_GUARD(&s->qemu_file_lock) { + if (s->to_dst_file) { + qemu_file_set_error(s->to_dst_file, err); + } + } +} + static MigThrError migration_detect_error(MigrationState *s) { int ret; --=20 1.8.3.1 From nobody Tue Nov 26 02:19:41 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=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1710179468; cv=none; d=zohomail.com; s=zohoarc; b=gAu3kLNPovTnKvzaZYpQjp+kjLC6IOIQUhIXriauiBVTxRPc8Y7U/4yyMEkf1gHr8lysgbMKf4GDo8ZBtk4SA9x5kdEXRbswXgPtML72VKbggPfwbH7FqUPy0YuaI9YG2TK+MuIv5A7BadZRZATdlGkeCY6by5NEUi/kj3bGfFs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710179468; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8oG64oy8rob4doeu1Jctk8IZLA0fas24YY+2pZ6MU/Q=; b=ToxmHBecCq/EBhAejYGMp1IB7cBTB8QXeASUnNBW0uI38R74A9Bg+Ch+hJeeu3lGm0eKyu6+6/01adXVmYFQcwIEGA9t3Djciom+7NRRoPTSdxu1ZLB5RlCGvDNVWYPPFiC46aeBIdWCMmyIfJsT3KABmc83euOLXoS3BDm4Qvg= 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 1710179468721117.53258150544798; Mon, 11 Mar 2024 10:51:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjjmb-0002M5-P0; Mon, 11 Mar 2024 13:49:53 -0400 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 1rjjmC-00027t-B7 for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:31 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjjm8-00004z-SY for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:26 -0400 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42BG40h5008069; Mon, 11 Mar 2024 17:49:18 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wrftdc23c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:18 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 42BHkjb8028544; Mon, 11 Mar 2024 17:49:17 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wre7633c0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:17 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 42BHlHcw020033; Mon, 11 Mar 2024 17:49:17 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wre763302-10; Mon, 11 Mar 2024 17:49:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=8oG64oy8rob4doeu1Jctk8IZLA0fas24YY+2pZ6MU/Q=; b=bLZLRH0FW2jixS8d2KlmZBuW//74PC4naGGDG5L3QpfzKdV/6d4bBAbFINBSPWP8pt8z F3Gcj+69oVyZoQtawZWWdtxeqV2PnSLoaCQ/jnbICQpBNB7cnEhxU/WG4KpeRQsB2KQ6 cwyiXdEVkpUXQq9E4oG6x9KC9fw0QMDTh0MjHSqv5isksq+VUFCPUc2rhEQk4QXylb3n yR+zGThFMfYj9ptDK8vHUQNLl+qIedkCLrzjUFVLwVGBK95AkZKHR7ZYiuv0rAJ7/kEG QUDnYxSuv/1scmlxdgZkh5UJwAVyUJ4o4AgJckR+CM521siIuA/TQAztea3gRj0+SZiB vg== From: Steve Sistare To: qemu-devel@nongnu.org Cc: Alex Williamson , Cedric Le Goater , "Michael S. Tsirkin" , David Hildenbrand , Peter Xu , Fabiano Rosas , Hailiang Zhang , Zhang Chen , Li Zhijian , Jason Wang , Hyman Huang , Song Gao , Alistair Francis , Steve Sistare Subject: [PATCH V2 09/11] migration: privatize colo interfaces Date: Mon, 11 Mar 2024 10:48:56 -0700 Message-Id: <1710179338-294359-10-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> References: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-11_10,2024-03-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403110136 X-Proofpoint-ORIG-GUID: BnpMYTt_lkeVcdCB-Oe9F6fGBYj40-3u X-Proofpoint-GUID: BnpMYTt_lkeVcdCB-Oe9F6fGBYj40-3u 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=205.220.177.32; envelope-from=steven.sistare@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, 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, 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1710179470051100003 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Remove private migration interfaces from net/colo-compare.c and push them to migration/colo.c. Signed-off-by: Steve Sistare Reviewed-by: Zhang Chen --- migration/colo.c | 17 +++++++++++------ net/colo-compare.c | 3 +-- stubs/colo.c | 1 - 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index 315e31f..84632a6 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -63,9 +63,9 @@ static bool colo_runstate_is_stopped(void) return runstate_check(RUN_STATE_COLO) || !runstate_is_running(); } =20 -static void colo_checkpoint_notify(void *opaque) +static void colo_checkpoint_notify(void) { - MigrationState *s =3D opaque; + MigrationState *s =3D migrate_get_current(); int64_t next_notify_time; =20 qemu_event_set(&s->colo_checkpoint_event); @@ -74,10 +74,15 @@ static void colo_checkpoint_notify(void *opaque) timer_mod(s->colo_delay_timer, next_notify_time); } =20 +static void colo_checkpoint_notify_timer(void *opaque) +{ + colo_checkpoint_notify(); +} + void colo_checkpoint_delay_set(void) { if (migration_in_colo_state()) { - colo_checkpoint_notify(migrate_get_current()); + colo_checkpoint_notify(); } } =20 @@ -162,7 +167,7 @@ static void primary_vm_do_failover(void) * kick COLO thread which might wait at * qemu_sem_wait(&s->colo_checkpoint_sem). */ - colo_checkpoint_notify(s); + colo_checkpoint_notify(); =20 /* * Wake up COLO thread which may blocked in recv() or send(), @@ -518,7 +523,7 @@ out: =20 static void colo_compare_notify_checkpoint(Notifier *notifier, void *data) { - colo_checkpoint_notify(data); + colo_checkpoint_notify(); } =20 static void colo_process_checkpoint(MigrationState *s) @@ -642,7 +647,7 @@ void migrate_start_colo_process(MigrationState *s) bql_unlock(); qemu_event_init(&s->colo_checkpoint_event, false); s->colo_delay_timer =3D timer_new_ms(QEMU_CLOCK_HOST, - colo_checkpoint_notify, s); + colo_checkpoint_notify_timer, NULL); =20 qemu_sem_init(&s->colo_exit_sem, 0); colo_process_checkpoint(s); diff --git a/net/colo-compare.c b/net/colo-compare.c index f2dfc0e..c4ad0ab 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -28,7 +28,6 @@ #include "sysemu/iothread.h" #include "net/colo-compare.h" #include "migration/colo.h" -#include "migration/migration.h" #include "util.h" =20 #include "block/aio-wait.h" @@ -189,7 +188,7 @@ static void colo_compare_inconsistency_notify(CompareSt= ate *s) notify_remote_frame(s); } else { notifier_list_notify(&colo_compare_notifiers, - migrate_get_current()); + NULL); } } =20 diff --git a/stubs/colo.c b/stubs/colo.c index 08c9f98..f8c069b 100644 --- a/stubs/colo.c +++ b/stubs/colo.c @@ -2,7 +2,6 @@ #include "qemu/notify.h" #include "net/colo-compare.h" #include "migration/colo.h" -#include "migration/migration.h" #include "qemu/error-report.h" #include "qapi/qapi-commands-migration.h" =20 --=20 1.8.3.1 From nobody Tue Nov 26 02:19:41 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=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1710179581; cv=none; d=zohomail.com; s=zohoarc; b=UlHVtbQsEzOiBgbar+DjVJTUiXfPUh+rQkxftyKei/LMPcTROqoLJWDRfFQokJVS2o53g0SMEU4VgtiUS+8DjN0yyA9qdynSfQYCDJaPk0RYHQCukSSNrUVLQ63qyitNfGO3gdH1wqd1nU7QtvjZmLHiS7XlyNPfYo30s82BPFs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710179581; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hkEdyUqSdB8rpb7XxTNHOytblilTTXqGA/WqTyaiucs=; b=NoIieDKYaA/UGb0/8bSBfrrv7mejHXRFau1rWB6mPZMMv7WD+IDa1mXp7lYAhOMuTq6h33q9Q61nQebJ4TzYudrUEnJcLPZ7s+OtzOph3W1/xvL0lvG3QM32O3aCqkNqh7BFtb1j5MSyduNyXxp92+XPXstk2IVcnpfIDIV0zf8= 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 1710179581580980.5153292784119; Mon, 11 Mar 2024 10:53:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjjmh-0002Px-Ln; Mon, 11 Mar 2024 13:50:04 -0400 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 1rjjmE-0002AL-08 for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:34 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjjmB-00005A-0C for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:28 -0400 Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42BG430Y008556; Mon, 11 Mar 2024 17:49:20 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wrftdc23g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:20 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 42BHOxWI028605; Mon, 11 Mar 2024 17:49:19 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wre7633cv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:19 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 42BHlHd0020033; Mon, 11 Mar 2024 17:49:18 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wre763302-11; Mon, 11 Mar 2024 17:49:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=hkEdyUqSdB8rpb7XxTNHOytblilTTXqGA/WqTyaiucs=; b=flLY8RHkXBraREZW+PzwRXFtsJIZqvkCW2X8067vRK7hODN4Npirzu3RupNHiNBajUGM 16K2cDt5lnlWBC9YqMTZQTgyN2S0xic8ufhzd1x5sE+ausoNGRQDgkl8VgUtmtSfNXiw hKa3poJNsIMwVZq8N12AHoLMabRVAyBNd3kXZoK9US0HmSS0xLv2l8ESwGtrfVxrfJLV fwpP8g1ijR93qEYgv+4xLOvGxmNmpWlN04VrBJVgzLk4wCprgj+bzAIQdH93p+3Mutia GYjFy9anjJP0xT80Vrh16SE8gV22pzwFh/INdZ8cxTJWEJs9IEn4VIIE1ksERNSWjErs BQ== From: Steve Sistare To: qemu-devel@nongnu.org Cc: Alex Williamson , Cedric Le Goater , "Michael S. Tsirkin" , David Hildenbrand , Peter Xu , Fabiano Rosas , Hailiang Zhang , Zhang Chen , Li Zhijian , Jason Wang , Hyman Huang , Song Gao , Alistair Francis , Steve Sistare Subject: [PATCH V2 10/11] migration: delete unused accessors Date: Mon, 11 Mar 2024 10:48:57 -0700 Message-Id: <1710179338-294359-11-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> References: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-11_10,2024-03-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403110136 X-Proofpoint-ORIG-GUID: xsFhJV21EzkrGqp6pdlw3GAd3wDxDxti X-Proofpoint-GUID: xsFhJV21EzkrGqp6pdlw3GAd3wDxDxti 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=205.220.177.32; envelope-from=steven.sistare@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, 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, 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1710179582354100005 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Steve Sistare --- include/migration/misc.h | 3 --- migration/migration.c | 10 ---------- 2 files changed, 13 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index e521cd5..d563d2c 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -105,13 +105,10 @@ void migration_add_notifier_mode(NotifierWithReturn *= notify, void migration_remove_notifier(NotifierWithReturn *notify); int migration_call_notifiers(MigrationState *s, MigrationEventType type, Error **errp); -bool migration_in_setup(MigrationState *); -bool migration_has_finished(MigrationState *); bool migration_has_failed(MigrationState *); bool migration_is_running(void); void migration_file_set_error(int err); =20 -/* ...and after the device transmission */ /* True if incoming migration entered POSTCOPY_INCOMING_DISCARD */ bool migration_in_incoming_postcopy(void); /* True if incoming migration entered POSTCOPY_INCOMING_ADVISE */ diff --git a/migration/migration.c b/migration/migration.c index 216f63d..644e073 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1548,16 +1548,6 @@ int migration_call_notifiers(MigrationState *s, Migr= ationEventType type, return ret; } =20 -bool migration_in_setup(MigrationState *s) -{ - return s->state =3D=3D MIGRATION_STATUS_SETUP; -} - -bool migration_has_finished(MigrationState *s) -{ - return s->state =3D=3D MIGRATION_STATUS_COMPLETED; -} - bool migration_has_failed(MigrationState *s) { return (s->state =3D=3D MIGRATION_STATUS_CANCELLED || --=20 1.8.3.1 From nobody Tue Nov 26 02:19:41 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=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1710179581; cv=none; d=zohomail.com; s=zohoarc; b=ZF+GOtMNdMcZi9cEzxYdqbbqgIhPfsie4QCznsYUN/kXVX0FYZq7PL10X1YxY+YvojNIKTrM+iKVPwKy80xm11rnhM3MMW7aVoX7EkNK2rf8hhUFPfNFh2ykE8s3hdfWvsjetwUgRmi91ut8jaz4z8Ad+4tHrx0pPlnJC3aMxIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1710179581; h=Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=CXu+I0wD9F3wTOk6O4uWq+bLY8upTF2MH6D/Sc6o/rw=; b=VaHcTqV0i7CDovSjkAg5SlxemgqXqMBLS6QVb0KufxYgpt0rKkACMntbYhx+qvJhZfi2SOgmfkZiMxvXZIiRE/QmM6Gf/QsAQcTtT3TfAKJHwKvTU6/IyViiYzqh1smyxoO1qL9jUyXpj660lZ32g8V9fxhgWug5eUmMVnmt+c0= 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 1710179581987360.4933330498749; Mon, 11 Mar 2024 10:53:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjjnL-0002hi-1v; Mon, 11 Mar 2024 13:50:43 -0400 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 1rjjmQ-0002FS-BE for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:44 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjjmM-00005N-4U for qemu-devel@nongnu.org; Mon, 11 Mar 2024 13:49:40 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42BG3qIs020992; Mon, 11 Mar 2024 17:49:22 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wrfcuc11b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:21 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 42BHd01E028530; Mon, 11 Mar 2024 17:49:21 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wre7633e3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 11 Mar 2024 17:49:21 +0000 Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 42BHlHd2020033; Mon, 11 Mar 2024 17:49:20 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wre763302-12; Mon, 11 Mar 2024 17:49:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2023-11-20; bh=CXu+I0wD9F3wTOk6O4uWq+bLY8upTF2MH6D/Sc6o/rw=; b=kxwHv3y1w/kxP6uVm63ECOtYsS6tOX8LZot353FBYXiESrw74BIkIm9MX6oXZpqRLNTR pFPj1pXv6kz69vRzem9fY9JmqzzhyvwkRZNENg+ZHiwYthcuGOZCc/fCZtZp+HosBdDJ Ik5d8fMfCeSt7lfiDnDWV9aCsmISRgBTeNK4LNzsvJfYEqtWhkUqRl7//blFs04sAHug fCfht66a8QC6zhOfMXzFdSpJb4kTV4XLSo+D6CFPx6Wu/SmDtGYo4Zlva5lNKXN34hxP ryax/XDGnoyp5khgosN/JcuRuBCuhl87zavH3+nzJFY9PEWQsJv+8UXVAJprjQ1/IJEw eQ== From: Steve Sistare To: qemu-devel@nongnu.org Cc: Alex Williamson , Cedric Le Goater , "Michael S. Tsirkin" , David Hildenbrand , Peter Xu , Fabiano Rosas , Hailiang Zhang , Zhang Chen , Li Zhijian , Jason Wang , Hyman Huang , Song Gao , Alistair Francis , Steve Sistare Subject: [PATCH V2 11/11] migration: purge MigrationState from public interface Date: Mon, 11 Mar 2024 10:48:58 -0700 Message-Id: <1710179338-294359-12-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> References: <1710179338-294359-1-git-send-email-steven.sistare@oracle.com> X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-11_10,2024-03-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2403110136 X-Proofpoint-ORIG-GUID: 9KzciZ2JDcryCQtAKVXmEib3Ro479Esl X-Proofpoint-GUID: 9KzciZ2JDcryCQtAKVXmEib3Ro479Esl 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=205.220.177.32; envelope-from=steven.sistare@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, 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, 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-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oracle.com) X-ZM-MESSAGEID: 1710179584412100015 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Move remaining MigrationState references from the public file misc.h to the private file migration.h. Signed-off-by: Steve Sistare --- include/migration/misc.h | 6 ++---- migration/migration.h | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index d563d2c..c9e200f 100644 --- a/include/migration/misc.h +++ b/include/migration/misc.h @@ -64,7 +64,6 @@ bool migration_is_active(void); bool migration_is_device(void); bool migration_thread_is_self(void); bool migration_is_setup_or_active(void); -bool migrate_mode_is_cpr(MigrationState *); =20 typedef enum MigrationEventType { MIG_EVENT_PRECOPY_SETUP, @@ -103,16 +102,15 @@ void migration_add_notifier_mode(NotifierWithReturn *= notify, MigrationNotifyFunc func, MigMode mode); =20 void migration_remove_notifier(NotifierWithReturn *notify); -int migration_call_notifiers(MigrationState *s, MigrationEventType type, - Error **errp); -bool migration_has_failed(MigrationState *); bool migration_is_running(void); void migration_file_set_error(int err); =20 /* True if incoming migration entered POSTCOPY_INCOMING_DISCARD */ bool migration_in_incoming_postcopy(void); + /* True if incoming migration entered POSTCOPY_INCOMING_ADVISE */ bool migration_incoming_postcopy_advised(void); + /* True if background snapshot is active */ bool migration_in_bg_snapshot(void); =20 diff --git a/migration/migration.h b/migration/migration.h index e4983db..8045e39 100644 --- a/migration/migration.h +++ b/migration/migration.h @@ -26,6 +26,7 @@ #include "qom/object.h" #include "postcopy-ram.h" #include "sysemu/runstate.h" +#include "migration/misc.h" =20 struct PostcopyBlocktimeContext; =20 @@ -479,12 +480,17 @@ bool migrate_has_error(MigrationState *s); =20 void migrate_fd_connect(MigrationState *s, Error *error_in); =20 +int migration_call_notifiers(MigrationState *s, MigrationEventType type, + Error **errp); + int migrate_init(MigrationState *s, Error **errp); bool migration_is_blocked(Error **errp); /* True if outgoing migration has entered postcopy phase */ bool migration_in_postcopy(void); bool migration_postcopy_is_alive(int state); MigrationState *migrate_get_current(void); +bool migration_has_failed(MigrationState *); +bool migrate_mode_is_cpr(MigrationState *); =20 uint64_t ram_get_total_transferred_pages(void); =20 --=20 1.8.3.1