]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qmp/hmp: Add throttle ratio to query-migrate and info migrate
authorJason J. Herne <jjherne@linux.vnet.ibm.com>
Tue, 8 Sep 2015 17:12:36 +0000 (13:12 -0400)
committerJuan Quintela <quintela@redhat.com>
Wed, 30 Sep 2015 07:42:04 +0000 (09:42 +0200)
Report throttle percentage in info migrate and query-migrate responses when
cpu throttling is active.

Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
hmp.c
migration/migration.c
qapi-schema.json

diff --git a/hmp.c b/hmp.c
index 48ce37239e3caa136dfab26f222341f51c3273ca..5048eeeb2dfef23e89e9fd691720a2814440bc83 100644 (file)
--- a/hmp.c
+++ b/hmp.c
@@ -232,6 +232,11 @@ void hmp_info_migrate(Monitor *mon, const QDict *qdict)
                        info->xbzrle_cache->overflow);
     }
 
+    if (info->has_x_cpu_throttle_percentage) {
+        monitor_printf(mon, "cpu throttle percentage: %" PRIu64 "\n",
+                       info->x_cpu_throttle_percentage);
+    }
+
     qapi_free_MigrationInfo(info);
     qapi_free_MigrationCapabilityStatusList(caps);
 }
index e8292319aee5ee8999108ae57d074112c9a56139..c7472ed20836a155925bd06709b18e4a85e7075d 100644 (file)
@@ -447,6 +447,11 @@ MigrationInfo *qmp_query_migrate(Error **errp)
             info->disk->total = blk_mig_bytes_total();
         }
 
+        if (cpu_throttle_active()) {
+            info->has_x_cpu_throttle_percentage = true;
+            info->x_cpu_throttle_percentage = cpu_throttle_get_percentage();
+        }
+
         get_xbzrle_cache_stats(info);
         break;
     case MIGRATION_STATUS_COMPLETED:
index 646c0fa572b39cff21274937a44533a89ab82dd3..8b0520c2d076a6e148ed4baf6dc47d84502a6a15 100644 (file)
 #        may be expensive, but do not actually occur during the iterative
 #        migration rounds themselves. (since 1.6)
 #
+# @x-cpu-throttle-percentage: #optional percentage of time guest cpus are being
+#       throttled during auto-converge. This is only present when auto-converge
+#       has started throttling guest cpus. (Since 2.5)
+#
 # Since: 0.14.0
 ##
 { 'struct': 'MigrationInfo',
            '*total-time': 'int',
            '*expected-downtime': 'int',
            '*downtime': 'int',
-           '*setup-time': 'int'} }
+           '*setup-time': 'int',
+           '*x-cpu-throttle-percentage': 'int'} }
 
 ##
 # @query-migrate