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 extern bool got_stop;
19 
20 #ifndef _WIN32
21 G_GNUC_PRINTF(3, 4)
22 QDict *wait_command_fd(QTestState *who, int fd, const char *command, ...);
23 #endif
24 
25 G_GNUC_PRINTF(2, 3)
26 QDict *wait_command(QTestState *who, const char *command, ...);
27 
28 G_GNUC_PRINTF(2, 3)
29 QDict *qmp_command(QTestState *who, const char *command, ...);
30 
31 G_GNUC_PRINTF(3, 4)
32 void migrate_qmp(QTestState *who, const char *uri, const char *fmt, ...);
33 
34 QDict *migrate_query(QTestState *who);
35 QDict *migrate_query_not_failed(QTestState *who);
36 
37 void wait_for_migration_status(QTestState *who,
38                                const char *goal, const char **ungoals);
39 
40 void wait_for_migration_complete(QTestState *who);
41 
42 void wait_for_migration_fail(QTestState *from, bool allow_active);
43 
44 #endif /* MIGRATION_HELPERS_H */
45