1c7f0f3b1SAnthony Liguori /* 2c7f0f3b1SAnthony Liguori * Test Server 3c7f0f3b1SAnthony Liguori * 4c7f0f3b1SAnthony Liguori * Copyright IBM, Corp. 2011 5c7f0f3b1SAnthony Liguori * 6c7f0f3b1SAnthony Liguori * Authors: 7c7f0f3b1SAnthony Liguori * Anthony Liguori <aliguori@us.ibm.com> 8c7f0f3b1SAnthony Liguori * 9c7f0f3b1SAnthony Liguori * This work is licensed under the terms of the GNU GPL, version 2 or later. 10c7f0f3b1SAnthony Liguori * See the COPYING file in the top-level directory. 11c7f0f3b1SAnthony Liguori * 12c7f0f3b1SAnthony Liguori */ 13c7f0f3b1SAnthony Liguori 14c7f0f3b1SAnthony Liguori #ifndef QTEST_H 15c7f0f3b1SAnthony Liguori #define QTEST_H 16c7f0f3b1SAnthony Liguori 17*c7a6bf5dSThomas Huth #include "chardev/char.h" 18c7f0f3b1SAnthony Liguori 19d5286af5Sliguang extern bool qtest_allowed; 20c7f0f3b1SAnthony Liguori 21c7f0f3b1SAnthony Liguori static inline bool qtest_enabled(void) 22c7f0f3b1SAnthony Liguori { 23c7f0f3b1SAnthony Liguori return qtest_allowed; 24c7f0f3b1SAnthony Liguori } 25c7f0f3b1SAnthony Liguori 26*c7a6bf5dSThomas Huth void qtest_send_prefix(CharBackend *chr); 27*c7a6bf5dSThomas Huth void G_GNUC_PRINTF(2, 3) qtest_sendf(CharBackend *chr, const char *fmt, ...); 28*c7a6bf5dSThomas Huth void qtest_set_command_cb(bool (*pc_cb)(CharBackend *chr, gchar **words)); 29b3be57c3SMichael S. Tsirkin bool qtest_driver(void); 30b3be57c3SMichael S. Tsirkin 312b8985f1SOleinik, Alexander void qtest_server_init(const char *qtest_chrdev, const char *qtest_log, Error **errp); 32d4fce24fSPaolo Bonzini 33e731d083SAlexander Bulekov void qtest_server_set_send_handler(void (*send)(void *, const char *), 34e731d083SAlexander Bulekov void *opaque); 350bd9aef8SAlexander Bulekov void qtest_server_inproc_recv(void *opaque, const char *buf); 36e731d083SAlexander Bulekov 37740b1759SClaudio Fontana int64_t qtest_get_virtual_clock(void); 38740b1759SClaudio Fontana 39c7f0f3b1SAnthony Liguori #endif 40