blob: db0684de48b21198ae8775bb726c70a0ebb7f0ba [file] [log] [blame]
Marc-André Lureaud77799c2019-12-16 14:59:44 +04001/*
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 */
Markus Armbruster9c092802022-05-06 15:49:09 +020012
13#ifndef MIGRATION_HELPERS_H
14#define MIGRATION_HELPERS_H
Marc-André Lureaud77799c2019-12-16 14:59:44 +040015
Marc-André Lureau907b5102022-03-30 13:39:05 +040016#include "libqtest.h"
Marc-André Lureaud77799c2019-12-16 14:59:44 +040017
18extern bool got_stop;
19
Bin Mengd7613ee2022-08-24 17:39:59 +080020#ifndef _WIN32
Marc-André Lureau9edc6312022-02-20 20:39:25 +040021G_GNUC_PRINTF(3, 4)
Marc-André Lureaud77799c2019-12-16 14:59:44 +040022QDict *wait_command_fd(QTestState *who, int fd, const char *command, ...);
Bin Mengd7613ee2022-08-24 17:39:59 +080023#endif
Marc-André Lureaud77799c2019-12-16 14:59:44 +040024
Marc-André Lureau9edc6312022-02-20 20:39:25 +040025G_GNUC_PRINTF(2, 3)
Marc-André Lureaud77799c2019-12-16 14:59:44 +040026QDict *wait_command(QTestState *who, const char *command, ...);
27
Hyman Huang(黄勇)8aff6f52022-06-26 01:38:37 +080028QDict *qmp_command(QTestState *who, const char *command, ...);
29
Marc-André Lureau9edc6312022-02-20 20:39:25 +040030G_GNUC_PRINTF(3, 4)
Marc-André Lureaud77799c2019-12-16 14:59:44 +040031void migrate_qmp(QTestState *who, const char *uri, const char *fmt, ...);
32
33QDict *migrate_query(QTestState *who);
Daniel P. Berrangéfd3540a2022-04-26 17:00:48 +010034QDict *migrate_query_not_failed(QTestState *who);
Marc-André Lureaud77799c2019-12-16 14:59:44 +040035
36void wait_for_migration_status(QTestState *who,
37 const char *goal, const char **ungoals);
38
39void wait_for_migration_complete(QTestState *who);
40
41void wait_for_migration_fail(QTestState *from, bool allow_active);
42
Markus Armbruster9c092802022-05-06 15:49:09 +020043#endif /* MIGRATION_HELPERS_H */