From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c679D-0004cJ-Bq for qemu-devel@nongnu.org; Sun, 13 Nov 2016 21:37:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c679C-0002sj-Gz for qemu-devel@nongnu.org; Sun, 13 Nov 2016 21:37:27 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:35730) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1c679B-0002sU-6T for qemu-devel@nongnu.org; Sun, 13 Nov 2016 21:37:26 -0500 References: <1478072529-8348-1-git-send-email-zhang.zhanghailiang@huawei.com> From: Hailiang Zhang Message-ID: <58292350.5010404@huawei.com> Date: Mon, 14 Nov 2016 10:37:04 +0800 MIME-Version: 1.0 In-Reply-To: <1478072529-8348-1-git-send-email-zhang.zhanghailiang@huawei.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] migration: fix missing assignment for has_x_checkpoint_delay List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: quintela@redhat.com, amit.shah@redhat.com Cc: qemu-devel@nongnu.org, dgilbert@redhat.com ping ? On 2016/11/2 15:42, zhanghailiang wrote: > 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 > Reviewed-by: Eric Blake > --- > v2: > - fix the commit message as Eric sugguested. > --- > hmp.c | 1 + > migration/migration.c | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/hmp.c b/hmp.c > index b5e3f54..02103df 100644 > --- 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); > diff --git a/migration/migration.c b/migration/migration.c > index e331f28..f498ab8 100644 > --- a/migration/migration.c > +++ b/migration/migration.c > @@ -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; >