From: Jean Guyader Date: Mon, 14 Dec 2009 15:14:31 +0000 (+0000) Subject: qemu-log-syslog: Handle vfprintf X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=14ed9a6949967910e14b6fdabf7e33ceeb6cff49;p=xenclient%2Fioemu-pq.git qemu-log-syslog: Handle vfprintf --- diff --git a/master/qemu-log-syslog b/master/qemu-log-syslog index b5f98f1..cf23f54 100644 --- a/master/qemu-log-syslog +++ b/master/qemu-log-syslog @@ -1,7 +1,8 @@ -diff -r fe4c575ded12 Makefile ---- a/Makefile Mon Jun 15 17:17:13 2009 +0100 -+++ b/Makefile Mon Jun 15 17:33:03 2009 +0100 -@@ -10,6 +10,7 @@ +diff --git a/Makefile b/Makefile +index c395e77..5f4f4cf 100644 +--- a/Makefile ++++ b/Makefile +@@ -10,6 +10,7 @@ VPATH=$(SRC_PATH):$(SRC_PATH)/hw CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAGS) @@ -9,7 +10,7 @@ diff -r fe4c575ded12 Makefile LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS) CPPFLAGS += -I. -I$(SRC_PATH) -MMD -MP -MT $@ -@@ -92,6 +93,7 @@ +@@ -92,6 +93,7 @@ OBJS+=sd.o ssi-sd.o OBJS+=bt.o bt-host.o bt-vhci.o bt-l2cap.o bt-sdp.o bt-hci.o bt-hid.o usb-bt.o OBJS+=buffered_file.o migration.o migration-tcp.o net.o qemu-sockets.o OBJS+=qemu-char.o aio.o net-checksum.o savevm.o cache-utils.o @@ -17,22 +18,26 @@ diff -r fe4c575ded12 Makefile ifdef CONFIG_BRLAPI OBJS+= baum.o -diff -r fe4c575ded12 Makefile.target ---- a/Makefile.target Mon Jun 15 17:17:13 2009 +0100 -+++ b/Makefile.target Mon Jun 15 17:33:03 2009 +0100 -@@ -79,6 +79,8 @@ - > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi ;) +diff --git a/Makefile.target b/Makefile.target +index 7cfb493..df3a68f 100644 +--- a/Makefile.target ++++ b/Makefile.target +@@ -80,6 +80,9 @@ cc-option = $(shell if $(CC) $(1) $(2) -S -o /dev/null -xc /dev/null \ HELPER_CFLAGS= -+ -+CFLAGS+=-Dfprintf=__syslog_fprintf ++CFLAGS+=-Dfprintf=__syslog_fprintf ++CFLAGS+=-Dvfprintf=__syslog_vfprintf ++ ifeq ($(ARCH),i386) HELPER_CFLAGS+=-fomit-frame-pointer -diff -r fe4c575ded12 logging.c ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/logging.c Mon Jun 15 17:33:03 2009 +0100 -@@ -0,0 +1,19 @@ + endif +diff --git a/logging.c b/logging.c +new file mode 100644 +index 0000000..6ae51b2 +--- /dev/null ++++ b/logging.c +@@ -0,0 +1,25 @@ +#include "logging.h" + +void cpu_set_log_syslog(const char *ident) @@ -52,9 +57,17 @@ diff -r fe4c575ded12 logging.c + return 0; +} + -diff -r fe4c575ded12 logging.h ---- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/logging.h Mon Jun 15 17:33:03 2009 +0100 ++int __syslog_vfprintf(FILE *stream, const char *format, va_list ap) ++{ ++ vsyslog(LOG_DAEMON | LOG_NOTICE, format, ap); ++ return 0; ++} ++ +diff --git a/logging.h b/logging.h +new file mode 100644 +index 0000000..95a756b +--- /dev/null ++++ b/logging.h @@ -0,0 +1,11 @@ +#ifndef QEMU_LOGGING_H +#define QEMU_LOGGING_H @@ -67,9 +80,10 @@ diff -r fe4c575ded12 logging.h + +#endif + -diff -r fe4c575ded12 qemu-common.h ---- a/qemu-common.h Mon Jun 15 17:17:13 2009 +0100 -+++ b/qemu-common.h Mon Jun 15 17:33:03 2009 +0100 +diff --git a/qemu-common.h b/qemu-common.h +index 50dfb6b..18f8608 100644 +--- a/qemu-common.h ++++ b/qemu-common.h @@ -31,6 +31,7 @@ #include #include @@ -78,10 +92,11 @@ diff -r fe4c575ded12 qemu-common.h #ifndef O_LARGEFILE #define O_LARGEFILE 0 -diff -r fe4c575ded12 vl.c ---- a/vl.c Mon Jun 15 17:17:13 2009 +0100 -+++ b/vl.c Mon Jun 15 17:33:03 2009 +0100 -@@ -5391,6 +5391,8 @@ +diff --git a/vl.c b/vl.c +index 85adc54..b9c6fa0 100644 +--- a/vl.c ++++ b/vl.c +@@ -5406,6 +5406,8 @@ int main(int argc, char **argv, char **envp) snprintf(domain_name, sizeof(domain_name), "Xen-%s", optarg); qemu_name = optarg;