ram: We only print throttling information sometimes
authorJuan Quintela <quintela@redhat.com>
Wed, 3 May 2017 11:16:38 +0000 (13:16 +0200)
committerJuan Quintela <quintela@redhat.com>
Wed, 7 Jun 2017 08:20:52 +0000 (10:20 +0200)
Change it to be consistent with everything else.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
migration/migration.c

index b1e68c09d9487dcfd4ee4a6f92a284e3feba9d2f..9c5ff577b7a52af2b94acea13e08350801928c24 100644 (file)
@@ -616,6 +616,11 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s)
         info->xbzrle_cache->overflow = xbzrle_mig_pages_overflow();
     }
 
+    if (cpu_throttle_active()) {
+        info->has_cpu_throttle_percentage = true;
+        info->cpu_throttle_percentage = cpu_throttle_get_percentage();
+    }
+
     if (s->state != MIGRATION_STATUS_COMPLETED) {
         info->ram->remaining = ram_bytes_remaining();
         info->ram->dirty_pages_rate = ram_dirty_pages_rate();
@@ -656,11 +661,6 @@ MigrationInfo *qmp_query_migrate(Error **errp)
             info->disk->total = blk_mig_bytes_total();
         }
 
-        if (cpu_throttle_active()) {
-            info->has_cpu_throttle_percentage = true;
-            info->cpu_throttle_percentage = cpu_throttle_get_percentage();
-        }
-
         break;
     case MIGRATION_STATUS_POSTCOPY_ACTIVE:
         /* Mostly the same as active; TODO add some postcopy stats */