aboutsummaryrefslogtreecommitdiff
path: root/tests/qtest
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2021-02-19 18:40:12 +0000
committerDaniel P. Berrangé <berrange@redhat.com>2021-03-18 09:22:55 +0000
commitcbde7be900d2a2279cbc4becb91d1ddd6a014def (patch)
treede317c2edbeb20ac706cdf0a6861dc5770936eae /tests/qtest
parent8becb36063fb14df1e3ae4916215667e2cb65fa2 (diff)
migrate: remove QMP/HMP commands for speed, downtime and cache size
The generic 'migrate_set_parameters' command handle all types of param. Only the QMP commands were documented in the deprecations page, but the rationale for deprecating applies equally to HMP, and the replacements exist. Furthermore the HMP commands are just shims to the QMP commands, so removing the latter breaks the former unless they get re-implemented. Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'tests/qtest')
-rw-r--r--tests/qtest/migration-test.c48
-rw-r--r--tests/qtest/test-hmp.c6
-rw-r--r--tests/qtest/vhost-user-test.c8
3 files changed, 7 insertions, 55 deletions
diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
index f2142fbd3c..3a711bb492 100644
--- a/tests/qtest/migration-test.c
+++ b/tests/qtest/migration-test.c
@@ -658,53 +658,6 @@ static void test_migrate_end(QTestState *from, QTestState *to, bool test_dest)
cleanup("dest_serial");
}
-static void deprecated_set_downtime(QTestState *who, const double value)
-{
- QDict *rsp;
-
- rsp = qtest_qmp(who,
- "{ 'execute': 'migrate_set_downtime',"
- " 'arguments': { 'value': %f } }", value);
- g_assert(qdict_haskey(rsp, "return"));
- qobject_unref(rsp);
- migrate_check_parameter_int(who, "downtime-limit", value * 1000);
-}
-
-static void deprecated_set_speed(QTestState *who, long long value)
-{
- QDict *rsp;
-
- rsp = qtest_qmp(who, "{ 'execute': 'migrate_set_speed',"
- "'arguments': { 'value': %lld } }", value);
- g_assert(qdict_haskey(rsp, "return"));
- qobject_unref(rsp);
- migrate_check_parameter_int(who, "max-bandwidth", value);
-}
-
-static void deprecated_set_cache_size(QTestState *who, long long value)
-{
- QDict *rsp;
-
- rsp = qtest_qmp(who, "{ 'execute': 'migrate-set-cache-size',"
- "'arguments': { 'value': %lld } }", value);
- g_assert(qdict_haskey(rsp, "return"));
- qobject_unref(rsp);
- migrate_check_parameter_int(who, "xbzrle-cache-size", value);
-}
-
-static void test_deprecated(void)
-{
- QTestState *from;
-
- from = qtest_init("-machine none");
-
- deprecated_set_downtime(from, 0.12345);
- deprecated_set_speed(from, 12345);
- deprecated_set_cache_size(from, 4096);
-
- qtest_quit(from);
-}
-
static int migrate_postcopy_prepare(QTestState **from_ptr,
QTestState **to_ptr,
MigrateStart *args)
@@ -1486,7 +1439,6 @@ int main(int argc, char **argv)
qtest_add_func("/migration/postcopy/unix", test_postcopy);
qtest_add_func("/migration/postcopy/recovery", test_postcopy_recovery);
- qtest_add_func("/migration/deprecated", test_deprecated);
qtest_add_func("/migration/bad_dest", test_baddest);
qtest_add_func("/migration/precopy/unix", test_precopy_unix);
qtest_add_func("/migration/precopy/tcp", test_precopy_tcp);
diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c
index 94a8023173..413eb95d2a 100644
--- a/tests/qtest/test-hmp.c
+++ b/tests/qtest/test-hmp.c
@@ -45,9 +45,9 @@ static const char *hmp_cmds[] = {
"log all",
"log none",
"memsave 0 4096 \"/dev/null\"",
- "migrate_set_cache_size 1",
- "migrate_set_downtime 1",
- "migrate_set_speed 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",
diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c
index 1a5f5313ff..3d6337fb5c 100644
--- a/tests/qtest/vhost-user-test.c
+++ b/tests/qtest/vhost-user-test.c
@@ -756,8 +756,8 @@ static void test_migrate(void *obj, void *arg, QGuestAllocator *alloc)
/* slow down migration to have time to fiddle with log */
/* TODO: qtest could learn to break on some places */
- rsp = qmp("{ 'execute': 'migrate_set_speed',"
- "'arguments': { 'value': 10 } }");
+ rsp = qmp("{ 'execute': 'migrate-set-parameters',"
+ "'arguments': { 'max-bandwidth': 10 } }");
g_assert(qdict_haskey(rsp, "return"));
qobject_unref(rsp);
@@ -776,8 +776,8 @@ static void test_migrate(void *obj, void *arg, QGuestAllocator *alloc)
munmap(log, size);
/* speed things up */
- rsp = qmp("{ 'execute': 'migrate_set_speed',"
- "'arguments': { 'value': 0 } }");
+ rsp = qmp("{ 'execute': 'migrate-set-parameters',"
+ "'arguments': { 'max-bandwidth': 0 } }");
g_assert(qdict_haskey(rsp, "return"));
qobject_unref(rsp);