qtest.h 776 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 "qemu-common.h"
  16. #if !defined(CONFIG_USER_ONLY)
  17. extern int qtest_allowed;
  18. extern const char *qtest_chrdev;
  19. extern const char *qtest_log;
  20. static inline bool qtest_enabled(void)
  21. {
  22. return qtest_allowed;
  23. }
  24. static inline int qtest_available(void)
  25. {
  26. return 1;
  27. }
  28. int qtest_init(void);
  29. #else
  30. static inline bool qtest_enabled(void)
  31. {
  32. return false;
  33. }
  34. static inline int qtest_available(void)
  35. {
  36. return 0;
  37. }
  38. static inline int qtest_init(void)
  39. {
  40. return 0;
  41. }
  42. #endif
  43. #endif