Skip to content

Commit

Permalink
log: move qemu_log_close/qemu_log_flush from header to log.c
Browse files Browse the repository at this point in the history
There is no particular reason to keep these functions in the header.
Suggested by Paolo.

Signed-off-by: Denis V. Lunev <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Message-id: [email protected]
CC: Stefan Hajnoczi <[email protected]>
CC: Paolo Bonzini <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
  • Loading branch information
Denis V. Lunev authored and stefanhaRH committed Mar 31, 2016
1 parent acc6809 commit 99affd1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
22 changes: 5 additions & 17 deletions include/qemu/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,6 @@ qemu_log_vprintf(const char *fmt, va_list va)

/* Maintenance: */

/* fflush() the log file */
static inline void qemu_log_flush(void)
{
fflush(qemu_logfile);
}

/* Close the log file */
static inline void qemu_log_close(void)
{
if (qemu_logfile) {
if (qemu_logfile != stderr) {
fclose(qemu_logfile);
}
qemu_logfile = NULL;
}
}

/* define log items */
typedef struct QEMULogItem {
int mask;
Expand Down Expand Up @@ -146,4 +129,9 @@ int qemu_str_to_log_mask(const char *str);
*/
void qemu_print_log_usage(FILE *f);

/* fflush() the log file */
void qemu_log_flush(void);
/* Close the log file */
void qemu_log_close(void);

#endif
17 changes: 17 additions & 0 deletions util/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,23 @@ void qemu_set_dfilter_ranges(const char *filter_spec)
}
}

/* fflush() the log file */
void qemu_log_flush(void)
{
fflush(qemu_logfile);
}

/* Close the log file */
void qemu_log_close(void)
{
if (qemu_logfile) {
if (qemu_logfile != stderr) {
fclose(qemu_logfile);
}
qemu_logfile = NULL;
}
}

const QEMULogItem qemu_log_items[] = {
{ CPU_LOG_TB_OUT_ASM, "out_asm",
"show generated host assembly code for each compiled TB" },
Expand Down

0 comments on commit 99affd1

Please sign in to comment.