mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 20:19:44 +00:00
d607a52364
gcc 4.8.2 reports this warning when extra warnings are enabled (-Wextra): CC qga/commands.o qga/commands.c: In function ‘slog’: qga/commands.c:28:5: error: function might be possible candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format] g_logv("syslog", G_LOG_LEVEL_INFO, fmt, ap); ^ gcc 4.8.2 reports this warning when slog is declared with the gnu_printf format attribute: qga/commands-posix.c: In function ‘qmp_guest_file_open’: qga/commands-posix.c:404:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int64_t’ [-Wformat=] slog("guest-file-open, handle: %d", handle); ^ On 32 bit hosts there are three more warnings which are also fixed here. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
43 lines
1.3 KiB
C
43 lines
1.3 KiB
C
/*
|
|
* 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.
|
|
*/
|
|
#include "qapi/qmp/dispatch.h"
|
|
#include "qemu-common.h"
|
|
|
|
#define QGA_READ_COUNT_DEFAULT 4096
|
|
|
|
typedef struct GAState GAState;
|
|
typedef struct GACommandState GACommandState;
|
|
extern GAState *ga_state;
|
|
|
|
void ga_command_state_init(GAState *s, GACommandState *cs);
|
|
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);
|
|
bool ga_logging_enabled(GAState *s);
|
|
void ga_disable_logging(GAState *s);
|
|
void ga_enable_logging(GAState *s);
|
|
void GCC_FMT_ATTR(1, 2) slog(const gchar *fmt, ...);
|
|
void ga_set_response_delimited(GAState *s);
|
|
bool ga_is_frozen(GAState *s);
|
|
void ga_set_frozen(GAState *s);
|
|
void ga_unset_frozen(GAState *s);
|
|
const char *ga_fsfreeze_hook(GAState *s);
|
|
int64_t ga_get_fd_handle(GAState *s, Error **errp);
|
|
|
|
#ifndef _WIN32
|
|
void reopen_fd_to_null(int fd);
|
|
#endif
|