From nobody Sun Feb 8 21:28:35 2026 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1517932514962133.18983346667926; Tue, 6 Feb 2018 07:55:14 -0800 (PST) Received: from localhost ([::1]:59615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5aU-0006Lf-4x for importer@patchew.org; Tue, 06 Feb 2018 10:55:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej5WF-0002sm-6X for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej5WB-0004Gc-Eq for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50212) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ej5WB-0004Fx-8I for qemu-devel@nongnu.org; Tue, 06 Feb 2018 10:50:47 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 731DC19D39D; Tue, 6 Feb 2018 15:50:46 +0000 (UTC) Received: from dgilbert-t530.redhat.com (ovpn-117-30.ams2.redhat.com [10.36.117.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7821F5D6A8; Tue, 6 Feb 2018 15:50:35 +0000 (UTC) From: "Dr. David Alan Gilbert (git)" To: qemu-devel@nongnu.org, quintela@redhat.com Date: Tue, 6 Feb 2018 15:49:26 +0000 Message-Id: <20180206154936.13565-5-dgilbert@redhat.com> In-Reply-To: <20180206154936.13565-1-dgilbert@redhat.com> References: <20180206154936.13565-1-dgilbert@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 06 Feb 2018 15:50:46 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 04/14] 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: lvivier@redhat.com, groug@kaod.org, peterx@redhat.com, ross.lagerwall@citrix.com, wei.w.wang@intel.com, danielhb@linux.vnet.ibm.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" From: Wei Wang Fixes: b15df1ae50 ("migration: cleanup stats update into function") The threshold size is changed to be recorded in s->threshold_size. Signed-off-by: Wei Wang Reviewed-by: Peter Xu Reviewed-by: Juan Quintela Signed-off-by: Juan Quintela Signed-off-by: Dr. David Alan Gilbert --- migration/migration.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/migration/migration.c b/migration/migration.c index 1fbd304c66..44cbfb0ddd 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -2169,7 +2169,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) { @@ -2179,7 +2178,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; @@ -2199,7 +2198,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 2.14.3