guest-agent-core.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * QEMU Guest Agent core declarations
  3. *
  4. * Copyright IBM Corp. 2011
  5. *
  6. * Authors:
  7. * Adam Litke <aglitke@linux.vnet.ibm.com>
  8. * Michael Roth <mdroth@linux.vnet.ibm.com>
  9. *
  10. * This work is licensed under the terms of the GNU GPL, version 2 or later.
  11. * See the COPYING file in the top-level directory.
  12. */
  13. #ifndef GUEST_AGENT_CORE_H
  14. #define GUEST_AGENT_CORE_H
  15. #include "qapi/qmp/dispatch.h"
  16. #include "qga-qapi-types.h"
  17. #define QGA_READ_COUNT_DEFAULT 4096
  18. typedef struct GAState GAState;
  19. typedef struct GACommandState GACommandState;
  20. extern GAState *ga_state;
  21. extern QmpCommandList ga_commands;
  22. GList *ga_command_init_blockedrpcs(GList *blockedrpcs);
  23. void ga_command_state_init(GAState *s, GACommandState *cs);
  24. void ga_command_state_add(GACommandState *cs,
  25. void (*init)(void),
  26. void (*cleanup)(void));
  27. void ga_command_state_init_all(GACommandState *cs);
  28. void ga_command_state_cleanup_all(GACommandState *cs);
  29. GACommandState *ga_command_state_new(void);
  30. void ga_command_state_free(GACommandState *cs);
  31. bool ga_logging_enabled(GAState *s);
  32. void ga_disable_logging(GAState *s);
  33. void ga_enable_logging(GAState *s);
  34. void G_GNUC_PRINTF(1, 2) slog(const gchar *fmt, ...);
  35. void ga_set_response_delimited(GAState *s);
  36. bool ga_is_frozen(GAState *s);
  37. void ga_set_frozen(GAState *s);
  38. void ga_unset_frozen(GAState *s);
  39. const char *ga_fsfreeze_hook(GAState *s);
  40. int64_t ga_get_fd_handle(GAState *s, Error **errp);
  41. int ga_parse_whence(GuestFileWhence *whence, Error **errp);
  42. #ifndef _WIN32
  43. void reopen_fd_to_null(int fd);
  44. #endif
  45. #endif /* GUEST_AGENT_CORE_H */