From nobody Tue Nov 26 07:41:42 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=1709055911; cv=none; d=zohomail.com; s=zohoarc; b=EHwGOIZ9OxCajol4df5Y6S2T6FJFABxBTiG/LAxyQ46DCPijKjHoFiC3oK61AFy9nYgoMUKJud3ymGjLuiVXKMhtDcdWkL+o5d5BS4DnP0DfBgFC2kmEAqTDENIXavuye759/wDi1K88n5DhGQdwdOFMN534HPW4tUzv7Y2hWl0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709055911; 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=f8AaQ2B1jsmmEARXgHUghQnG5es2OoUcPNKMVZWSiQcrRyFmZDEq/3IwvArfEJS2sRKFdS99GpurNlQ91tQj9iBFSyZ1nyGomr5zOgnvfoJ7nsqc9Zu8X6Ra/I/dBDv0nnEPQvYsXyVNhhYC2Hbv5j/D2y3yCTHBl+3FTYqN+YM= 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 1709055911548960.8394282197615; Tue, 27 Feb 2024 09:45:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rf1UX-0001dw-57; Tue, 27 Feb 2024 12:43:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rf1UV-0001dK-LP for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:43:43 -0500 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 1rf1UU-0005LY-1N for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:43:43 -0500 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 41RFY1vw004804; Tue, 27 Feb 2024 17:43:36 GMT Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf6vdyycx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:35 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41RHKbDK025545; Tue, 27 Feb 2024 17:43:34 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6we2v49-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:34 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41RHfGVI000491; Tue, 27 Feb 2024 17:43:33 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wf6we2v1c-2; Tue, 27 Feb 2024 17:43:33 +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=VlvX3k/VpCkcGGLcR/2lZbdT5aCDVU1+LpNJtNH78erFUg7E+3AvwSZQDt93O7KcGnvC 7GJ2ZEsGEE+xLAqIFuXxZoWhqMvTNLbiZq05FM2EkjzyDwUognSmwi1hu3KRtjemQIbr 7SOEHC4VSx9NmjWOKzztkjNa2wlDEmajkpcLYAq8e9mcjHX6cZ6x3Jq2T/koyrusHjpL TzbvfUqsD8zllAl0m60FCkCKGorXek7cDi+m2rOZstn49bUKWqCTAYe1pZ/ABd5MYK80 xkPaM4z8AUFlNcsAo4fn1gQ3q3ZS4Fm4qLSTxxZI6idAUl4r4spYbQaSuyH3hgdg4/Mz 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 V1 01/10] migration: remove migration.h references Date: Tue, 27 Feb 2024 09:43:18 -0800 Message-Id: <1709055807-315099-2-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709055807-315099-1-git-send-email-steven.sistare@oracle.com> References: <1709055807-315099-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-02-27_05,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270137 X-Proofpoint-ORIG-GUID: ZnZSKVSfc7FsLQu9ORoT8kHkoRCKRW1g X-Proofpoint-GUID: ZnZSKVSfc7FsLQu9ORoT8kHkoRCKRW1g 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: 1709055912653100001 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 07:41:42 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=1709055915; cv=none; d=zohomail.com; s=zohoarc; b=M8jyt0g492fk2mIAQt6cmz8INfSte7eGo/q8zeEhX5sHGCWz361prGbUstYFf/Jzt/9kaUoJHddeydzroQRvFOIAjSxHOJh84FURvfHCEA08Xn04Wl0YFhR/gYc7MEZtTnZkQXsL0yWuNQIQYHNcg2BDKldNLid6lildOmLz+x0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709055915; 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=DxIUBTg79Q75nMYgNTFbr7XSoiEW8UOFXDjy3QjtmYQ=; b=dnvjDCt+/Q96ekjKhqUcRP0dbunKZ2gzclxgodSC+EqFT/zATmbK+gLR3wty5EKKHO+e/5t7mUi0f7pLsPcUqpP+uzCynx9XD1Mb9EywQw6zmWJikxEG2bU5oxxiJmRKZ3Z3YFBdWO/a0THGZ+6EVHRNGLQdLCWbaOxwum5CHVI= 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 1709055915224123.3516297883599; Tue, 27 Feb 2024 09:45:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rf1UX-0001eD-RE; Tue, 27 Feb 2024 12:43:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rf1UW-0001db-N4 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:43:44 -0500 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 1rf1UU-0005Lk-R8 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:43:44 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41RFXsAr022521; Tue, 27 Feb 2024 17:43:37 GMT Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf784g3f1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:37 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41RHUfV2025490; Tue, 27 Feb 2024 17:43:36 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6we2v4v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:36 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41RHfGVK000491; Tue, 27 Feb 2024 17:43:35 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wf6we2v1c-3; Tue, 27 Feb 2024 17:43:35 +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=DxIUBTg79Q75nMYgNTFbr7XSoiEW8UOFXDjy3QjtmYQ=; b=MDbfLyy42zK2xnKPKeFI0G9wqDutez577QNTO5fDELekHK2X2zqxaJanPNwhjyjKChij Iv0kpp6H1StGhhwgSZhIt0oK77NHgUKFASY872fnmsBbddiTPP9G6rl4uMXZJrRA93vK cLKaiO0IifKZ9dOFqEfXFpwS0w/oSTI8ZiBrfHLah+EvfwsB10+ldvKdvxm5Ks7ZM3Vu HdprisNGIk43RXvWx9z5LcxSpPXVio7Y1iEgbGgpfiixfFz6HxfxBLRofZuv3F3Tcibi dFYnDfonuOaUw+KJPICSV/U41UuqohsN326riAgrYqAXVtGBS6bVupyYn0+ixSZlMf7/ Ng== 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 V1 02/10] migration: export migration_is_setup_or_active Date: Tue, 27 Feb 2024 09:43:19 -0800 Message-Id: <1709055807-315099-3-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709055807-315099-1-git-send-email-steven.sistare@oracle.com> References: <1709055807-315099-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-02-27_05,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270137 X-Proofpoint-GUID: SMYMbJiqG8-SXzG5XC150UZdN79zQtFh X-Proofpoint-ORIG-GUID: SMYMbJiqG8-SXzG5XC150UZdN79zQtFh 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: 1709055916669100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 7652fd4..894c65d 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1044,9 +1044,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: @@ -1568,10 +1570,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) @@ -2252,7 +2252,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 45a00b4..3a52fe1 100644 --- a/migration/ram.c +++ b/migration/ram.c @@ -2872,10 +2872,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 @@ -3105,7 +3104,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(= )) { ret =3D multifd_send_sync_main(); if (ret < 0) { 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 07:41:42 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=1709055846; cv=none; d=zohomail.com; s=zohoarc; b=cwA08GuP0W3deWjrSNzCdlLSeKexc37C5ySDvMJ/NZy7hfrIDeHIm1WjyVxnrFeDZHO0zl8V7TGP9LgF0AMaK9bHgdXM8qZScam3dn7YeV7sHPhBdvVIePCDuXuo36I7KzoXIDdZO9z5wy16lTBNdnh2kAuuJ8tXAD9IzVkFUJg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709055846; 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=En5gOq9zrYChcA/ikhpKd4ZeVIGKuYMKlWbEIKLoMSo=; b=aL5Jg/YqTyAKn08PPRLsCQ59FbZLryVUegTh+B+PxXYaKfCKifDPXbiOgXubvuUXujwAt3uYvPrPLiOpzqmCF9GpmYQdvWHBsjwpgYVeZZxwY+btTPXsj33dTPhEjpooDq1yGKDne3nQSo2uQFnQlbwhUCANpW+yQeR5cwpFJhQ= 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 170905584625479.30755253206212; Tue, 27 Feb 2024 09:44:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rf1UZ-0001f0-I0; Tue, 27 Feb 2024 12:43:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rf1UY-0001eQ-BD for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:43:46 -0500 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 1rf1UW-0005M6-NV for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:43:46 -0500 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 41RFY1O8004762; Tue, 27 Feb 2024 17:43:39 GMT Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf6vdyyd4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:38 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41RHChJB025481; Tue, 27 Feb 2024 17:43:38 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6we2v5x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:38 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41RHfGVM000491; Tue, 27 Feb 2024 17:43:37 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wf6we2v1c-4; Tue, 27 Feb 2024 17:43:37 +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=En5gOq9zrYChcA/ikhpKd4ZeVIGKuYMKlWbEIKLoMSo=; b=TxIusGq3+LCFVLudAX51XiHk/bJKVWyUdounL8Y7v/4AKE42zb5Npdh/90ihMKJ97SPd zSv1/3lOgkXtQV0/H5TvbrJsGe5e+mORmMMF/1D2vlos8cF8UrFXxk1yVyH2LYEnMEWb RDCGTkXcqHM4JZTSI9ckCBRbigFMmPiS6/30tePms98dgk9GuIlBQaTtOkOf7Q198TLV Zw+7pke87iFG7RAw3NshYSPISxdprp2DYFXCwz7+v3/cefDlWTPpk94i0EaxBk6ZFvPx Nfx6zgmltDFwtfUaBkp+Pdf+NTqoD1GF9k726KR1GSaW9hbmgdbFzaUCfFrg0248rRL3 JQ== 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 V1 03/10] migration: export migration_is_active Date: Tue, 27 Feb 2024 09:43:20 -0800 Message-Id: <1709055807-315099-4-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709055807-315099-1-git-send-email-steven.sistare@oracle.com> References: <1709055807-315099-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-02-27_05,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270137 X-Proofpoint-ORIG-GUID: kLkmKW9MT1YNhjPdQ8aj7N0c9nL_t28D X-Proofpoint-GUID: kLkmKW9MT1YNhjPdQ8aj7N0c9nL_t28D 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: 1709055846472100001 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 894c65d..4fb5b75 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1373,7 +1373,7 @@ static void migrate_fd_cleanup(MigrationState *s) */ close_return_path_on_source(s); =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, @@ -1604,8 +1604,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); } @@ -3413,7 +3415,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) { @@ -3559,7 +3561,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 07:41:42 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=1709055870; cv=none; d=zohomail.com; s=zohoarc; b=aDvJp5o4YYYVmiwiW8VoGO5GuwlU8qU+MbmTDHzbdK5kAU9e1fLb23dEgNKs2qEmAmSRcbxuazCXE2I4hGRPhIV0X+rdRvsXpfXzv9xXkj0yoFz7SD8VT33+Vncr39U3juvllIZlDNpiaDSwjJurhINrbl4HSXLwdH7pm7b08RE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709055870; 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=0VSA3E9F7P+/AxxuMUTQ7opQWkg/Lu4D2OqFC1M9wuE=; b=idSclPjnLsiZdgPcJU8AfxFDSI6EXmj6H/eIT+b7RM7SVtKk/6nziaEbL+G2NGOraxB3GTGYBQehSA3HgGp7QAUbkGKsUM91CPux/f2p8cTAQPVtBm2zSzhSqWj7zKbxYy6VPOtg1fRYrh7CxOG0VHLc5ilSgwUlnRxzt+3rI6c= 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 1709055870552350.5661523350698; Tue, 27 Feb 2024 09:44:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rf1Ub-0001fb-GB; Tue, 27 Feb 2024 12:43:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rf1Ua-0001fH-1F for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:43:48 -0500 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 1rf1UY-0005N1-9c for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:43:47 -0500 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 41RFXsPH019501; Tue, 27 Feb 2024 17:43:40 GMT Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf8gdg3f7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:40 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41RHbIdq025534; Tue, 27 Feb 2024 17:43:39 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6we2v6u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:39 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41RHfGVO000491; Tue, 27 Feb 2024 17:43:39 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wf6we2v1c-5; Tue, 27 Feb 2024 17:43:39 +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=0VSA3E9F7P+/AxxuMUTQ7opQWkg/Lu4D2OqFC1M9wuE=; b=WA9BJJJyO72qQxQA3xPHDpVXHdXkcoBgGC8p5lsTkzDi05KJ4wy1jIiw7BmWPBi0Fnj1 CC/PsWgqum61PynZ+SkGbbMrySE8Lr7OjGTOCs3Tpu/ufnp8LscJ65m8xVVYVdtOFg4z AwQbrfF7KW0nEDEPU7gfNWnfH1HYTyyaIZuYOF1yp9byXbxo3FHGxA8fpFVp1IL04e8v iUqvCAKzT6Lz2x94aYg1fDopXQYj05j1/sHLankdK7y0LoXFmeoE8k+QhutUAOUIc+Fc kzJXbZusqnpahOgVO9Cpm2z6RsRfj8M5i2jZsGuH5Mla2lOUQhDgj/MHKO/rqdd9CuY7 qQ== 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 V1 04/10] migration: export migration_is_running Date: Tue, 27 Feb 2024 09:43:21 -0800 Message-Id: <1709055807-315099-5-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709055807-315099-1-git-send-email-steven.sistare@oracle.com> References: <1709055807-315099-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-02-27_05,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270137 X-Proofpoint-ORIG-GUID: tcYvQkWnAkvSE3WETTMaBnjcGdK7Bqvc X-Proofpoint-GUID: tcYvQkWnAkvSE3WETTMaBnjcGdK7Bqvc 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: 1709055872566100005 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 4fb5b75..98bfc90 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1066,9 +1066,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: @@ -1444,7 +1446,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 */ @@ -1929,7 +1931,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 3e3e0b9..6e11d60 100644 --- a/migration/options.c +++ b/migration/options.c @@ -653,7 +653,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; } @@ -697,7 +697,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 d612c8a..44cf436 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -1704,7 +1704,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 07:41:42 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=1709055899; cv=none; d=zohomail.com; s=zohoarc; b=PmkKskW1yXmW76H8FZhZ8z55+yNU2IIoFnWObz4fp/d6h6MvpYltw35xA3YKOPPibyqfW0C/LZ9uFQis6cKBJiIPmYdKZDZEjOy9wILhWgq0woL9YlMgOIdG11WFgblOHbcF4iReBFTUXQMH6Ol/DTvGkk8DfrFYAPcrQ/Vqsvs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709055899; 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=n4kFepUJ0BGS+4CTc4AaGFzUseTXuwIEsBPELbwA1Xo=; b=EscqHE97VmIWxmDRmOplPpj0TLhshAYsUpVeZ0DHK/EkbLxGzmveVo/5Q2qwGrtvo/3Ue4DhoQ5cU+N2tVT6mSdTk2xlQCc1B6mAVJ3aXvDdiu0mIQCAzeHovr8KkwLy0DEZvTLd7o38zWi/GQTj2sI3hWnE8jUyE04MWxpzc1I= 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 1709055899387713.8630698644819; Tue, 27 Feb 2024 09:44:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rf1Ud-0001hw-Sd; Tue, 27 Feb 2024 12:43:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rf1Ub-0001fa-Dl for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:43:49 -0500 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 1rf1UZ-0005Nt-Qq for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:43:49 -0500 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 41RFY1RO004800; Tue, 27 Feb 2024 17:43:42 GMT Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf6vdyydm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:42 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41RGThqC025644; Tue, 27 Feb 2024 17:43:41 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6we2v88-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:41 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41RHfGVQ000491; Tue, 27 Feb 2024 17:43:40 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wf6we2v1c-6; Tue, 27 Feb 2024 17:43:40 +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=n4kFepUJ0BGS+4CTc4AaGFzUseTXuwIEsBPELbwA1Xo=; b=n3I2fjNgJP0+UH0h8Q36ufT+uRa57Ymuxh9QinkUU8FRKqjBxq7f6camipb4YK7JX5gp aH5Tht1BencXvk4Fb1UDtIO0qCEBjgU4/3rtlKwMlyK1GjqoTD/EUPitQeYgoaVA9CzN os6amE3ijMseUpGvi43oVkG1p9zUy2Sm97/cr+OihroiaqGlSk39kXpqSECLTeRvCnzW DGGOB68tW1JdIBTIxGoVA7YkXb96X/IRWnYSh3D5NGl0iwth9YYduqysQfKIuYBjz84f yI2quTrsmEZdv5q8q9wcCH+C4gPWFkfsEav1qxJC0BQd9kUZGxJAZFtg661Vupwc/aMK VA== 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 V1 05/10] migration: export vcpu_dirty_limit_period Date: Tue, 27 Feb 2024 09:43:22 -0800 Message-Id: <1709055807-315099-6-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709055807-315099-1-git-send-email-steven.sistare@oracle.com> References: <1709055807-315099-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-02-27_05,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270137 X-Proofpoint-ORIG-GUID: ICH3MH99HgJWFfh3faRnd1kPKa3ALibU X-Proofpoint-GUID: ICH3MH99HgJWFfh3faRnd1kPKa3ALibU 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: 1709055900629100001 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 6e11d60..317c620 100644 --- a/migration/options.c +++ b/migration/options.c @@ -896,6 +896,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 07:41:42 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=1709055869; cv=none; d=zohomail.com; s=zohoarc; b=f33ASE1sxNOdxhmjyGgJuULiPHC9Nxb6DGbzzXuvzlvQ9a08Lm1rDUZuV8e9LQL1p3ZeZvqMdattEjuE9jXg0wgqxAKtOuA47i/bkEN/MwpEM6LkRzH0Pq79e2EvumzkIhh4O6/fKaB2F95YI3elXa6RT2JCaIq0TMndrSDJeDs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709055869; 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=Us0ElZSbKhEozZPQ2Yq0/b2jdX4iAW9aGGOU48+UA5s=; b=GyJbNdlcTyATJa4BWi8Ektr+AeocxJ69zb8LvUMAZINwMFFNz8v16ILlzQfAPurKBCPzy/IlPiEvAsY3DcDmdmM4Xskam9Fxzs1mDQManAIKl84yz2HVF15ICRaGHuzBons759JhDMI8srkCqti7G42s+Fay9PVSm6z0dPVq6H8= 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 1709055869735359.06863025799987; Tue, 27 Feb 2024 09:44:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rf1Uf-0001iV-FO; Tue, 27 Feb 2024 12:43:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rf1Ud-0001hd-8v for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:43:51 -0500 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 1rf1Ub-0005Oo-Mi for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:43:51 -0500 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 41RFY1Vl004798; Tue, 27 Feb 2024 17:43:44 GMT Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf6vdyydq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:43 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41RHNXRV025575; Tue, 27 Feb 2024 17:43:43 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6we2v9t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:43 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41RHfGVS000491; Tue, 27 Feb 2024 17:43:42 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wf6we2v1c-7; Tue, 27 Feb 2024 17:43:42 +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=Us0ElZSbKhEozZPQ2Yq0/b2jdX4iAW9aGGOU48+UA5s=; b=gGsbFC2CtyftxqdnP0lJYQX8bKY0Q5VvGMt2z8zSgKV6Tro1lm/qePKWgUiqk2XoW9d0 Hu3JmF0mnj2yX8Tcix6RfA12etq14qm8l2LOxHbJgQwzbFd4dJjy69vbOQbng2WO03+B sBSeA/sf3a46nZ45/bFZQnTY4jKYVChpLgZIflqlsXPNUcjDTYxr12kV1R0LviEsEYtS 8xxZZLf/HhohztetfeDw8niM4dlfOJGujlCafkp27aWcof9xD58IztxdZ7cwM0t96uAp ishKDmqfNoWW+qckT7mJi8C90cMzH10Pi97yjvGcxI8hh3L31ojFOifEuC1nW8sg37WX MA== 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 V1 06/10] migration: migration_thread_is_self Date: Tue, 27 Feb 2024 09:43:23 -0800 Message-Id: <1709055807-315099-7-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709055807-315099-1-git-send-email-steven.sistare@oracle.com> References: <1709055807-315099-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-02-27_05,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270137 X-Proofpoint-ORIG-GUID: cP-4sSm6C0ah8eIXVxyHdaU8j26Vw1C2 X-Proofpoint-GUID: cP-4sSm6C0ah8eIXVxyHdaU8j26Vw1C2 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: 1709055870505100001 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 98bfc90..27af48c 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1614,6 +1614,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 07:41:42 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=1709055957; cv=none; d=zohomail.com; s=zohoarc; b=UZep8A5Z4kVM7eLp0/RzoGu1LWURZFeowwy7E2QQWHpUWSh9gd8m8ZdJR5cnEMBHAt03WMXfbMVZ9Ax2VPMVVQYCIMshoBCzw0I4/MY6nueJ6d3CjjpmMqWLMmj+5zcd6TxUcluwH5rTGomH/5/fV/aU5xRbALzMgjRVaqcJA2U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709055957; 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=6Y1uHgkezRM1sw8qKzgdmDiay3ONQK/YHE7lFgyAY2M=; b=gbbwWq84sXOhU2HugvwHJ1HnPL+xDTeopMyC964iWsrMl/gakI4VVUi1CGSC+hQTUxXHW7VvStXNEtoQwKrEQaaXAP+0bcGAVAkA4+HiZapwC7615i8F/cVYqbIyjjc8AbDj4KXSnh9bVk5DU3vMit6m2fzhRYGwaWUS6IKX01I= 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 1709055957503938.6559046010358; Tue, 27 Feb 2024 09:45:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rf1Vj-000599-5S; Tue, 27 Feb 2024 12:44:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rf1Vh-0004ub-PN for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:44:57 -0500 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 1rf1Vg-0005Xe-8c for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:44:57 -0500 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 41RFYlhA009942; Tue, 27 Feb 2024 17:44:50 GMT Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf82u7smm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:44:48 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41RHXWKt025495; Tue, 27 Feb 2024 17:43:45 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6we2vb9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:44 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41RHfGVU000491; Tue, 27 Feb 2024 17:43:44 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wf6we2v1c-8; Tue, 27 Feb 2024 17:43:44 +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=6Y1uHgkezRM1sw8qKzgdmDiay3ONQK/YHE7lFgyAY2M=; b=KayDhQzJNbH9PTAATeNOi9tqyDQz8tnQfvpbx2kM0TvK3QSipm3eh1fKM6HRmVIJriRI /NFKDrPGR6YvNEIyFzbfcwXP28fWp+AZBqH7n3T+dJfeuS2HxYy6xLRfEzHkoq5LqGzn m6+8EdPwf9tuR2L6qFmyPC+p6/UT84gLspF2gu/zJZMkG+uT2MkRoxu1jHl3G/g3RNjx vuCNDQ/1n+bPJSAt+nQX2/yBt+wLusD5BQLnNyKz7iQWmTDcmzQTkQSDijYX6KuqVjNE fdTCrDgBN8FfT4PYILJ8Tr9tUFowk2leiqfCmfsdnKG+lBcfqvoUmPNHjR5QHIe3Yz8V 8w== 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 V1 07/10] migration: migration_is_device Date: Tue, 27 Feb 2024 09:43:24 -0800 Message-Id: <1709055807-315099-8-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709055807-315099-1-git-send-email-steven.sistare@oracle.com> References: <1709055807-315099-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-02-27_05,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270137 X-Proofpoint-GUID: AoHyoVs5ARlc1qdR1y1dVzOHZ4dxJlcj X-Proofpoint-ORIG-GUID: AoHyoVs5ARlc1qdR1y1dVzOHZ4dxJlcj 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: 1709055958853100009 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 27af48c..6b386af 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1614,6 +1614,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 07:41:42 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=1709055890; cv=none; d=zohomail.com; s=zohoarc; b=WWnS84NQWRvSVCK/u4KRbujoQLqcHz62UvKYvbmM5KjutNR51Lfo1ZxMi08X8BjXTE+A/QkrE1k6Hj31JnPfvBWcqTDy/WFUvB0OFbeB+gp+pXYwTU8ySiDEPi/p3gGltvczUT3F0ZCnG7Hj8euwPjGVw0oQHQTiiscXTomhQak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709055890; 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=zKk6pFB++GL3mqIavSgxkb8BjTilnw4woqB6VwYv4bM=; b=VzF2MTW8mMUvyIWNvrCwwtm+MzRq0XIhQQDerMha/8oLwgUJUDMK7iMgn4dQcyXfHB43jyYkR6RWHIEavYn5zhbh8n8vKqDjFGgJkDMRDLha/MCzLKqKMcrISMYqUqlcDtIT9l2tscPryFjhXApfVBw40q9ZsZOkq5ogxZVcyfM= 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 1709055890722565.5082218900219; Tue, 27 Feb 2024 09:44:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rf1VC-0002GT-VI; Tue, 27 Feb 2024 12:44:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rf1VA-00029w-K6 for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:44:24 -0500 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 1rf1V1-0005Qq-PC for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:44:24 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41RFXsbi022482; Tue, 27 Feb 2024 17:43:58 GMT Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf784g3fy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:57 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41RHSwGH025547; Tue, 27 Feb 2024 17:43:47 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6we2vcp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:47 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41RHfGVW000491; Tue, 27 Feb 2024 17:43:46 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wf6we2v1c-9; Tue, 27 Feb 2024 17:43:46 +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=zKk6pFB++GL3mqIavSgxkb8BjTilnw4woqB6VwYv4bM=; b=Xz07anWEiOhzV75WOCleO1WT+gwUr0TAEHeWVjrFuClZnWWWKwW/aDJqHjVUdUoON+dn oEYfaREr7ryHVlDfZU1gJl266W/AJK5Dul3kCBMSnbKnoawXBmIhliuhURF5cfmTaI2+ xruu3+b+wR/DrnySuVxU/ZXSb0OS9uo/kWaLkswm0EDLl9pOVJ2n0AkI+oRYBAvg1jG5 qiUG61e8MujkSLr2SemeMR9gtOqGczkX+oz5ZWn3PKx6IkrOpxrIQPBdfYHtZhU9E404 r3lyZIqg+S/i7qOR1gM4R4kljdtkQ+vS1N0GruvkJBXoFGoTcRnafl7rBXToIYDskVJ5 aA== 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 V1 08/10] migration: migration_file_set_error Date: Tue, 27 Feb 2024 09:43:25 -0800 Message-Id: <1709055807-315099-9-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709055807-315099-1-git-send-email-steven.sistare@oracle.com> References: <1709055807-315099-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-02-27_05,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270137 X-Proofpoint-GUID: c-N2XOy6BqryTLrkBe1Kg1Gk209yZIOD X-Proofpoint-ORIG-GUID: c-N2XOy6BqryTLrkBe1Kg1Gk209yZIOD 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: 1709055892595100003 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 6b386af..4f65a98 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2996,6 +2996,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 07:41:42 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=1709055956; cv=none; d=zohomail.com; s=zohoarc; b=EBv6jaKvSslRJyYM94fmNwl1PaeqfKEA88vCMkFyzVrDkDZQLjr9VCm1VnJi70nZj0X/8qEJUiZUzdtu3S9S6HSkQWHX9sq0thQmQPJcKLAd8GWZ+t9EC27xwP+BwbK5QG3ov7IPpbefZxVsCtOSZ5dwr/+nuNco0FNqdKsnFKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709055956; 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=XNO9sL20TjAY/lz41mA5c+XUY4v8LbX1BRgrrTOzYKX+zVhwA9FkLyloV30PrTRSaEsI9eGoVkzaOZYGAX3nVQj1GquKSuUEUzFiPaZ6ZlLvBmXAmdwz/TJyI8QM9JLQfxK93K9Y8e5HmPKAUyjyxhkMfFweWvRGXDREAkqlqRM= 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 17090559560599.776483539804417; Tue, 27 Feb 2024 09:45:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rf1Vr-0005R1-6J; Tue, 27 Feb 2024 12:45:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rf1Vq-0005Q0-2N for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:45:06 -0500 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 1rf1Vo-0005fd-Bp for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:45:05 -0500 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 41RFYlJF009938; Tue, 27 Feb 2024 17:44:57 GMT Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf82u7smx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:44:55 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41RHY3sD025619; Tue, 27 Feb 2024 17:43:48 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6we2vdn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:48 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41RHfGVY000491; Tue, 27 Feb 2024 17:43:48 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wf6we2v1c-10; Tue, 27 Feb 2024 17:43:48 +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=nIZFNoUNq6/J1K+r2mhsabBvQ2Fn5DF3t12C7CRNHMivzQNgES566xqr4rBB2tBRfFiH jxfjl9djdcqTtOFvDgQLmCAGid3PbXjpHAJ874go/zoaMdhmc2prAk9V+6T2WGi2dxo4 I9M1ku/28N4n3J0L/oSFzPl4DxD9tKmuHwDrreHw5u7dAIR8B1+wRa5GVWZrvzpRlnvK gyXi46cl9oF9xMXrn+jhHoSXx5mVS4Bhv6IdDCXOeGF1p7rUKZbui9IXFUi5UxZqyzZ3 9yO8433ZLLqnXjhIay79mXNX/33mkdISHQ1dnUxX6+W4Io70YPB1tIm8YnkSQQeUYfWu fQ== 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 V1 09/10] migration: privatize colo interfaces Date: Tue, 27 Feb 2024 09:43:26 -0800 Message-Id: <1709055807-315099-10-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709055807-315099-1-git-send-email-steven.sistare@oracle.com> References: <1709055807-315099-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-02-27_05,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270137 X-Proofpoint-GUID: fRbd9qaVR3igFnwdmfEM2B0ygzQR5Yot X-Proofpoint-ORIG-GUID: fRbd9qaVR3igFnwdmfEM2B0ygzQR5Yot 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: 1709055956774100001 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 --- 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 07:41:42 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=1709055955; cv=none; d=zohomail.com; s=zohoarc; b=R8O7ISbFoHPML4A7LJY23CdQkOp4HxyUNlarBUIs53ICBRIw7Iu/lncxD1A+eU8WxPcYeNPe5jts0XDWP1OrXCTcpS+MndTWt6grGn+W+zpVPA46l1Es8YQpEddINj5C8S2LYcQVWQzv8wpPYlIxq2dVi9NWRQXnAMA+hoqKu2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709055955; 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=4W+9X9H6GcLZgCA7Dut/Gniehk9bd4kANbDWpPncF+k=; b=UXzj/lJHUaPdtrFr+Gdeh3KRwIYORmm48jgYqzBGIduFUXazjkvXTso0ZT/4W4dBON0s3JGNuaRLMVrp2lpkaIM85zNzy1nwIR13p5/QDLhOEu3sQfqjSQMMrD9MptUWR/mjNi2D6ph9mvWbfVQyLmKEEf201h2OCX9rEkwgWoQ= 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 170905595594615.86807538252856; Tue, 27 Feb 2024 09:45:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rf1Vp-0005Pi-FK; Tue, 27 Feb 2024 12:45:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rf1Vn-0005Lh-5s for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:45:03 -0500 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 1rf1Vl-0005YC-GI for qemu-devel@nongnu.org; Tue, 27 Feb 2024 12:45:02 -0500 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 41RFYlJB009938; Tue, 27 Feb 2024 17:44:55 GMT Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf82u7sn1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:44:51 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41RHKbDW025545; Tue, 27 Feb 2024 17:43:50 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6we2ved-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2024 17:43:50 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41RHfGVa000491; Tue, 27 Feb 2024 17:43:50 GMT Received: from ca-dev63.us.oracle.com (ca-dev63.us.oracle.com [10.211.8.221]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3wf6we2v1c-11; Tue, 27 Feb 2024 17:43:49 +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=4W+9X9H6GcLZgCA7Dut/Gniehk9bd4kANbDWpPncF+k=; b=Bcd1nkaLH+yazRri0/ACesDdMvqc8tmI6ojYsm4/szRPwh9vc+RrKXQ7BIIDJ4++APup fMeDUcV8PB7LVPsVq+pBcIZQdd5EKAUdx3SIf1fsbK6Bm5jy0WyDixeyDQSXDs/snih6 miaegN/0LG62VY8Sfib6fohzZPICoI4CK/BxY/AKW56DuRTUaakaxidjveNw1TGXDu4Z aat4lVehxuCOpe6IuiQhmcNtyj/LwZfa2SKR+y2Ka0LVaH/pMewBl/MRIT95S2brZqCg sMVvJ6AvgDf5CW0KxZyhm6VbjTKJrTfriVVZIKhtXqyGfT3xDQyagw/uqiEHR4GzdeJZ Kg== 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 V1 10/10] migration: purge MigrationState from public interface Date: Tue, 27 Feb 2024 09:43:27 -0800 Message-Id: <1709055807-315099-11-git-send-email-steven.sistare@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1709055807-315099-1-git-send-email-steven.sistare@oracle.com> References: <1709055807-315099-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-02-27_05,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402270137 X-Proofpoint-GUID: LAzNqv82H0pJ6Qj40QhutTU4ntu-y6J8 X-Proofpoint-ORIG-GUID: LAzNqv82H0pJ6Qj40QhutTU4ntu-y6J8 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: 1709055956789100002 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Delete unused accessors and 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 | 9 ++------- migration/migration.c | 10 ---------- migration/migration.h | 6 ++++++ 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/include/migration/misc.h b/include/migration/misc.h index e521cd5..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,19 +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_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 */ bool migration_incoming_postcopy_advised(void); + /* True if background snapshot is active */ bool migration_in_bg_snapshot(void); =20 diff --git a/migration/migration.c b/migration/migration.c index 4f65a98..703a9ee 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -1515,16 +1515,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 || 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