From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjrEG-0001UB-0r for qemu-devel@nongnu.org; Mon, 12 May 2014 10:29:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjrEA-0004X2-8X for qemu-devel@nongnu.org; Mon, 12 May 2014 10:29:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjrEA-0004Wk-1Y for qemu-devel@nongnu.org; Mon, 12 May 2014 10:29:14 -0400 Message-ID: <5370DAB0.4010005@redhat.com> Date: Mon, 12 May 2014 16:29:04 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1399884360-26064-1-git-send-email-pl@kamp.de> In-Reply-To: <1399884360-26064-1-git-send-email-pl@kamp.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] migration: show average throughput when migration finishes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven , qemu-devel@nongnu.org Cc: dgilbert@redhat.com, quintela@redhat.com Il 12/05/2014 10:46, Peter Lieven ha scritto: > currently the value of the throughput field contains whatever > was the last calculated throughput shortly before the migration > finished. > > This patch updates the post migration contents of the field to > the average throughput. > > Signed-off-by: Peter Lieven > > diff --git a/migration.c b/migration.c > index 52cda27..3fc03d6 100644 > --- a/migration.c > +++ b/migration.c > @@ -662,8 +662,13 @@ static void *migration_thread(void *opaque) > qemu_mutex_lock_iothread(); > if (s->state == MIG_STATE_COMPLETED) { > int64_t end_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME); > + uint64_t transferred_bytes = qemu_ftell(s->file); > s->total_time = end_time - s->total_time; > s->downtime = end_time - start_time; > + if (s->total_time) { > + s->mbps = (((double) transferred_bytes * 8.0) / > + ((double) s->total_time)) / 1000; > + } > runstate_set(RUN_STATE_POSTMIGRATE); > } else { > if (old_vm_running) { > Reviewed-by: Paolo Bonzini