All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: dgilbert@redhat.com, lvivier@redhat.com, peterx@redhat.com
Subject: [Qemu-devel] [PATCH 3/4] ram: Print block stats also in the complete case
Date: Thu,  1 Jun 2017 23:40:55 +0200	[thread overview]
Message-ID: <20170601214056.30387-4-quintela@redhat.com> (raw)
In-Reply-To: <20170601214056.30387-1-quintela@redhat.com>

To make things easier, I just moved it to populate_ram_info().

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/migration.c | 26 ++++++++------------------
 1 file changed, 8 insertions(+), 18 deletions(-)

diff --git a/migration/migration.c b/migration/migration.c
index 7f79da0..8289544 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -509,6 +509,14 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s)
         info->cpu_throttle_percentage = cpu_throttle_get_percentage();
     }
 
+    if (blk_mig_active()) {
+        info->has_disk = true;
+        info->disk = g_malloc0(sizeof(*info->disk));
+        info->disk->transferred = blk_mig_bytes_transferred();
+        info->disk->remaining = blk_mig_bytes_remaining();
+        info->disk->total = blk_mig_bytes_total();
+    }
+
     if (s->state != MIGRATION_STATUS_COMPLETED) {
         info->ram->remaining = ram_bytes_remaining();
         info->ram->dirty_pages_rate = ram_dirty_pages_rate();
@@ -540,15 +548,6 @@ MigrationInfo *qmp_query_migrate(Error **errp)
         info->setup_time = s->setup_time;
 
         populate_ram_info(info, s);
-
-        if (blk_mig_active()) {
-            info->has_disk = true;
-            info->disk = g_malloc0(sizeof(*info->disk));
-            info->disk->transferred = blk_mig_bytes_transferred();
-            info->disk->remaining = blk_mig_bytes_remaining();
-            info->disk->total = blk_mig_bytes_total();
-        }
-
         break;
     case MIGRATION_STATUS_POSTCOPY_ACTIVE:
         /* Mostly the same as active; TODO add some postcopy stats */
@@ -562,15 +561,6 @@ MigrationInfo *qmp_query_migrate(Error **errp)
         info->setup_time = s->setup_time;
 
         populate_ram_info(info, s);
-
-        if (blk_mig_active()) {
-            info->has_disk = true;
-            info->disk = g_malloc0(sizeof(*info->disk));
-            info->disk->transferred = blk_mig_bytes_transferred();
-            info->disk->remaining = blk_mig_bytes_remaining();
-            info->disk->total = blk_mig_bytes_total();
-        }
-
         break;
     case MIGRATION_STATUS_COLO:
         info->has_status = true;
-- 
2.9.4

  parent reply	other threads:[~2017-06-01 21:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01 21:40 [Qemu-devel] [PATCH 0/4] Make info migrate output consistent Juan Quintela
2017-06-01 21:40 ` [Qemu-devel] [PATCH 1/4] ram: Unfold get_xbzrle_cache_stats() into populate_ram_info() Juan Quintela
2017-06-02 13:32   ` Eric Blake
2017-06-01 21:40 ` [Qemu-devel] [PATCH 2/4] ram: We only print throttling information sometimes Juan Quintela
2017-06-02 13:33   ` Eric Blake
2017-06-01 21:40 ` Juan Quintela [this message]
2017-06-02 13:35   ` [Qemu-devel] [PATCH 3/4] ram: Print block stats also in the complete case Eric Blake
2017-06-02 17:55   ` Dr. David Alan Gilbert
2017-06-06  7:21     ` Peter Xu
2017-06-01 21:40 ` [Qemu-devel] [PATCH 4/4] ram: Now POSTCOPY_ACTIVE is the same that STATUS_ACTIVE Juan Quintela
2017-06-02 13:36   ` Eric Blake

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=20170601214056.30387-4-quintela@redhat.com \
    --to=quintela@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.