hmp: info migrate_parameters format tunes

Do the same (one per line) to the parameter list.

CC: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
Peter Xu 2017-04-01 16:18:45 +08:00 committed by Juan Quintela
parent d80a0169e3
commit 2c02468c9b

22
hmp.c
View File

@ -285,46 +285,44 @@ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict)
params = qmp_query_migrate_parameters(NULL); params = qmp_query_migrate_parameters(NULL);
if (params) { if (params) {
monitor_printf(mon, "parameters:");
assert(params->has_compress_level); assert(params->has_compress_level);
monitor_printf(mon, " %s: %" PRId64, monitor_printf(mon, "%s: %" PRId64 "\n",
MigrationParameter_lookup[MIGRATION_PARAMETER_COMPRESS_LEVEL], MigrationParameter_lookup[MIGRATION_PARAMETER_COMPRESS_LEVEL],
params->compress_level); params->compress_level);
assert(params->has_compress_threads); assert(params->has_compress_threads);
monitor_printf(mon, " %s: %" PRId64, monitor_printf(mon, "%s: %" PRId64 "\n",
MigrationParameter_lookup[MIGRATION_PARAMETER_COMPRESS_THREADS], MigrationParameter_lookup[MIGRATION_PARAMETER_COMPRESS_THREADS],
params->compress_threads); params->compress_threads);
assert(params->has_decompress_threads); assert(params->has_decompress_threads);
monitor_printf(mon, " %s: %" PRId64, monitor_printf(mon, "%s: %" PRId64 "\n",
MigrationParameter_lookup[MIGRATION_PARAMETER_DECOMPRESS_THREADS], MigrationParameter_lookup[MIGRATION_PARAMETER_DECOMPRESS_THREADS],
params->decompress_threads); params->decompress_threads);
assert(params->has_cpu_throttle_initial); assert(params->has_cpu_throttle_initial);
monitor_printf(mon, " %s: %" PRId64, monitor_printf(mon, "%s: %" PRId64 "\n",
MigrationParameter_lookup[MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL], MigrationParameter_lookup[MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL],
params->cpu_throttle_initial); params->cpu_throttle_initial);
assert(params->has_cpu_throttle_increment); assert(params->has_cpu_throttle_increment);
monitor_printf(mon, " %s: %" PRId64, monitor_printf(mon, "%s: %" PRId64 "\n",
MigrationParameter_lookup[MIGRATION_PARAMETER_CPU_THROTTLE_INCREMENT], MigrationParameter_lookup[MIGRATION_PARAMETER_CPU_THROTTLE_INCREMENT],
params->cpu_throttle_increment); params->cpu_throttle_increment);
monitor_printf(mon, " %s: '%s'", monitor_printf(mon, "%s: '%s'\n",
MigrationParameter_lookup[MIGRATION_PARAMETER_TLS_CREDS], MigrationParameter_lookup[MIGRATION_PARAMETER_TLS_CREDS],
params->has_tls_creds ? params->tls_creds : ""); params->has_tls_creds ? params->tls_creds : "");
monitor_printf(mon, " %s: '%s'", monitor_printf(mon, "%s: '%s'\n",
MigrationParameter_lookup[MIGRATION_PARAMETER_TLS_HOSTNAME], MigrationParameter_lookup[MIGRATION_PARAMETER_TLS_HOSTNAME],
params->has_tls_hostname ? params->tls_hostname : ""); params->has_tls_hostname ? params->tls_hostname : "");
assert(params->has_max_bandwidth); assert(params->has_max_bandwidth);
monitor_printf(mon, " %s: %" PRId64 " bytes/second", monitor_printf(mon, "%s: %" PRId64 " bytes/second\n",
MigrationParameter_lookup[MIGRATION_PARAMETER_MAX_BANDWIDTH], MigrationParameter_lookup[MIGRATION_PARAMETER_MAX_BANDWIDTH],
params->max_bandwidth); params->max_bandwidth);
assert(params->has_downtime_limit); assert(params->has_downtime_limit);
monitor_printf(mon, " %s: %" PRId64 " milliseconds", monitor_printf(mon, "%s: %" PRId64 " milliseconds\n",
MigrationParameter_lookup[MIGRATION_PARAMETER_DOWNTIME_LIMIT], MigrationParameter_lookup[MIGRATION_PARAMETER_DOWNTIME_LIMIT],
params->downtime_limit); params->downtime_limit);
assert(params->has_x_checkpoint_delay); assert(params->has_x_checkpoint_delay);
monitor_printf(mon, " %s: %" PRId64, monitor_printf(mon, "%s: %" PRId64 "\n",
MigrationParameter_lookup[MIGRATION_PARAMETER_X_CHECKPOINT_DELAY], MigrationParameter_lookup[MIGRATION_PARAMETER_X_CHECKPOINT_DELAY],
params->x_checkpoint_delay); params->x_checkpoint_delay);
monitor_printf(mon, "\n");
} }
qapi_free_MigrationParameters(params); qapi_free_MigrationParameters(params);