docs tests: Fix use of migrate_set_parameter
cover docs tests: Fix use of migrate_set_parameter
I spotted a bad use of migrate_set_parameter in test-hmp.c, and looked for more.
I also looked for more failing HMP commands in test-hmp.c. I found some, but they fail only on some machines, which feels okay. They are:
* device_add usb-mouse,id=mouse1
device_del mouse1
Fail when the device is not compiled in, and when the machine doesn't provide USB.
* memsave 0 4096 "/dev/null"
Fails when the machine doesn't have memory there.
* screendump /dev/null
Fails when there is no console.
* dump-guest-memory /dev/null 0 4096
Fails for targets that don't support dumping, and when the machine doesn't have memory there.
* nmi
Fails when the machine doesn't provide NMIs.
Markus Armbruster (2):
docs tests: Fix use of migrate_set_parameter tests/qtest/test-hmp: Fix migrate_set_parameter xbzrle-cache-size test
docs/multi-thread-compression.txt | 12 ++++++------ docs/rdma.txt | 2 +- tests/qtest/test-hmp.c | 6 +++--- tests/qemu-iotests/181 | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-)
Signature · 1 line
2.41.0
PATCH 1/2 docs tests: Fix use of migrate_set_parameter
docs/multi-thread-compression.txt uses parameter names with underscores instead of dashes. Wrong since day one.
docs/rdma.txt, tests/qemu-iotests/181, and tests/qtest/test-hmp.c are wrong the same way since commit cbde7be900d2 (v6.0.0). Hard to see, as test-hmp doesn't check whether the commands work, and iotest 181 appears to be unaffected.
--- docs/multi-thread-compression.txt | 12 ++++++------ docs/rdma.txt | 2 +- tests/qtest/test-hmp.c | 6 +++--- tests/qemu-iotests/181 | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-)
docs/multi-thread-compression.txt +6 -6
@@ -117,13 +117,13 @@ to support the multiple thread compression migration: {qemu} migrate_set_capability compress on 3. Set the compression thread count on source: - {qemu} migrate_set_parameter compress_threads 12 + {qemu} migrate_set_parameter compress-threads 12 4. Set the compression level on the source: - {qemu} migrate_set_parameter compress_level 1 + {qemu} migrate_set_parameter compress-level 1 5. Set the decompression thread count on destination: - {qemu} migrate_set_parameter decompress_threads 3 + {qemu} migrate_set_parameter decompress-threads 3 6. Start outgoing migration: {qemu} migrate -d tcp:destination.host:4444
@@ -133,9 +133,9 @@ to support the multiple thread compression migration: The following are the default settings: compress: off - compress_threads: 8 - decompress_threads: 2 - compress_level: 1 (which means best speed) + compress-threads: 8 + decompress-threads: 2 + compress-level: 1 (which means best speed) So, only the first two steps are required to use the multiple thread compression in migration. You can do more if the default
docs/rdma.txt +1 -1
@@ -89,7 +89,7 @@ RUNNING: First, set the migration speed to match your hardware's capabilities: QEMU Monitor Command: -$ migrate_set_parameter max_bandwidth 40g # or whatever is the MAX of your RDMA device +$ migrate_set_parameter max-bandwidth 40g # or whatever is the MAX of your RDMA device Next, on the destination machine, add the following to the QEMU command line:
tests/qtest/test-hmp.c +3 -3
@@ -45,9 +45,9 @@ static const char *hmp_cmds[] = {"log all" ,"log none" ,"memsave 0 4096 \"/dev/null\"" , -"migrate_set_parameter xbzrle_cache_size 1" , -"migrate_set_parameter downtime_limit 1" , -"migrate_set_parameter max_bandwidth 1" , +"migrate_set_parameter xbzrle-cache-size 1" , +"migrate_set_parameter downtime-limit 1" , +"migrate_set_parameter max-bandwidth 1" ,"netdev_add user,id=net1" ,"set_link net1 off" , "set_link net1 on",
tests/qemu-iotests/181 +1 -1
@@ -109,7 +109,7 @@ if [ ${QEMU_STATUS[$dest]} -lt 0 ]; then _notrun 'Postcopy is not supported' fi -_send_qemu_cmd $src 'migrate_set_parameter max_bandwidth 4k' "(qemu)" +_send_qemu_cmd $src 'migrate_set_parameter max-bandwidth 4k' "(qemu)" _send_qemu_cmd $src 'migrate_set_capability postcopy-ram on' "(qemu)" _send_qemu_cmd $src "migrate -d unix:${MIG_SOCKET}" "(qemu)" _send_qemu_cmd $src 'migrate_start_postcopy' "(qemu)"
Signature · 1 line
2.41.0
Quoted 8 lines · Markus Armbruster
docs/multi-thread-compression.txtuses parameter names with underscores instead of dashes. Wrong since day one.
docs/rdma.txt, tests/qemu-iotests/181, andtests/qtest/test-hmp.care wrong the same way since commitcbde7be900d2(v6.0.0). Hard to see, as test-hmp doesn't check whether the commands work, and iotest 181 appears to be unaffected.
Quoted 4 lines
Fixes 263170e679df (docs: Add a doc about multiple thread compression)Fixes cbde7be900d2 (migrate: remove QMP/HMP commands for speed, downtime and cache size)Signed-off-by Markus Armbruster <[email protected]>---
PATCH 2/2 tests/qtest/test-hmp: Fix migrate_set_parameter xbzrle-cache-size test
In reply to Markus ArmbrusterThe command always fails with "Error: Parameter 'xbzrle_cache_size' expects a power of two no less than the target page size". The test passes anyway. Change the argument from 1 to 64k to make the test a bit more useful.
--- tests/qtest/test-hmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/test-hmp.c +1 -1
@@ -45,7 +45,7 @@ static const char *hmp_cmds[] = {"log all" ,"log none" ,"memsave 0 4096 \"/dev/null\"" , -"migrate_set_parameter xbzrle-cache-size 1" , +"migrate_set_parameter xbzrle-cache-size 64k" ,"migrate_set_parameter downtime-limit 1" ,"migrate_set_parameter max-bandwidth 1" , "netdev_add user,id=net1",
Signature · 1 line
2.41.0
Re: [PATCH 2/2] tests/qtest/test-hmp: Fix migrate_set_parameter xbzrle-cache-size test
Quoted 15 lines · Markus Armbruster
The command always fails with "Error: Parameter '
xbzrle_cache_size' expects a power of two no less than the target page size". The test passes anyway. Change the argument from 1 to 64k to make the test a bit more useful.Signed-off-by Markus Armbruster <[email protected]>--- tests/qtest/test-hmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/qtest/test-hmp.c +0
-0
tests/qtest/test-hmp.c static const char *hmp_cmds[] = { · line 51
Quoted 8 lines
tests/qtest/test-hmp.c +1
-1@@ -45,7 +45,7 @@ static const char *hmp_cmds[] = {"log all" ,"log none" ,"memsave 0 4096 \"/dev/null\"" , -"migrate_set_parameter xbzrle-cache-size 1" , +"migrate_set_parameter xbzrle-cache-size 64k" ,"migrate_set_parameter downtime-limit 1" ,"migrate_set_parameter max-bandwidth 1" , "netdev_add user,id=net1",
Michael Tokarev
AppliedQuoted 2 lines · Markus Armbruster
I spotted a bad use of
migrate_set_parameterintest-hmp.c, and looked for more.
Applied to my trivial-patches tree. Thanks!
/mjt