From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzqHV-0003hs-CJ for qemu-devel@nongnu.org; Tue, 02 Jun 2015 13:47:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzqHP-0006cd-UR for qemu-devel@nongnu.org; Tue, 02 Jun 2015 13:47:17 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:45760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzqHP-0006cO-M4 for qemu-devel@nongnu.org; Tue, 02 Jun 2015 13:47:11 -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, 2 Jun 2015 11:47:10 -0600 Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id C357D6E8047 for ; Tue, 2 Jun 2015 13:38:39 -0400 (EDT) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t52HkqPt58458200 for ; Tue, 2 Jun 2015 17:46:52 GMT Received: from d01av01.pok.ibm.com (localhost [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t52HkpLj021372 for ; Tue, 2 Jun 2015 13:46:52 -0400 From: "Jason J. Herne" Date: Tue, 2 Jun 2015 13:46:49 -0400 Message-Id: <1433267209-9882-4-git-send-email-jjherne@linux.vnet.ibm.com> In-Reply-To: <1433267209-9882-1-git-send-email-jjherne@linux.vnet.ibm.com> References: <1433267209-9882-1-git-send-email-jjherne@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v2 3/3] 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 Cc: "Jason J. Herne" Report throttle ratio in info migrate and query-migrate responses when cpu throttling is active. Signed-off-by: Jason J. Herne --- hmp.c | 5 +++++ migration/migration.c | 5 +++++ qapi-schema.json | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/hmp.c b/hmp.c index e17852d..cb3c137 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_ratio) { + monitor_printf(mon, "cpu throttle ratio : %0.2f\n", + info->x_cpu_throttle_ratio); + } + qapi_free_MigrationInfo(info); qapi_free_MigrationCapabilityStatusList(caps); } diff --git a/migration/migration.c b/migration/migration.c index c9545df..98cc03a 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -263,6 +263,11 @@ MigrationInfo *qmp_query_migrate(Error **errp) info->disk->total = blk_mig_bytes_total(); } + if (cpu_throttle_active(first_cpu)) { + info->has_x_cpu_throttle_ratio = true; + info->x_cpu_throttle_ratio = cpu_throttle_get_ratio(first_cpu); + } + get_xbzrle_cache_stats(info); break; case MIGRATION_STATUS_COMPLETED: diff --git a/qapi-schema.json b/qapi-schema.json index f97ffa1..5e732e0 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -483,7 +483,8 @@ '*total-time': 'int', '*expected-downtime': 'int', '*downtime': 'int', - '*setup-time': 'int'} } + '*setup-time': 'int', + '*x-cpu-throttle-ratio': 'number'} } ## # @query-migrate -- 1.9.1