xref: /qemu/qga/guest-agent-core.h (revision 0e4ef702)
113a286d5SMichael Roth /*
213a286d5SMichael Roth  * QEMU Guest Agent core declarations
313a286d5SMichael Roth  *
413a286d5SMichael Roth  * Copyright IBM Corp. 2011
513a286d5SMichael Roth  *
613a286d5SMichael Roth  * Authors:
713a286d5SMichael Roth  *  Adam Litke        <aglitke@linux.vnet.ibm.com>
813a286d5SMichael Roth  *  Michael Roth      <mdroth@linux.vnet.ibm.com>
913a286d5SMichael Roth  *
1013a286d5SMichael Roth  * This work is licensed under the terms of the GNU GPL, version 2 or later.
1113a286d5SMichael Roth  * See the COPYING file in the top-level directory.
1213a286d5SMichael Roth  */
1361baac2fSPeter Maydell #ifndef GUEST_AGENT_CORE_H
1461baac2fSPeter Maydell #define GUEST_AGENT_CORE_H
1561baac2fSPeter Maydell 
167b1b5d19SPaolo Bonzini #include "qapi/qmp/dispatch.h"
17abb297edSMarkus Armbruster #include "qga-qapi-types.h"
1813a286d5SMichael Roth 
19125b310eSMichael Roth #define QGA_READ_COUNT_DEFAULT 4096
2013a286d5SMichael Roth 
2148ff7a62SMichael Roth typedef struct GAState GAState;
2213a286d5SMichael Roth typedef struct GACommandState GACommandState;
231527badbSMarkus Armbruster 
243cf0bed8SMichael Roth extern GAState *ga_state;
251527badbSMarkus Armbruster extern QmpCommandList ga_commands;
2613a286d5SMichael Roth 
270e4ef702SThomas Huth GList *ga_command_init_blockedrpcs(GList *blockedrpcs);
28e3d4d252SMichael Roth void ga_command_state_init(GAState *s, GACommandState *cs);
2913a286d5SMichael Roth void ga_command_state_add(GACommandState *cs,
3013a286d5SMichael Roth                           void (*init)(void),
3113a286d5SMichael Roth                           void (*cleanup)(void));
3213a286d5SMichael Roth void ga_command_state_init_all(GACommandState *cs);
3313a286d5SMichael Roth void ga_command_state_cleanup_all(GACommandState *cs);
3413a286d5SMichael Roth GACommandState *ga_command_state_new(void);
353e3e302fSMarc-André Lureau void ga_command_state_free(GACommandState *cs);
3648ff7a62SMichael Roth bool ga_logging_enabled(GAState *s);
3748ff7a62SMichael Roth void ga_disable_logging(GAState *s);
3848ff7a62SMichael Roth void ga_enable_logging(GAState *s);
399edc6313SMarc-André Lureau void G_GNUC_PRINTF(1, 2) slog(const gchar *fmt, ...);
403cf0bed8SMichael Roth void ga_set_response_delimited(GAState *s);
41f22d85e9SMichael Roth bool ga_is_frozen(GAState *s);
42f22d85e9SMichael Roth void ga_set_frozen(GAState *s);
43f22d85e9SMichael Roth void ga_unset_frozen(GAState *s);
44ec0f694cSTomoki Sekiyama const char *ga_fsfreeze_hook(GAState *s);
4539097dafSMichael Roth int64_t ga_get_fd_handle(GAState *s, Error **errp);
460b4b4938SEric Blake int ga_parse_whence(GuestFileWhence *whence, Error **errp);
4704b4e75fSLuiz Capitulino 
4804b4e75fSLuiz Capitulino #ifndef _WIN32
4904b4e75fSLuiz Capitulino void reopen_fd_to_null(int fd);
5004b4e75fSLuiz Capitulino #endif
5161baac2fSPeter Maydell 
5261baac2fSPeter Maydell #endif /* GUEST_AGENT_CORE_H */
53