Commit 4782893e authored by Jason J. Herne's avatar Jason J. Herne Committed by Juan Quintela
Browse files

qmp/hmp: Add throttle ratio to query-migrate and info migrate



Report throttle percentage in info migrate and query-migrate responses when
cpu throttling is active.

Signed-off-by: default avatarJason J. Herne <jjherne@linux.vnet.ibm.com>
Reviewed-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: default avatarJuan Quintela <quintela@redhat.com>
Reviewed-by: default avatarJuan Quintela <quintela@redhat.com>
parent 070afca2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);
}
+5 −0
Original line number Diff line number Diff line
@@ -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:
+6 −1
Original line number Diff line number Diff line
@@ -480,6 +480,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',
@@ -489,7 +493,8 @@
           '*total-time': 'int',
           '*expected-downtime': 'int',
           '*downtime': 'int',
           '*setup-time': 'int'} }
           '*setup-time': 'int',
           '*x-cpu-throttle-percentage': 'int'} }

##
# @query-migrate