You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

monitor.h 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef MONITOR_H
  2. #define MONITOR_H
  3. #include "qemu-common.h"
  4. #include "block/block.h"
  5. #include "qapi/qapi-types-misc.h"
  6. #include "qemu/readline.h"
  7. extern __thread Monitor *cur_mon;
  8. /* flags for monitor_init */
  9. /* 0x01 unused */
  10. #define MONITOR_USE_READLINE 0x02
  11. #define MONITOR_USE_CONTROL 0x04
  12. #define MONITOR_USE_PRETTY 0x08
  13. #define QMP_REQ_QUEUE_LEN_MAX 8
  14. bool monitor_cur_is_qmp(void);
  15. void monitor_init_globals(void);
  16. void monitor_init(Chardev *chr, int flags);
  17. void monitor_cleanup(void);
  18. int monitor_suspend(Monitor *mon);
  19. void monitor_resume(Monitor *mon);
  20. int monitor_get_fd(Monitor *mon, const char *fdname, Error **errp);
  21. int monitor_fd_param(Monitor *mon, const char *fdname, Error **errp);
  22. int monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
  23. GCC_FMT_ATTR(2, 0);
  24. int monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
  25. int monitor_fprintf(FILE *stream, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
  26. void monitor_flush(Monitor *mon);
  27. int monitor_set_cpu(int cpu_index);
  28. int monitor_get_cpu_index(void);
  29. void monitor_read_command(Monitor *mon, int show_prompt);
  30. int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func,
  31. void *opaque);
  32. AddfdInfo *monitor_fdset_add_fd(int fd, bool has_fdset_id, int64_t fdset_id,
  33. bool has_opaque, const char *opaque,
  34. Error **errp);
  35. int monitor_fdset_get_fd(int64_t fdset_id, int flags);
  36. int monitor_fdset_dup_fd_add(int64_t fdset_id, int dup_fd);
  37. void monitor_fdset_dup_fd_remove(int dup_fd);
  38. int monitor_fdset_dup_fd_find(int dup_fd);
  39. #endif /* MONITOR_H */