1 /* 2 * QTest migration helpers 3 * 4 * Copyright (c) 2016-2018 Red Hat, Inc. and/or its affiliates 5 * based on the vhost-user-test.c that is: 6 * Copyright (c) 2014 Virtual Open Systems Sarl. 7 * 8 * This work is licensed under the terms of the GNU GPL, version 2 or later. 9 * See the COPYING file in the top-level directory. 10 * 11 */ 12 13 #ifndef MIGRATION_HELPERS_H 14 #define MIGRATION_HELPERS_H 15 16 #include "libqtest.h" 17 18 typedef struct QTestMigrationState { 19 bool stop_seen; 20 bool resume_seen; 21 } QTestMigrationState; 22 23 bool migrate_watch_for_events(QTestState *who, const char *name, 24 QDict *event, void *opaque); 25 26 G_GNUC_PRINTF(3, 4) 27 void migrate_qmp(QTestState *who, const char *uri, const char *fmt, ...); 28 29 G_GNUC_PRINTF(3, 4) 30 void migrate_incoming_qmp(QTestState *who, const char *uri, 31 const char *fmt, ...); 32 33 G_GNUC_PRINTF(3, 4) 34 void migrate_qmp_fail(QTestState *who, const char *uri, const char *fmt, ...); 35 36 void migrate_set_capability(QTestState *who, const char *capability, 37 bool value); 38 39 QDict *migrate_query(QTestState *who); 40 QDict *migrate_query_not_failed(QTestState *who); 41 42 void wait_for_migration_status(QTestState *who, 43 const char *goal, const char **ungoals); 44 45 void wait_for_migration_complete(QTestState *who); 46 47 void wait_for_migration_fail(QTestState *from, bool allow_active); 48 49 char *find_common_machine_version(const char *mtype, const char *var1, 50 const char *var2); 51 char *resolve_machine_version(const char *alias, const char *var1, 52 const char *var2); 53 #endif /* MIGRATION_HELPERS_H */ 54