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 16#include "qapi/qmp/dispatch.h" 17#include "qemu-common.h" 18#include "qga-qapi-types.h" 19 20#define QGA_READ_COUNT_DEFAULT 4096 21 22typedef struct GAState GAState; 23typedef struct GACommandState GACommandState; 24 25extern GAState *ga_state; 26extern QmpCommandList ga_commands; 27 28GList *ga_command_blacklist_init(GList *blacklist); 29void ga_command_state_init(GAState *s, GACommandState *cs); 30void ga_command_state_add(GACommandState *cs, 31 void (*init)(void), 32 void (*cleanup)(void)); 33void ga_command_state_init_all(GACommandState *cs); 34void ga_command_state_cleanup_all(GACommandState *cs); 35GACommandState *ga_command_state_new(void); 36void ga_command_state_free(GACommandState *cs); 37bool ga_logging_enabled(GAState *s); 38void ga_disable_logging(GAState *s); 39void ga_enable_logging(GAState *s); 40void GCC_FMT_ATTR(1, 2) slog(const gchar *fmt, ...); 41void ga_set_response_delimited(GAState *s); 42bool ga_is_frozen(GAState *s); 43void ga_set_frozen(GAState *s); 44void ga_unset_frozen(GAState *s); 45const char *ga_fsfreeze_hook(GAState *s); 46int64_t ga_get_fd_handle(GAState *s, Error **errp); 47int ga_parse_whence(GuestFileWhence *whence, Error **errp); 48 49#ifndef _WIN32 50void reopen_fd_to_null(int fd); 51#endif 52 53#endif /* GUEST_AGENT_CORE_H */ 54