Lines Matching +full:throttle +full:- +full:period +full:- +full:us

4  * Copyright (c) 2016-2018 Red Hat, Inc. and/or its affiliates
5 * based on the vhost-user-test.c that is:
9 * See the COPYING file in the top-level directory.
24 #include "ppc-util.h"
26 #include "migration-helpers.h"
27 #include "tests/migration/migration-test.h"
29 # include "tests/unit/crypto-tls-psk-helpers.h"
31 # include "tests/unit/crypto-tls-x509-helpers.h"
66 #define ANALYZE_SCRIPT "scripts/analyze-migration.py"
103 if (ufd == -1) { in ufd_version_check()
141 #include "tests/migration/i386/a-b-bootblock.h"
142 #include "tests/migration/aarch64/a-b-kernel.h"
143 #include "tests/migration/ppc64/a-b-kernel.h"
144 #include "tests/migration/s390x/a-b-bios.h"
167 x86_bootsect[SYM_suspend_me - SYM_start] = suspend_me; in bootfile_create()
227 if (!state->stop_seen) { in wait_for_stop()
234 if (!state->resume_seen) { in wait_for_resume()
241 if (state->suspend_me && !state->suspend_seen) { in wait_for_suspend()
281 return read_ram_property_int(who, "dirty-sync-count"); in get_migration_pass()
289 g_assert(qdict_haskey(rsp_return, "postcopy-blocktime")); in read_blocktime()
311 * start_address to < end_address in order. This gives us a constraint in check_guests_ram()
335 * to us yet. in check_guests_ram()
351 fprintf(stderr, "and in another %d pages", bad - 10); in check_guests_ram()
370 who, "{ 'execute': 'query-migrate-parameters' }"); in migrate_get_parameter_int()
389 "{ 'execute': 'migrate-set-parameters'," in migrate_set_parameter_int()
402 who, "{ 'execute': 'query-migrate-parameters' }"); in migrate_get_parameter_str()
419 "{ 'execute': 'migrate-set-parameters'," in migrate_set_parameter_str()
432 who, "{ 'execute': 'query-migrate-parameters' }"); in migrate_get_parameter_bool()
451 "{ 'execute': 'migrate-set-parameters'," in migrate_set_parameter_bool()
460 migrate_set_parameter_int(who, "max-bandwidth", 3 * 1000 * 1000); in migrate_ensure_non_converge()
461 migrate_set_parameter_int(who, "downtime-limit", 1); in migrate_ensure_non_converge()
467 migrate_set_parameter_int(who, "max-bandwidth", 1 * 1000 * 1000 * 1000); in migrate_ensure_converge()
468 migrate_set_parameter_int(who, "downtime-limit", 30 * 1000); in migrate_ensure_converge()
490 * Before migration starts, we write a 64-bit magic marker
494 * proof that start_address -> MAGIC_OFFSET_BASE has been
499 * is proof that start_address -> MAGIC_OFFSET_BASE
564 qtest_qmp_assert_success(who, "{ 'execute': 'migrate-pause' }"); in migrate_pause()
570 "{ 'execute': 'migrate-continue'," in migrate_continue()
578 "{ 'execute': 'migrate-recover', " in migrate_recover()
579 " 'id': 'recover-cmd', " in migrate_recover()
591 qtest_qmp_assert_success(from, "{ 'execute': 'migrate-start-postcopy' }"); in migrate_postcopy_start()
628 * before QEMU has terminated (unless it self-terminated
654 * Optional: JSON-formatted list of src QEMU URIs. If a port is
678 * that the dst QEMU is expected to quit with non-zero exit status
701 * reason to be tested live-only. For each of the new test cases for
731 if (args->use_shmem) { in test_migrate_start()
734 return -1; in test_migrate_start()
740 bootfile_create(tmpfs, args->suspend_me); in test_migrate_start()
741 src_state.suspend_me = args->suspend_me; in test_migrate_start()
752 "-drive if=none,id=d0,file=%s,format=raw " in test_migrate_start()
753 "-device ide-hd,drive=d0,secs=1,cyls=1,heads=1", bootpath); in test_migrate_start()
758 machine_alias = "s390-ccw-virtio"; in test_migrate_start()
759 arch_opts = g_strdup_printf("-bios %s", bootpath); in test_migrate_start()
769 "-nodefaults -machine " PSERIES_DEFAULT_CAPABILITIES " " in test_migrate_start()
770 "-bios %s", bootpath); in test_migrate_start()
774 machine_opts = "gic-version=3"; in test_migrate_start()
775 arch_opts = g_strdup_printf("-cpu max -kernel %s", bootpath); in test_migrate_start()
782 if (!getenv("QTEST_LOG") && args->hide_stderr) { in test_migrate_start()
797 if (args->use_shmem) { in test_migrate_start()
798 shmem_path = g_strdup_printf("/dev/shm/qemu-%d", getpid()); in test_migrate_start()
800 "-object memory-backend-file,id=mem0,size=%s" in test_migrate_start()
801 ",mem-path=%s,share=on -numa node,memdev=mem0", in test_migrate_start()
805 if (args->use_dirty_ring) { in test_migrate_start()
806 kvm_opts = ",dirty-ring-size=4096"; in test_migrate_start()
812 return -1; in test_migrate_start()
820 cmd_source = g_strdup_printf("-accel kvm%s -accel tcg " in test_migrate_start()
821 "-machine %s,%s " in test_migrate_start()
822 "-name source,debug-threads=on " in test_migrate_start()
823 "-m %s " in test_migrate_start()
824 "-serial file:%s/src_serial " in test_migrate_start()
832 args->opts_source ? args->opts_source : "", in test_migrate_start()
834 if (!args->only_target) { in test_migrate_start()
841 cmd_target = g_strdup_printf("-accel kvm%s -accel tcg " in test_migrate_start()
842 "-machine %s,%s " in test_migrate_start()
843 "-name target,debug-threads=on " in test_migrate_start()
844 "-m %s " in test_migrate_start()
845 "-serial file:%s/dest_serial " in test_migrate_start()
846 "-incoming %s " in test_migrate_start()
854 args->opts_target ? args->opts_target : "", in test_migrate_start()
865 if (args->use_shmem) { in test_migrate_start()
929 data->workdir = g_strdup_printf("%s/tlscredspsk0", tmpfs); in test_migrate_tls_psk_start_common()
930 data->pskfile = g_strdup_printf("%s/%s", data->workdir, in test_migrate_tls_psk_start_common()
932 g_mkdir_with_parents(data->workdir, 0700); in test_migrate_tls_psk_start_common()
933 test_tls_psk_init(data->pskfile); in test_migrate_tls_psk_start_common()
936 data->workdiralt = g_strdup_printf("%s/tlscredspskalt0", tmpfs); in test_migrate_tls_psk_start_common()
937 data->pskfilealt = g_strdup_printf("%s/%s", data->workdiralt, in test_migrate_tls_psk_start_common()
939 g_mkdir_with_parents(data->workdiralt, 0700); in test_migrate_tls_psk_start_common()
940 test_tls_psk_init_alt(data->pskfilealt); in test_migrate_tls_psk_start_common()
944 "{ 'execute': 'object-add'," in test_migrate_tls_psk_start_common()
945 " 'arguments': { 'qom-type': 'tls-creds-psk'," in test_migrate_tls_psk_start_common()
950 data->workdir); in test_migrate_tls_psk_start_common()
953 "{ 'execute': 'object-add'," in test_migrate_tls_psk_start_common()
954 " 'arguments': { 'qom-type': 'tls-creds-psk'," in test_migrate_tls_psk_start_common()
958 mismatch ? data->workdiralt : data->workdir); in test_migrate_tls_psk_start_common()
960 migrate_set_parameter_str(from, "tls-creds", "tlscredspsk0"); in test_migrate_tls_psk_start_common()
961 migrate_set_parameter_str(to, "tls-creds", "tlscredspsk0"); in test_migrate_tls_psk_start_common()
987 test_tls_psk_cleanup(data->pskfile); in test_migrate_tls_psk_finish()
988 if (data->pskfilealt) { in test_migrate_tls_psk_finish()
989 test_tls_psk_cleanup(data->pskfilealt); in test_migrate_tls_psk_finish()
991 rmdir(data->workdir); in test_migrate_tls_psk_finish()
992 if (data->workdiralt) { in test_migrate_tls_psk_finish()
993 rmdir(data->workdiralt); in test_migrate_tls_psk_finish()
996 g_free(data->workdiralt); in test_migrate_tls_psk_finish()
997 g_free(data->pskfilealt); in test_migrate_tls_psk_finish()
998 g_free(data->workdir); in test_migrate_tls_psk_finish()
999 g_free(data->pskfile); in test_migrate_tls_psk_finish()
1030 data->workdir = g_strdup_printf("%s/tlscredsx5090", tmpfs); in test_migrate_tls_x509_start_common()
1031 data->keyfile = g_strdup_printf("%s/key.pem", data->workdir); in test_migrate_tls_x509_start_common()
1033 data->cacert = g_strdup_printf("%s/ca-cert.pem", data->workdir); in test_migrate_tls_x509_start_common()
1034 data->serverkey = g_strdup_printf("%s/server-key.pem", data->workdir); in test_migrate_tls_x509_start_common()
1035 data->servercert = g_strdup_printf("%s/server-cert.pem", data->workdir); in test_migrate_tls_x509_start_common()
1036 if (args->clientcert) { in test_migrate_tls_x509_start_common()
1037 data->clientkey = g_strdup_printf("%s/client-key.pem", data->workdir); in test_migrate_tls_x509_start_common()
1038 data->clientcert = g_strdup_printf("%s/client-cert.pem", data->workdir); in test_migrate_tls_x509_start_common()
1041 g_mkdir_with_parents(data->workdir, 0700); in test_migrate_tls_x509_start_common()
1043 test_tls_init(data->keyfile); in test_migrate_tls_x509_start_common()
1045 g_assert(link(data->keyfile, data->serverkey) == 0); in test_migrate_tls_x509_start_common()
1047 g_assert(CreateHardLink(data->serverkey, data->keyfile, NULL) != 0); in test_migrate_tls_x509_start_common()
1049 if (args->clientcert) { in test_migrate_tls_x509_start_common()
1051 g_assert(link(data->keyfile, data->clientkey) == 0); in test_migrate_tls_x509_start_common()
1053 g_assert(CreateHardLink(data->clientkey, data->keyfile, NULL) != 0); in test_migrate_tls_x509_start_common()
1057 TLS_ROOT_REQ_SIMPLE(cacertreq, data->cacert); in test_migrate_tls_x509_start_common()
1058 if (args->clientcert) { in test_migrate_tls_x509_start_common()
1060 args->hostileclient ? in test_migrate_tls_x509_start_common()
1063 data->clientcert); in test_migrate_tls_x509_start_common()
1068 data->servercert, in test_migrate_tls_x509_start_common()
1069 args->certhostname, in test_migrate_tls_x509_start_common()
1070 args->certipaddr); in test_migrate_tls_x509_start_common()
1075 "{ 'execute': 'object-add'," in test_migrate_tls_x509_start_common()
1076 " 'arguments': { 'qom-type': 'tls-creds-x509'," in test_migrate_tls_x509_start_common()
1080 " 'sanity-check': true," in test_migrate_tls_x509_start_common()
1081 " 'verify-peer': true} }", in test_migrate_tls_x509_start_common()
1082 data->workdir); in test_migrate_tls_x509_start_common()
1083 migrate_set_parameter_str(from, "tls-creds", "tlscredsx509client0"); in test_migrate_tls_x509_start_common()
1084 if (args->certhostname) { in test_migrate_tls_x509_start_common()
1085 migrate_set_parameter_str(from, "tls-hostname", args->certhostname); in test_migrate_tls_x509_start_common()
1089 "{ 'execute': 'object-add'," in test_migrate_tls_x509_start_common()
1090 " 'arguments': { 'qom-type': 'tls-creds-x509'," in test_migrate_tls_x509_start_common()
1094 " 'sanity-check': true," in test_migrate_tls_x509_start_common()
1095 " 'verify-peer': %i} }", in test_migrate_tls_x509_start_common()
1096 data->workdir, args->verifyclient); in test_migrate_tls_x509_start_common()
1097 migrate_set_parameter_str(to, "tls-creds", "tlscredsx509server0"); in test_migrate_tls_x509_start_common()
1099 if (args->authzclient) { in test_migrate_tls_x509_start_common()
1101 "{ 'execute': 'object-add'," in test_migrate_tls_x509_start_common()
1102 " 'arguments': { 'qom-type': 'authz-simple'," in test_migrate_tls_x509_start_common()
1106 migrate_set_parameter_str(to, "tls-authz", "tlsauthz0"); in test_migrate_tls_x509_start_common()
1225 test_tls_cleanup(data->keyfile); in test_migrate_tls_x509_finish()
1226 g_free(data->keyfile); in test_migrate_tls_x509_finish()
1228 unlink(data->cacert); in test_migrate_tls_x509_finish()
1229 g_free(data->cacert); in test_migrate_tls_x509_finish()
1230 unlink(data->servercert); in test_migrate_tls_x509_finish()
1231 g_free(data->servercert); in test_migrate_tls_x509_finish()
1232 unlink(data->serverkey); in test_migrate_tls_x509_finish()
1233 g_free(data->serverkey); in test_migrate_tls_x509_finish()
1235 if (data->clientcert) { in test_migrate_tls_x509_finish()
1236 unlink(data->clientcert); in test_migrate_tls_x509_finish()
1237 g_free(data->clientcert); in test_migrate_tls_x509_finish()
1239 if (data->clientkey) { in test_migrate_tls_x509_finish()
1240 unlink(data->clientkey); in test_migrate_tls_x509_finish()
1241 g_free(data->clientkey); in test_migrate_tls_x509_finish()
1244 rmdir(data->workdir); in test_migrate_tls_x509_finish()
1245 g_free(data->workdir); in test_migrate_tls_x509_finish()
1258 if (test_migrate_start(&from, &to, "defer", &args->start)) { in migrate_postcopy_prepare()
1259 return -1; in migrate_postcopy_prepare()
1262 if (args->start_hook) { in migrate_postcopy_prepare()
1263 args->postcopy_data = args->start_hook(from, to); in migrate_postcopy_prepare()
1266 migrate_set_capability(from, "postcopy-ram", true); in migrate_postcopy_prepare()
1267 migrate_set_capability(to, "postcopy-ram", true); in migrate_postcopy_prepare()
1268 migrate_set_capability(to, "postcopy-blocktime", true); in migrate_postcopy_prepare()
1270 if (args->postcopy_preempt) { in migrate_postcopy_prepare()
1271 migrate_set_capability(from, "postcopy-preempt", true); in migrate_postcopy_prepare()
1272 migrate_set_capability(to, "postcopy-preempt", true); in migrate_postcopy_prepare()
1278 qtest_qmp_assert_success(to, "{ 'execute': 'migrate-incoming'," in migrate_postcopy_prepare()
1280 " 'channels': [ { 'channel-type': 'main'," in migrate_postcopy_prepare()
1305 if (args->start.suspend_me) { in migrate_postcopy_complete()
1317 if (args->finish_hook) { in migrate_postcopy_complete()
1318 args->finish_hook(from, to, args->postcopy_data); in migrate_postcopy_complete()
1319 args->postcopy_data = NULL; in migrate_postcopy_complete()
1416 " 'arguments': { 'fdname': 'fd-mig' }}"); in postcopy_recover_fail()
1419 " 'arguments': { 'fdname': 'fd-mig' }}"); in postcopy_recover_fail()
1428 * rely on an pre-existing G_IO_IN event, so it will always trigger the in postcopy_recover_fail()
1444 migrate_recover(to, "fd:fd-mig"); in postcopy_recover_fail()
1445 migrate_qmp(from, to, "fd:fd-mig", NULL, "{'resume': true}"); in postcopy_recover_fail()
1451 migration_event_wait(from, "postcopy-recover-setup"); in postcopy_recover_fail()
1460 migration_event_wait(from, "postcopy-paused"); in postcopy_recover_fail()
1465 * kicking them out using migrate-pause. in postcopy_recover_fail()
1470 migration_event_wait(from, "postcopy-recover"); in postcopy_recover_fail()
1471 wait_for_postcopy_status(from, "postcopy-recover"); in postcopy_recover_fail()
1481 wait_for_postcopy_status(from, "postcopy-paused"); in postcopy_recover_fail()
1482 wait_for_postcopy_status(to, "postcopy-recover"); in postcopy_recover_fail()
1491 wait_for_postcopy_status(to, "postcopy-paused"); in postcopy_recover_fail()
1509 args->start.hide_stderr = true; in test_postcopy_recovery_common()
1516 migrate_set_parameter_int(from, "max-postcopy-bandwidth", 4096); in test_postcopy_recovery_common()
1523 * migrate-pause command during a postcopy in test_postcopy_recovery_common()
1525 wait_for_migration_status(from, "postcopy-active", NULL); in test_postcopy_recovery_common()
1534 * Wait for destination side to reach postcopy-paused state. The in test_postcopy_recovery_common()
1535 * migrate-recover command can only succeed if destination machine in test_postcopy_recovery_common()
1538 wait_for_postcopy_status(to, "postcopy-paused"); in test_postcopy_recovery_common()
1539 wait_for_postcopy_status(from, "postcopy-paused"); in test_postcopy_recovery_common()
1541 if (args->postcopy_recovery_fail_stage) { in test_postcopy_recovery_common()
1546 postcopy_recover_fail(from, to, args->postcopy_recovery_fail_stage); in test_postcopy_recovery_common()
1555 uri = g_strdup_printf("unix:%s/migsocket-recover", tmpfs); in test_postcopy_recovery_common()
1565 migrate_set_parameter_int(from, "max-postcopy-bandwidth", 0); in test_postcopy_recovery_common()
1650 .opts_source = "-uuid 11111111-1111-1111-1111-111111111111", in test_analyze_script()
1673 migrate_set_capability(from, "validate-uuid", true); in test_analyze_script()
1674 migrate_set_capability(from, "x-ignore-shared", true); in test_analyze_script()
1687 execl(python, python, ANALYZE_SCRIPT, "-f", file, NULL); in test_analyze_script()
1706 if (test_migrate_start(&from, &to, args->listen_uri, &args->start)) { in test_precopy_common()
1710 if (args->start_hook) { in test_precopy_common()
1711 data_hook = args->start_hook(from, to); in test_precopy_common()
1715 if (args->result == MIG_TEST_SUCCEED) { in test_precopy_common()
1720 if (args->live) { in test_precopy_common()
1725 * Testing non-live migration, we allow it to run at in test_precopy_common()
1730 if (args->result == MIG_TEST_SUCCEED) { in test_precopy_common()
1737 if (args->result == MIG_TEST_QMP_ERROR) { in test_precopy_common()
1738 migrate_qmp_fail(from, args->connect_uri, args->connect_channels, "{}"); in test_precopy_common()
1742 migrate_qmp(from, to, args->connect_uri, args->connect_channels, "{}"); in test_precopy_common()
1744 if (args->result != MIG_TEST_SUCCEED) { in test_precopy_common()
1745 bool allow_active = args->result == MIG_TEST_FAIL; in test_precopy_common()
1748 if (args->result == MIG_TEST_FAIL_DEST_QUIT_ERR) { in test_precopy_common()
1752 if (args->live) { in test_precopy_common()
1758 while (args->iterations > 1) { in test_precopy_common()
1760 args->iterations--; in test_precopy_common()
1767 * We do this first, as it has a timeout to stop us in test_precopy_common()
1788 if (args->start.suspend_me) { in test_precopy_common()
1797 if (args->finish_hook) { in test_precopy_common()
1798 args->finish_hook(from, to, data_hook); in test_precopy_common()
1801 test_migrate_end(from, to, args->result == MIG_TEST_SUCCEED); in test_precopy_common()
1842 if (test_migrate_start(&from, &to, args->listen_uri, &args->start)) { in test_file_common()
1851 g_assert_false(args->live); in test_file_common()
1853 if (g_strrstr(args->connect_uri, "offset=")) { in test_file_common()
1863 if (args->start_hook) { in test_file_common()
1864 data_hook = args->start_hook(from, to); in test_file_common()
1875 if (args->result == MIG_TEST_QMP_ERROR) { in test_file_common()
1876 migrate_qmp_fail(from, args->connect_uri, NULL, "{}"); in test_file_common()
1880 migrate_qmp(from, to, args->connect_uri, NULL, "{}"); in test_file_common()
1887 migrate_incoming_qmp(to, args->connect_uri, "{}"); in test_file_common()
1902 if (args->finish_hook) { in test_file_common()
1903 args->finish_hook(from, to, data_hook); in test_file_common()
1906 test_migrate_end(from, to, args->result == MIG_TEST_SUCCEED); in test_file_common()
1917 * get-dirty-log dirty tracking. in test_precopy_unix_plain()
1965 * rather than get-dirty-log. in test_precopy_unix_dirty_ring()
2034 migrate_set_capability(from, "x-ignore-shared", true);
2035 migrate_set_capability(to, "x-ignore-shared", true);
2062 migrate_set_parameter_int(from, "xbzrle-cache-size", 33554432); in test_migrate_xbzrle_start()
2108 /* only secondary channels can use direct-io */ in fdset_add_fds()
2115 assert(fd != -1); in fdset_add_fds()
2117 qtest_qmp_fds_assert_success(qts, &fd, 1, "{'execute': 'add-fd', " in fdset_add_fds()
2118 "'arguments': {'fdset-id': 1}}"); in fdset_add_fds()
2176 migrate_set_parameter_str(from, "mode", "cpr-reboot"); in test_mode_reboot_start()
2177 migrate_set_parameter_str(to, "mode", "cpr-reboot"); in test_mode_reboot_start()
2179 migrate_set_capability(from, "x-ignore-shared", true); in test_mode_reboot_start()
2180 migrate_set_capability(to, "x-ignore-shared", true); in test_mode_reboot_start()
2187 migrate_set_capability(from, "mapped-ram", true); in migrate_mapped_ram_start()
2188 migrate_set_capability(to, "mapped-ram", true); in migrate_mapped_ram_start()
2237 migrate_set_parameter_int(from, "multifd-channels", 4); in migrate_multifd_mapped_ram_start()
2238 migrate_set_parameter_int(to, "multifd-channels", 4); in migrate_multifd_mapped_ram_start()
2276 migrate_set_parameter_bool(from, "direct-io", true); in multifd_mapped_ram_dio_start()
2277 migrate_set_parameter_bool(to, "direct-io", true); in multifd_mapped_ram_dio_start()
2311 qtest_qmp_assert_success(from, "{'execute': 'remove-fd', " in multifd_mapped_ram_fdset_end()
2312 "'arguments': { 'fdset-id': 1}}"); in multifd_mapped_ram_fdset_end()
2318 resp = qtest_qmp(from, "{'execute': 'query-fdsets', " in multifd_mapped_ram_fdset_end()
2334 migrate_set_parameter_bool(from, "direct-io", true); in multifd_mapped_ram_fdset_dio()
2335 migrate_set_parameter_bool(to, "direct-io", true); in multifd_mapped_ram_fdset_dio()
2398 migrate_set_capability(from, "return-path", true); in test_migrate_switchover_ack_start()
2399 migrate_set_capability(to, "return-path", true); in test_migrate_switchover_ack_start()
2401 migrate_set_capability(from, "switchover-ack", true); in test_migrate_switchover_ack_start()
2402 migrate_set_capability(to, "switchover-ack", true); in test_migrate_switchover_ack_start()
2555 " 'arguments': { 'fdname': 'fd-mig' }}"); in test_migrate_fd_start_hook()
2559 migrate_incoming_qmp(to, "fd:fd-mig", "{}"); in test_migrate_fd_start_hook()
2564 " 'arguments': { 'fdname': 'fd-mig' }}"); in test_migrate_fd_start_hook()
2582 " 'arguments': { 'fdname': 'fd-mig' }}"); in test_migrate_fd_finish_hook()
2585 g_assert_cmpstr(error_desc, ==, "File descriptor named 'fd-mig' not found"); in test_migrate_fd_finish_hook()
2590 " 'arguments': { 'fdname': 'fd-mig' }}"); in test_migrate_fd_finish_hook()
2593 g_assert_cmpstr(error_desc, ==, "File descriptor named 'fd-mig' not found"); in test_migrate_fd_finish_hook()
2601 .connect_uri = "fd:fd-mig", in test_migrate_precopy_fd_socket()
2616 assert(fds[0] != -1); in migrate_precopy_fd_file_start()
2619 assert(fds[1] != -1); in migrate_precopy_fd_file_start()
2624 " 'arguments': { 'fdname': 'fd-mig' }}"); in migrate_precopy_fd_file_start()
2628 " 'arguments': { 'fdname': 'fd-mig' }}"); in migrate_precopy_fd_file_start()
2640 .connect_uri = "fd:fd-mig", in test_migrate_precopy_fd_file()
2659 * migration is not interesting for us here. Thus, set huge downtime for in do_test_validate_uuid()
2662 migrate_set_parameter_int(from, "downtime-limit", 1000000); in do_test_validate_uuid()
2663 migrate_set_capability(from, "validate-uuid", true); in do_test_validate_uuid()
2683 .opts_source = "-uuid 11111111-1111-1111-1111-111111111111", in test_validate_uuid()
2684 .opts_target = "-uuid 11111111-1111-1111-1111-111111111111", in test_validate_uuid()
2693 .opts_source = "-uuid 11111111-1111-1111-1111-111111111111", in test_validate_uuid_error()
2694 .opts_target = "-uuid 22222222-2222-2222-2222-222222222222", in test_validate_uuid_error()
2704 .opts_target = "-uuid 22222222-2222-2222-2222-222222222222", in test_validate_uuid_src_not_set()
2714 .opts_source = "-uuid 11111111-1111-1111-1111-111111111111", in test_validate_uuid_dst_not_set()
2725 if (test_migrate_start(&from, &to, args->listen_uri, &args->start)) { in do_test_validate_uri_channel()
2736 migrate_qmp_fail(from, args->connect_uri, args->connect_channels, "{}"); in do_test_validate_uri_channel()
2748 .connect_channels = ("[ { ""'channel-type': 'main'," in test_validate_uri_channels_both_set()
2775 * - 3 iterations without auto_converge enabled
2776 * - 3 iterations with pct = 5
2777 * - 3 iterations with pct = 30
2778 * - 3 iterations with pct = 55
2779 * - 3 iterations with pct = 80
2780 * - 3 iterations with pct = 95 (max(95, 80 + 25))
2805 migrate_set_capability(from, "auto-converge", true); in test_migrate_auto_converge()
2806 migrate_set_parameter_int(from, "cpu-throttle-initial", init_pct); in test_migrate_auto_converge()
2807 migrate_set_parameter_int(from, "cpu-throttle-increment", inc_pct); in test_migrate_auto_converge()
2808 migrate_set_parameter_int(from, "max-cpu-throttle", max_pct); in test_migrate_auto_converge()
2817 migrate_set_capability(from, "pause-before-switchover", true); in test_migrate_auto_converge()
2827 percentage = read_migrate_property_int(from, "cpu-throttle-percentage"); in test_migrate_auto_converge()
2850 * Note that migrate_ensure_non_converge set the max-bandwidth to 3MB/s, in test_migrate_auto_converge()
2855 while (--max_try_count) { in test_migrate_auto_converge()
2870 * Wait for pre-switchover status to check last throttle percentage in test_migrate_auto_converge()
2873 wait_for_migration_status(from, "pre-switchover", NULL); in test_migrate_auto_converge()
2876 percentage = read_migrate_property_int(from, "cpu-throttle-percentage"); in test_migrate_auto_converge()
2878 migrate_continue(from, "pre-switchover"); in test_migrate_auto_converge()
2893 migrate_set_parameter_int(from, "multifd-channels", 16); in test_migrate_precopy_tcp_multifd_start_common()
2894 migrate_set_parameter_int(to, "multifd-channels", 16); in test_migrate_precopy_tcp_multifd_start_common()
2896 migrate_set_parameter_str(from, "multifd-compression", method); in test_migrate_precopy_tcp_multifd_start_common()
2897 migrate_set_parameter_str(to, "multifd-compression", method); in test_migrate_precopy_tcp_multifd_start_common()
2920 migrate_set_parameter_str(from, "zero-page-detection", "legacy"); in test_migrate_precopy_tcp_multifd_start_zero_page_legacy()
2929 migrate_set_parameter_str(from, "zero-page-detection", "none"); in test_migration_precopy_tcp_multifd_start_no_zero_page()
2941 migrate_set_parameter_int(from, "multifd-zlib-level", 2); in test_migrate_precopy_tcp_multifd_zlib_start()
2942 migrate_set_parameter_int(to, "multifd-zlib-level", 2); in test_migrate_precopy_tcp_multifd_zlib_start()
2952 migrate_set_parameter_int(from, "multifd-zstd-level", 2); in test_migrate_precopy_tcp_multifd_zstd_start()
2953 migrate_set_parameter_int(to, "multifd-zstd-level", 2); in test_migrate_precopy_tcp_multifd_zstd_start()
2964 migrate_set_parameter_int(from, "multifd-qatzip-level", 2); in test_migrate_precopy_tcp_multifd_qatzip_start()
2965 migrate_set_parameter_int(to, "multifd-qatzip-level", 2); in test_migrate_precopy_tcp_multifd_qatzip_start()
3039 .connect_channels = ("[ { 'channel-type': 'main'," in test_multifd_tcp_channels_none()
3208 * This has different behaviour to the non-multifd case. in test_multifd_tcp_tls_x509_mismatch_host()
3210 * In non-multifd case when client aborts due to mismatched in test_multifd_tcp_tls_x509_mismatch_host()
3283 migrate_set_parameter_int(from, "multifd-channels", 16); in test_multifd_tcp_cancel()
3284 migrate_set_parameter_int(to, "multifd-channels", 16); in test_multifd_tcp_cancel()
3324 migrate_set_parameter_int(to2, "multifd-channels", 16); in test_multifd_tcp_cancel()
3350 "{ 'execute': 'calc-dirty-rate'," in calc_dirty_rate()
3352 "'calc-time': %" PRIu64 "," in calc_dirty_rate()
3353 "'mode': 'dirty-ring' }}", in calc_dirty_rate()
3360 "{ 'execute': 'query-dirty-rate' }"); in query_dirty_rate()
3366 "{ 'execute': 'set-vcpu-dirty-limit'," in dirtylimit_set_all()
3368 "'dirty-rate': %" PRIu64 " } }", in dirtylimit_set_all()
3375 "{ 'execute': 'cancel-vcpu-dirty-limit' }"); in cancel_vcpu_dirty_limit()
3382 rsp = qtest_qmp(who, "{ 'execute': 'query-vcpu-dirty-limit' }"); in query_vcpu_dirty_limit()
3412 while (!calc_dirtyrate_ready(who) && max_try_count--) { in wait_for_calc_dirtyrate_complete()
3417 * Set the timeout with 10 s(max_try_count * 1000us), in wait_for_calc_dirtyrate_complete()
3439 rates = qdict_get_qlist(rsp_return, "vcpu-dirty-rate"); in get_dirty_rate()
3448 dirtyrate = qdict_get_try_int(rate, "dirty-rate", -1); in get_dirty_rate()
3474 dirtyrate = qdict_get_try_int(rate, "limit-rate", -1); in get_limit_rate()
3486 cmd = g_strdup_printf("-accel kvm,dirty-ring-size=4096 " in dirtylimit_start_vm()
3487 "-name dirtylimit-test,debug-threads=on " in dirtylimit_start_vm()
3488 "-m 150M -smp 1 " in dirtylimit_start_vm()
3489 "-serial file:%s/vm_serial " in dirtylimit_start_vm()
3490 "-drive file=%s,format=raw ", in dirtylimit_start_vm()
3537 * Check if set-vcpu-dirty-limit and query-vcpu-dirty-limit in test_vcpu_dirty_limit()
3550 while (--max_try_count) { in test_vcpu_dirty_limit()
3572 while (--max_try_count) { in test_vcpu_dirty_limit()
3592 const int64_t period, in migrate_dirty_limit_wait_showup() argument
3596 migrate_set_capability(from, "dirty-limit", true); in migrate_dirty_limit_wait_showup()
3599 migrate_set_parameter_int(from, "x-vcpu-dirty-limit-period", period); in migrate_dirty_limit_wait_showup()
3600 migrate_set_parameter_int(from, "vcpu-dirty-limit", value); in migrate_dirty_limit_wait_showup()
3606 migrate_set_capability(from, "pause-before-switchover", true); in migrate_dirty_limit_wait_showup()
3624 * wait pre-switchover event
3645 * We migrate through unix-socket (> 500Mb/s). in test_migrate_dirty_limit()
3671 /* Wait for dirty limit throttle begin */ in test_migrate_dirty_limit()
3676 "dirty-limit-throttle-time-per-round"); in test_migrate_dirty_limit()
3681 /* Now cancel migrate and wait for dirty limit throttle switch off */ in test_migrate_dirty_limit()
3685 /* Check if dirty limit throttle switched off, set timeout 1ms */ in test_migrate_dirty_limit()
3689 "dirty-limit-throttle-time-per-round"); in test_migrate_dirty_limit()
3692 } while (throttle_us_per_full != 0 && --max_try_count); in test_migrate_dirty_limit()
3714 /* Wait for dirty limit throttle begin */ in test_migrate_dirty_limit()
3719 "dirty-limit-throttle-time-per-round"); in test_migrate_dirty_limit()
3726 * query-vcpu-dirty-limit if dirty limit cap set in test_migrate_dirty_limit()
3731 migrate_set_parameter_int(from, "downtime-limit", downtime_limit); in test_migrate_dirty_limit()
3732 migrate_set_parameter_int(from, "max-bandwidth", max_bandwidth); in test_migrate_dirty_limit()
3735 * Wait for pre-switchover status to check if migration in test_migrate_dirty_limit()
3738 wait_for_migration_status(from, "pre-switchover", NULL); in test_migrate_dirty_limit()
3744 migrate_continue(from, "pre-switchover"); in test_migrate_dirty_limit()
3812 tmpfs = g_dir_make_tmp("migration-test-XXXXXX", &err); in main()
3815 g_get_tmp_dir(), err->message); in main()
3823 migration_test_add("/migration/analyze-script", test_analyze_script); in main()
3841 migration_test_add("/migration/postcopy/recovery/double-failures/handshake", in main()
3843 migration_test_add("/migration/postcopy/recovery/double-failures/reconnect", in main()
3876 migration_test_add("/migration/precopy/file/mapped-ram", in main()
3878 migration_test_add("/migration/precopy/file/mapped-ram/live", in main()
3881 migration_test_add("/migration/multifd/file/mapped-ram", in main()
3883 migration_test_add("/migration/multifd/file/mapped-ram/live", in main()
3886 migration_test_add("/migration/multifd/file/mapped-ram/dio", in main()
3890 migration_test_add("/migration/multifd/file/mapped-ram/fdset", in main()
3892 migration_test_add("/migration/multifd/file/mapped-ram/fdset/dio", in main()
3916 migration_test_add("/migration/precopy/unix/tls/x509/default-host", in main()
3918 migration_test_add("/migration/precopy/unix/tls/x509/override-host", in main()
3925 migration_test_add("/migration/precopy/tcp/plain/switchover-ack", in main()
3934 migration_test_add("/migration/precopy/tcp/tls/x509/default-host", in main()
3936 migration_test_add("/migration/precopy/tcp/tls/x509/override-host", in main()
3938 migration_test_add("/migration/precopy/tcp/tls/x509/mismatch-host", in main()
3940 migration_test_add("/migration/precopy/tcp/tls/x509/friendly-client", in main()
3942 migration_test_add("/migration/precopy/tcp/tls/x509/hostile-client", in main()
3944 migration_test_add("/migration/precopy/tcp/tls/x509/allow-anon-client", in main()
3946 migration_test_add("/migration/precopy/tcp/tls/x509/reject-anon-client", in main()
3985 migration_test_add("/migration/multifd/tcp/plain/zero-page/legacy", in main()
3987 migration_test_add("/migration/multifd/tcp/plain/zero-page/none", in main()
4015 migration_test_add("/migration/multifd/tcp/tls/x509/default-host", in main()
4017 migration_test_add("/migration/multifd/tcp/tls/x509/override-host", in main()
4019 migration_test_add("/migration/multifd/tcp/tls/x509/mismatch-host", in main()
4021 migration_test_add("/migration/multifd/tcp/tls/x509/allow-anon-client", in main()
4023 migration_test_add("/migration/multifd/tcp/tls/x509/reject-anon-client", in main()