From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8YR2-0001Ug-Cv for qemu-devel@nongnu.org; Fri, 26 Jun 2015 14:33:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8YQx-0000JG-BO for qemu-devel@nongnu.org; Fri, 26 Jun 2015 14:33:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55855) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8YQx-0000J6-6A for qemu-devel@nongnu.org; Fri, 26 Jun 2015 14:33:03 -0400 Date: Fri, 26 Jun 2015 19:32:58 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20150626183257.GL2186@work-vm> References: <1435254377-13322-1-git-send-email-jjherne@linux.vnet.ibm.com> <1435254377-13322-5-git-send-email-jjherne@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435254377-13322-5-git-send-email-jjherne@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH v3 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: "Jason J. Herne" Cc: quintela@redhat.com, qemu-devel@nongnu.org, dgilbert@redhat.com, borntraeger@de.ibm.com, amit.shah@redhat.com, afaerber@suse.de * Jason J. Herne (jjherne@linux.vnet.ibm.com) wrote: > 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 7dd324e..cd36256 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.4) > +# > # 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 > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK