qtest.h 895 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Test Server
  3. *
  4. * Copyright IBM, Corp. 2011
  5. *
  6. * Authors:
  7. * Anthony Liguori <aliguori@us.ibm.com>
  8. *
  9. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  10. * See the COPYING file in the top-level directory.
  11. *
  12. */
  13. #ifndef QTEST_H
  14. #define QTEST_H
  15. #include "chardev/char.h"
  16. extern bool qtest_allowed;
  17. static inline bool qtest_enabled(void)
  18. {
  19. return qtest_allowed;
  20. }
  21. #ifndef CONFIG_USER_ONLY
  22. void G_GNUC_PRINTF(2, 3) qtest_sendf(CharBackend *chr, const char *fmt, ...);
  23. void qtest_set_command_cb(bool (*pc_cb)(CharBackend *chr, gchar **words));
  24. bool qtest_driver(void);
  25. void qtest_server_init(const char *qtest_chrdev, const char *qtest_log, Error **errp);
  26. void qtest_server_set_send_handler(void (*send)(void *, const char *),
  27. void *opaque);
  28. void qtest_server_inproc_recv(void *opaque, const char *buf);
  29. #endif
  30. #endif