aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-01-15 13:17:47 +0000
committerPeter Maydell <peter.maydell@linaro.org>2018-01-15 13:17:47 +0000
commitf521eeee3bd060b460c99e605472b7e03967db43 (patch)
treef782ce0bb091b973fa82ef04a7afed9989129e1a /tests
parentfd06527b80c88c8dde1b35fdc692685b68d2fd93 (diff)
parent816306826a45f4d15352e32d157172af3a35899f (diff)
downloadqemu-f521eeee3bd060b460c99e605472b7e03967db43.zip
qemu-f521eeee3bd060b460c99e605472b7e03967db43.tar.gz
qemu-f521eeee3bd060b460c99e605472b7e03967db43.tar.bz2
Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20180115' into staging
migration/next for 20180115 # gpg: Signature made Mon 15 Jan 2018 11:51:00 GMT # gpg: using RSA key 0xF487EF185872D723 # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" # gpg: aka "Juan Quintela <quintela@trasno.org>" # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03 4B82 F487 EF18 5872 D723 * remotes/juanquintela/tags/migration/20180115: (27 commits) migration: remove notify in fd_error migration: remove some block_cleanup_parameters() migration: put the finish part into a new function migration: major cleanup for migrate iterations migration: cleanup stats update into function migration: use switch at the end of migration migration: introduce migrate_calculate_complete migration: introduce downtime_start migration: move vm_old_running into global state migration: split use of MigrationState.total_time migration: remove "enable_colo" var migration: qemu_savevm_state_cleanup() in cleanup migration: assert colo instead of check migration: finalize current_migration object migration: Guard ram_bytes_remaining against early call migration: add postcopy total blocktime into query-migrate migration: add blocktime calculation into migration-test migration: postcopy_blocktime documentation migration: calculate vCPU blocktime on dst side migration: add postcopy blocktime ctx into MigrationIncomingState ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/migration-test.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/migration-test.c b/tests/migration-test.c
index be598d3..9fd5dad 100644
--- a/tests/migration-test.c
+++ b/tests/migration-test.c
@@ -25,6 +25,7 @@
const unsigned start_address = 1024 * 1024;
const unsigned end_address = 100 * 1024 * 1024;
bool got_stop;
+static bool uffd_feature_thread_id;
#if defined(__linux__)
#include <sys/syscall.h>
@@ -54,6 +55,7 @@ static bool ufd_version_check(void)
g_test_message("Skipping test: UFFDIO_API failed");
return false;
}
+ uffd_feature_thread_id = api_struct.features & UFFD_FEATURE_THREAD_ID;
ioctl_mask = (__u64)1 << _UFFDIO_REGISTER |
(__u64)1 << _UFFDIO_UNREGISTER;
@@ -266,6 +268,16 @@ static uint64_t get_migration_pass(QTestState *who)
return result;
}
+static void read_blocktime(QTestState *who)
+{
+ QDict *rsp, *rsp_return;
+
+ rsp = wait_command(who, "{ 'execute': 'query-migrate' }");
+ rsp_return = qdict_get_qdict(rsp, "return");
+ g_assert(qdict_haskey(rsp_return, "postcopy-blocktime"));
+ QDECREF(rsp);
+}
+
static void wait_for_migration_complete(QTestState *who)
{
QDict *rsp, *rsp_return;
@@ -358,13 +370,14 @@ static void migrate_check_parameter(QTestState *who, const char *parameter,
const char *value)
{
QDict *rsp, *rsp_return;
- const char *result;
+ char *result;
rsp = wait_command(who, "{ 'execute': 'query-migrate-parameters' }");
rsp_return = qdict_get_qdict(rsp, "return");
result = g_strdup_printf("%" PRId64,
qdict_get_try_int(rsp_return, parameter, -1));
g_assert_cmpstr(result, ==, value);
+ g_free(result);
QDECREF(rsp);
}
@@ -524,6 +537,7 @@ static void test_migrate(void)
migrate_set_capability(from, "postcopy-ram", "true");
migrate_set_capability(to, "postcopy-ram", "true");
+ migrate_set_capability(to, "postcopy-blocktime", "true");
/* We want to pick a speed slow enough that the test completes
* quickly, but that it doesn't complete precopy even on a slow
@@ -552,6 +566,9 @@ static void test_migrate(void)
wait_for_serial("dest_serial");
wait_for_migration_complete(from);
+ if (uffd_feature_thread_id) {
+ read_blocktime(to);
+ }
g_free(uri);
test_migrate_end(from, to);