From nobody Sat Oct 25 23:35:10 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516101049123316.8113827452787; Tue, 16 Jan 2018 03:10:49 -0800 (PST) Received: from localhost ([::1]:56676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebP8g-0004xd-Bf for importer@patchew.org; Tue, 16 Jan 2018 06:10:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebP7n-0004Up-F9 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 06:09:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebP7j-0000ZU-6G for qemu-devel@nongnu.org; Tue, 16 Jan 2018 06:09:51 -0500 Received: from mga09.intel.com ([134.134.136.24]:23074) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebP7i-0000Ys-T7 for qemu-devel@nongnu.org; Tue, 16 Jan 2018 06:09:47 -0500 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2018 03:09:45 -0800 Received: from devel-ww.sh.intel.com ([10.239.48.110]) by orsmga004.jf.intel.com with ESMTP; 16 Jan 2018 03:09:43 -0800 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,368,1511856000"; d="scan'208";a="166467786" From: Wei Wang To: qemu-devel@nongnu.org Date: Tue, 16 Jan 2018 18:51:32 +0800 Message-Id: <1516099892-34247-1-git-send-email-wei.w.wang@intel.com> X-Mailer: git-send-email 2.7.4 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.24 Subject: [Qemu-devel] [PATCH v1] migration: use s->threshold_size inside migration_update_counters X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wei Wang , dgilbert@redhat.com, peterx@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The threshold size is changed to be recorded in s->threshold_size by commit b15df1ae5063c7c181f8f068f9eba7661b3b5e1. Signed-off-by: Wei Wang Reviewed-by: Peter Xu --- migration/migration.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index d3a1c49..bfd1a16 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2212,7 +2212,6 @@ static void migration_update_counters(MigrationState = *s, int64_t current_time) { uint64_t transferred, time_spent; - int64_t threshold_size; double bandwidth; =20 if (current_time < s->iteration_start_time + BUFFER_DELAY) { @@ -2222,7 +2221,7 @@ static void migration_update_counters(MigrationState = *s, transferred =3D qemu_ftell(s->to_dst_file) - s->iteration_initial_byte= s; time_spent =3D current_time - s->iteration_start_time; bandwidth =3D (double)transferred / time_spent; - threshold_size =3D bandwidth * s->parameters.downtime_limit; + s->threshold_size =3D bandwidth * s->parameters.downtime_limit; =20 s->mbps =3D (((double) transferred * 8.0) / ((double) time_spent / 1000.0)) / 1000.0 / 1000.0; @@ -2242,7 +2241,7 @@ static void migration_update_counters(MigrationState = *s, s->iteration_initial_bytes =3D qemu_ftell(s->to_dst_file); =20 trace_migrate_transferred(transferred, time_spent, - bandwidth, threshold_size); + bandwidth, s->threshold_size); } =20 /* Migration thread iteration status */ --=20 1.8.3.1