From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZMST-000740-Pu for qemu-devel@nongnu.org; Tue, 08 Sep 2015 13:13:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZMSO-0002FK-MA for qemu-devel@nongnu.org; Tue, 08 Sep 2015 13:13:25 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:58559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZMSO-00024q-Fr for qemu-devel@nongnu.org; Tue, 08 Sep 2015 13:13:20 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 8 Sep 2015 11:12:53 -0600 Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 6B1621FF0087 for ; Tue, 8 Sep 2015 11:03:59 -0600 (MDT) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t88HBkoL40894472 for ; Tue, 8 Sep 2015 10:11:46 -0700 Received: from d03av05.boulder.ibm.com (localhost [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t88HCmeq008159 for ; Tue, 8 Sep 2015 11:12:49 -0600 From: "Jason J. Herne" Date: Tue, 8 Sep 2015 13:12:36 -0400 Message-Id: <1441732357-11861-5-git-send-email-jjherne@linux.vnet.ibm.com> In-Reply-To: <1441732357-11861-1-git-send-email-jjherne@linux.vnet.ibm.com> References: <1441732357-11861-1-git-send-email-jjherne@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v7 4/5] qmp/hmp: Add throttle ratio to query-migrate and info migrate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: afaerber@suse.de, amit.shah@redhat.com, dgilbert@redhat.com, borntraeger@de.ibm.com, quintela@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com Cc: "Jason J. Herne" Report throttle percentage in info migrate and query-migrate responses when cpu throttling is active. Signed-off-by: Jason J. Herne Reviewed-by: Dr. David Alan Gilbert --- hmp.c | 5 +++++ migration/migration.c | 5 +++++ qapi-schema.json | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hmp.c b/hmp.c index eb65998..36bc76e 100644 --- a/hmp.c +++ b/hmp.c @@ -229,6 +229,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); } diff --git a/migration/migration.c b/migration/migration.c index 7708c54..b29450a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -274,6 +274,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: diff --git a/qapi-schema.json b/qapi-schema.json index 6eba9ed..cef20c7 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -474,6 +474,10 @@ # 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', @@ -483,7 +487,8 @@ '*total-time': 'int', '*expected-downtime': 'int', '*downtime': 'int', - '*setup-time': 'int'} } + '*setup-time': 'int', + '*x-cpu-throttle-percentage': 'int'} } ## # @query-migrate -- 1.9.1