From nobody Mon Feb 9 16:52:25 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; 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=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1653374519; cv=none; d=zohomail.com; s=zohoarc; b=ng7aGXdsKlj6uQYdMmzQ2i5OC38GbAp3ar4MK83kzboZPqb/TEvr9JZVC+3jJMIzCazp89zuPYRDtXl7/Z5kRWoPwmz3RuGSBjO74WKGG2ZNNwYEJwVFTb0adftSRWw1UKiYu1ULB31kduxN6rmT5WNLejs9P6Wjn4gKLJH7eGY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653374519; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=x44NJIBIiuKPic9u0sOUy4IEl8Sn4tYEN9Iozull9IU=; b=Cv9/qsso2v7cCu+E1vUVDSPemowED/+N2MmR4Ua1MXSNNHjyLi0ukU4sUkRsHmtxEjvUl+INxtMF1bCH2tkLwXZP5X+5rH+lczJfdqf4JigxAnVwSPuzZWYHIzPuC8ckIWajiXb+Rp7jYIQxv+ftI13M/rsl0glZR7WsH2CgViU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; 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 165337451946931.23641548066007; Mon, 23 May 2022 23:41:59 -0700 (PDT) Received: from localhost ([::1]:57896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntOEw-00074B-E9 for importer@patchew.org; Tue, 24 May 2022 02:41:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntNtG-0008D1-5I for qemu-devel@nongnu.org; Tue, 24 May 2022 02:19:34 -0400 Received: from mga17.intel.com ([192.55.52.151]:41983) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntNtE-0000HO-F5 for qemu-devel@nongnu.org; Tue, 24 May 2022 02:19:33 -0400 Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2022 23:19:30 -0700 Received: from leirao-pc.bj.intel.com ([10.238.156.102]) by orsmga008.jf.intel.com with ESMTP; 23 May 2022 23:19:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653373172; x=1684909172; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pfQR45LZch1v1vRjXbsnVrV5Nq/XR+Tvb/OTap5qN9o=; b=Ks7j8/WT6b/LaSoeWE8mgCW517oFqKcDQJgbYDRyWztxjGYKN0lrGLvb Nu48B6BctitBFM1H4Hw36kd83l0d8OCrOC+XRiE3tL7SYQxM5xTw1ZsVT YUCgdHhn1XpxZcU/599VrUGSXbeNTsgUdmb1gVwjn8CTu/vEEblNNE86p 7Io2wZxYZ8pULrJRvwWosmn0sbYV3ts05rHudHkahSJA5r6+ugvdlD4sn jVewAhBYsGESJ1gBgawdI94xWTJfen8h2JpQGlaVtmvDMcPLoE2oaNMOF 1GQCoapF5O5eLXVpCfvnKodxxEXNoIpYVesYE1g4vGVK8N81pVyCfbrAt A==; X-IronPort-AV: E=McAfee;i="6400,9594,10356"; a="253943221" X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="253943221" X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,248,1647327600"; d="scan'208";a="601059758" From: Lei Rao To: alex.williamson@redhat.com, kevin.tian@intel.com, eddie.dong@intel.com, jason.zeng@intel.com, quintela@redhat.com, dgilbert@redhat.com, yadong.li@intel.com, yi.l.liu@intel.com Cc: qemu-devel@nongnu.org, Lei Rao Subject: [RFC PATCH 07/13] vfio/migration: move the statistics of bytes_transferred to generic VFIO migration layer Date: Tue, 24 May 2022 14:18:42 +0800 Message-Id: <20220524061848.1615706-8-lei.rao@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220524061848.1615706-1-lei.rao@intel.com> References: <20220524061848.1615706-1-lei.rao@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=192.55.52.151; envelope-from=lei.rao@intel.com; helo=mga17.intel.com X-Spam_score_int: -44 X-Spam_score: -4.5 X-Spam_bar: ---- X-Spam_report: (-4.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1653374521586100001 Content-Type: text/plain; charset="utf-8" The statistics of bytes transferred conceptually belong to The VFIO live migration framework, and should not belong to any specific implementation such In-Band approach, so move it out from vfio_migration_region_save_buffe= r(), which makes it easier to add other implementations. Signed-off-by: Lei Rao Reviewed-by: Eddie Dong --- hw/vfio/migration.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 4736af90e7..c114fab3a2 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -257,7 +257,6 @@ static int vfio_migration_save_buffer_local(QEMUFile *f= , VFIODevice *vbasedev, *size =3D data_size; } =20 - bytes_transferred +=3D data_size; return ret; } =20 @@ -540,6 +539,7 @@ static int vfio_save_iterate(QEMUFile *f, void *opaque) vbasedev->name, strerror(errno)); return ret; } + bytes_transferred +=3D data_size; } =20 qemu_put_be64(f, VFIO_MIG_FLAG_END_OF_STATE); @@ -592,6 +592,7 @@ static int vfio_save_complete_precopy(QEMUFile *f, void= *opaque) error_report("%s: Failed to save buffer", vbasedev->name); return ret; } + bytes_transferred +=3D data_size; } =20 if (data_size =3D=3D 0) { --=20 2.32.0