]> git.proxmox.com Git - mirror_qemu.git/commitdiff
migration: fix missing assignment for has_x_checkpoint_delay
authorzhanghailiang <zhang.zhanghailiang@huawei.com>
Wed, 2 Nov 2016 07:42:09 +0000 (15:42 +0800)
committerJuan Quintela <quintela@redhat.com>
Mon, 14 Nov 2016 13:50:56 +0000 (14:50 +0100)
We forgot to assign true to params->has_x_checkpoint_delay parameter
in qmp_query_migrate_parameters.

Without this, qmp command 'query-migrate-parameters' doesn't show the
default value for x-checkpoint-delay option.

This also fixes the fact that HMP was relying on unspecified behavior by
reading x_checkpoint_delay without checking has_x_checkpoint_delay.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
hmp.c
migration/migration.c

diff --git a/hmp.c b/hmp.c
index b5e3f54534c43e635c9414558f9bad3da5da2f1e..02103dfb75f0a16bee673722ac8bf2df02a65157 100644 (file)
--- a/hmp.c
+++ b/hmp.c
@@ -318,6 +318,7 @@ void hmp_info_migrate_parameters(Monitor *mon, const QDict *qdict)
         monitor_printf(mon, " %s: %" PRId64 " milliseconds",
             MigrationParameter_lookup[MIGRATION_PARAMETER_DOWNTIME_LIMIT],
             params->downtime_limit);
+        assert(params->has_x_checkpoint_delay);
         monitor_printf(mon, " %s: %" PRId64,
             MigrationParameter_lookup[MIGRATION_PARAMETER_X_CHECKPOINT_DELAY],
             params->x_checkpoint_delay);
index e331f28382a0e387d4d774f3893c219763ceced4..f498ab84f2d41af52c1ddcb748a74a5b210e6281 100644 (file)
@@ -593,6 +593,7 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp)
     params->max_bandwidth = s->parameters.max_bandwidth;
     params->has_downtime_limit = true;
     params->downtime_limit = s->parameters.downtime_limit;
+    params->has_x_checkpoint_delay = true;
     params->x_checkpoint_delay = s->parameters.x_checkpoint_delay;
 
     return params;