aboutsummaryrefslogtreecommitdiff
path: root/qapi
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-02-02 15:17:31 +0100
committerDr. David Alan Gilbert <dgilbert@redhat.com>2021-02-08 11:19:51 +0000
commitec17de0ac09f1f45c78d6afd0d7aea05ffb0ed9d (patch)
tree8a0fd46ddadc915a70817b057be40c583df35f8a /qapi
parentc7243566d0b58966e41fd2b56145f885a04793ec (diff)
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>
Diffstat (limited to 'qapi')
-rw-r--r--qapi/migration.json28
1 files changed, 14 insertions, 14 deletions
diff --git a/qapi/migration.json b/qapi/migration.json
index 6c12b368aa..37026643ab 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -890,28 +890,28 @@
'*announce-max': 'size',
'*announce-rounds': 'size',
'*announce-step': 'size',
- '*compress-level': 'int',
- '*compress-threads': 'int',
+ '*compress-level': 'uint8',
+ '*compress-threads': 'uint8',
'*compress-wait-thread': 'bool',
- '*decompress-threads': 'int',
- '*throttle-trigger-threshold': 'int',
- '*cpu-throttle-initial': 'int',
- '*cpu-throttle-increment': 'int',
+ '*decompress-threads': 'uint8',
+ '*throttle-trigger-threshold': 'uint8',
+ '*cpu-throttle-initial': 'uint8',
+ '*cpu-throttle-increment': 'uint8',
'*cpu-throttle-tailslow': 'bool',
'*tls-creds': 'StrOrNull',
'*tls-hostname': 'StrOrNull',
'*tls-authz': 'StrOrNull',
- '*max-bandwidth': 'int',
- '*downtime-limit': 'int',
- '*x-checkpoint-delay': 'int',
+ '*max-bandwidth': 'size',
+ '*downtime-limit': 'uint64',
+ '*x-checkpoint-delay': 'uint32',
'*block-incremental': 'bool',
- '*multifd-channels': 'int',
+ '*multifd-channels': 'uint8',
'*xbzrle-cache-size': 'size',
'*max-postcopy-bandwidth': 'size',
- '*max-cpu-throttle': 'int',
+ '*max-cpu-throttle': 'uint8',
'*multifd-compression': 'MultiFDCompression',
- '*multifd-zlib-level': 'int',
- '*multifd-zstd-level': 'int',
+ '*multifd-zlib-level': 'uint8',
+ '*multifd-zstd-level': 'uint8',
'*block-bitmap-mapping': [ 'BitmapMigrationNodeAlias' ] } }
##
@@ -1098,7 +1098,7 @@
'*max-bandwidth': 'size',
'*downtime-limit': 'uint64',
'*x-checkpoint-delay': 'uint32',
- '*block-incremental': 'bool' ,
+ '*block-incremental': 'bool',
'*multifd-channels': 'uint8',
'*xbzrle-cache-size': 'size',
'*max-postcopy-bandwidth': 'size',