2011-07-20 04:41:53 +08: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.
|
|
|
|
*/
|
2012-12-18 01:19:43 +08:00
|
|
|
#include "qapi/qmp/dispatch.h"
|
2011-07-20 04:41:53 +08:00
|
|
|
#include "qemu-common.h"
|
|
|
|
|
2012-01-19 14:18:20 +08:00
|
|
|
#define QGA_READ_COUNT_DEFAULT 4096
|
2011-07-20 04:41:53 +08:00
|
|
|
|
2011-07-21 04:19:37 +08:00
|
|
|
typedef struct GAState GAState;
|
2011-07-20 04:41:53 +08:00
|
|
|
typedef struct GACommandState GACommandState;
|
2012-02-08 03:56:48 +08:00
|
|
|
extern GAState *ga_state;
|
2011-07-20 04:41:53 +08:00
|
|
|
|
2011-07-20 04:41:55 +08:00
|
|
|
void ga_command_state_init(GAState *s, GACommandState *cs);
|
2011-07-20 04:41:53 +08: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);
|
2011-07-21 04:19:37 +08:00
|
|
|
bool ga_logging_enabled(GAState *s);
|
|
|
|
void ga_disable_logging(GAState *s);
|
|
|
|
void ga_enable_logging(GAState *s);
|
2013-11-18 02:19:52 +08:00
|
|
|
void GCC_FMT_ATTR(1, 2) slog(const gchar *fmt, ...);
|
2012-02-08 03:56:48 +08:00
|
|
|
void ga_set_response_delimited(GAState *s);
|
2012-04-18 08:01:45 +08:00
|
|
|
bool ga_is_frozen(GAState *s);
|
|
|
|
void ga_set_frozen(GAState *s);
|
|
|
|
void ga_unset_frozen(GAState *s);
|
2012-12-12 11:55:55 +08:00
|
|
|
const char *ga_fsfreeze_hook(GAState *s);
|
2013-03-02 01:40:27 +08:00
|
|
|
int64_t ga_get_fd_handle(GAState *s, Error **errp);
|
2012-05-11 03:50:41 +08:00
|
|
|
|
|
|
|
#ifndef _WIN32
|
|
|
|
void reopen_fd_to_null(int fd);
|
|
|
|
#endif
|