]> git.proxmox.com Git - mirror_qemu.git/commit - qapi/migration.json
migration: Fix migrate-set-parameters argument validation
authorMarkus Armbruster <armbru@redhat.com>
Tue, 2 Feb 2021 14:17:31 +0000 (15:17 +0100)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Mon, 8 Feb 2021 11:19:51 +0000 (11:19 +0000)
commitec17de0ac09f1f45c78d6afd0d7aea05ffb0ed9d
tree8a0fd46ddadc915a70817b057be40c583df35f8a
parentc7243566d0b58966e41fd2b56145f885a04793ec
migration: Fix migrate-set-parameters argument validation

Commit 741d4086c8 "migration: Use proper types in json" (v2.12.0)
switched MigrationParameters to narrower integer types, and removed
the simplified qmp_migrate_set_parameters()'s argument checking
accordingly.

Good idea, except qmp_migrate_set_parameters() takes
MigrateSetParameters, not MigrationParameters.  Its job is updating
migrate_get_current()->parameters (which *is* of type
MigrationParameters) according to its argument.  The integers now get
truncated silently.  Reproducer:

    ---> {'execute': 'query-migrate-parameters'}
    <--- {"return": {[...] "compress-threads": 8, [...]}}
    ---> {"execute": "migrate-set-parameters", "arguments": {"compress-threads": 257}}
    <--- {"return": {}}
    ---> {'execute': 'query-migrate-parameters'}
    <--- {"return": {[...] "compress-threads": 1, [...]}}

Fix by resynchronizing MigrateSetParameters with MigrationParameters.

Fixes: 741d4086c856320807a2575389d7c0505578270b
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20210202141734.2488076-2-armbru@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
monitor/hmp-cmds.c
qapi/migration.json