All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] migration: fix missing assignment for has_x_checkpoint_delay
@ 2016-11-01  5:50 zhanghailiang
  2016-11-01 14:27 ` Eric Blake
  0 siblings, 1 reply; 3+ messages in thread
From: zhanghailiang @ 2016-11-01  5:50 UTC (permalink / raw)
  To: quintela, amit.shah; +Cc: qemu-devel, dgilbert, qemu-trivial, zhanghailiang

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.
It doesn't influence output of hmp command 'info migrate_parameters'.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
---
 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;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] migration: fix missing assignment for has_x_checkpoint_delay
  2016-11-01  5:50 [Qemu-devel] [PATCH] migration: fix missing assignment for has_x_checkpoint_delay zhanghailiang
@ 2016-11-01 14:27 ` Eric Blake
  2016-11-02  7:26   ` Hailiang Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2016-11-01 14:27 UTC (permalink / raw)
  To: zhanghailiang, quintela, amit.shah; +Cc: qemu-trivial, qemu-devel, dgilbert

[-- Attachment #1: Type: text/plain, Size: 1147 bytes --]

On 11/01/2016 12:50 AM, 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.
> It doesn't influence output of hmp command 'info migrate_parameters'.

Well, only because the current code doesn't forcefully assign missing
optional parameters to any other value.  But HMP was relying on
unspecified behavior, that could have broken with any other qapi change.

I might word the commit message:

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

Up to the maintainer, though, since the patch itself is fine.

> 
> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
> ---
>  hmp.c                 | 1 +
>  migration/migration.c | 1 +
>  2 files changed, 2 insertions(+)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] migration: fix missing assignment for has_x_checkpoint_delay
  2016-11-01 14:27 ` Eric Blake
@ 2016-11-02  7:26   ` Hailiang Zhang
  0 siblings, 0 replies; 3+ messages in thread
From: Hailiang Zhang @ 2016-11-02  7:26 UTC (permalink / raw)
  To: Eric Blake, quintela, amit.shah; +Cc: qemu-trivial, qemu-devel, dgilbert

On 2016/11/1 22:27, Eric Blake wrote:
> On 11/01/2016 12:50 AM, 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.
>> It doesn't influence output of hmp command 'info migrate_parameters'.
>
> Well, only because the current code doesn't forcefully assign missing
> optional parameters to any other value.  But HMP was relying on
> unspecified behavior, that could have broken with any other qapi change.
>
> I might word the commit message:
>
> This also fixes the fact that HMP was relying on unspecified behavior by
> reading x_checkpoint_delay without checking has_x_checkpoint_delay.
>
> Up to the maintainer, though, since the patch itself is fine.
>

OK, thanks, I'd like to fix the message as your said :)

>>
>> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
>> ---
>>   hmp.c                 | 1 +
>>   migration/migration.c | 1 +
>>   2 files changed, 2 insertions(+)
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-02  7:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-01  5:50 [Qemu-devel] [PATCH] migration: fix missing assignment for has_x_checkpoint_delay zhanghailiang
2016-11-01 14:27 ` Eric Blake
2016-11-02  7:26   ` Hailiang Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.