2011-07-20 00:41:53 +04:00
|
|
|
/*
|
|
|
|
* QEMU Guest Agent core declarations
|
|
|
|
*
|
|
|
|
* Copyright IBM Corp. 2011
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Adam Litke <aglitke@linux.vnet.ibm.com>
|
|
|
|
* Michael Roth <mdroth@linux.vnet.ibm.com>
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
2018-11-08 15:52:23 +03:00
|
|
|
#ifndef GUEST_AGENT_CORE_H
|
|
|
|
#define GUEST_AGENT_CORE_H
|
|
|
|
|
2012-12-17 21:19:43 +04:00
|
|
|
#include "qapi/qmp/dispatch.h"
|
2011-07-20 00:41:53 +04:00
|
|
|
#include "qemu-common.h"
|
2018-02-01 14:18:33 +03:00
|
|
|
#include "qga-qapi-types.h"
|
2011-07-20 00:41:53 +04:00
|
|
|
|
2012-01-19 10:18:20 +04:00
|
|
|
#define QGA_READ_COUNT_DEFAULT 4096
|
2011-07-20 00:41:53 +04:00
|
|
|
|
2011-07-21 00:19:37 +04:00
|
|
|
typedef struct GAState GAState;
|
2011-07-20 00:41:53 +04:00
|
|
|
typedef struct GACommandState GACommandState;
|
2017-03-03 15:32:25 +03:00
|
|
|
|
2012-02-07 23:56:48 +04:00
|
|
|
extern GAState *ga_state;
|
2017-03-03 15:32:25 +03:00
|
|
|
extern QmpCommandList ga_commands;
|
2011-07-20 00:41:53 +04:00
|
|
|
|
2014-07-01 01:51:40 +04:00
|
|
|
GList *ga_command_blacklist_init(GList *blacklist);
|
2011-07-20 00:41:55 +04:00
|
|
|
void ga_command_state_init(GAState *s, GACommandState *cs);
|
2011-07-20 00:41:53 +04:00
|
|
|
void ga_command_state_add(GACommandState *cs,
|
|
|
|
void (*init)(void),
|
|
|
|
void (*cleanup)(void));
|
|
|
|
void ga_command_state_init_all(GACommandState *cs);
|
|
|
|
void ga_command_state_cleanup_all(GACommandState *cs);
|
|
|
|
GACommandState *ga_command_state_new(void);
|
2016-07-15 18:52:52 +03:00
|
|
|
void ga_command_state_free(GACommandState *cs);
|
2011-07-21 00:19:37 +04:00
|
|
|
bool ga_logging_enabled(GAState *s);
|
|
|
|
void ga_disable_logging(GAState *s);
|
|
|
|
void ga_enable_logging(GAState *s);
|
2013-11-17 22:19:52 +04:00
|
|
|
void GCC_FMT_ATTR(1, 2) slog(const gchar *fmt, ...);
|
2012-02-07 23:56:48 +04:00
|
|
|
void ga_set_response_delimited(GAState *s);
|
2012-04-18 04:01:45 +04:00
|
|
|
bool ga_is_frozen(GAState *s);
|
|
|
|
void ga_set_frozen(GAState *s);
|
|
|
|
void ga_unset_frozen(GAState *s);
|
2012-12-12 07:55:55 +04:00
|
|
|
const char *ga_fsfreeze_hook(GAState *s);
|
2013-03-01 21:40:27 +04:00
|
|
|
int64_t ga_get_fd_handle(GAState *s, Error **errp);
|
2016-02-10 00:27:16 +03:00
|
|
|
int ga_parse_whence(GuestFileWhence *whence, Error **errp);
|
2012-05-10 23:50:41 +04:00
|
|
|
|
|
|
|
#ifndef _WIN32
|
|
|
|
void reopen_fd_to_null(int fd);
|
|
|
|
#endif
|
2018-11-08 15:52:23 +03:00
|
|
|
|
|
|
|
#endif /* GUEST_AGENT_CORE_H */
|