From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Lieven <pl@kamp.de>, qemu-devel@nongnu.org
Cc: dgilbert@redhat.com, quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH] migration: show average throughput when migration finishes
Date: Mon, 12 May 2014 16:29:04 +0200 [thread overview]
Message-ID: <5370DAB0.4010005@redhat.com> (raw)
In-Reply-To: <1399884360-26064-1-git-send-email-pl@kamp.de>
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 <pl@kamp.de>
>
> 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 <pbonzini@redhat.com>
prev parent reply other threads:[~2014-05-12 14:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-12 8:46 [Qemu-devel] [PATCH] migration: show average throughput when migration finishes Peter Lieven
2014-05-12 14:29 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5370DAB0.4010005@redhat.com \
--to=pbonzini@redhat.com \
--cc=dgilbert@redhat.com \
--cc=pl@kamp.de \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.