mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
virtiofsd: Add auxiliary .c's
Add most of the non-main .c files we need from upstream fuse-3.8.0 Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
a62a9e192b
commit
ffcf8d9f86
5 changed files with 1315 additions and 0 deletions
40
tools/virtiofsd/fuse_log.c
Normal file
40
tools/virtiofsd/fuse_log.c
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
FUSE: Filesystem in Userspace
|
||||
Copyright (C) 2019 Red Hat, Inc.
|
||||
|
||||
Logging API.
|
||||
|
||||
This program can be distributed under the terms of the GNU LGPLv2.
|
||||
See the file COPYING.LIB
|
||||
*/
|
||||
|
||||
#include "fuse_log.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
static void default_log_func(
|
||||
__attribute__(( unused )) enum fuse_log_level level,
|
||||
const char *fmt, va_list ap)
|
||||
{
|
||||
vfprintf(stderr, fmt, ap);
|
||||
}
|
||||
|
||||
static fuse_log_func_t log_func = default_log_func;
|
||||
|
||||
void fuse_set_log_func(fuse_log_func_t func)
|
||||
{
|
||||
if (!func)
|
||||
func = default_log_func;
|
||||
|
||||
log_func = func;
|
||||
}
|
||||
|
||||
void fuse_log(enum fuse_log_level level, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
log_func(level, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue