[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 4/4] xenstored logging: add minios variant of default_xprintf()



From: James Dingwall <james@xxxxxxxxxxxxxx>

stderr is not available in a xenstore domain.  Add a new implementation of
default_xprintf() which sends the message to vsyslog() at LOG_ERROR.
---
 tools/xenstore/utils.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tools/xenstore/utils.c b/tools/xenstore/utils.c
index a1ac12584a..7ed05b1970 100644
--- a/tools/xenstore/utils.c
+++ b/tools/xenstore/utils.c
@@ -8,8 +8,21 @@
 #include <fcntl.h>
 #include <sys/types.h>
 #include <signal.h>
+#ifdef __MINIOS__
+#include <syslog.h>
+#endif
 #include "utils.h"
 
+#ifdef __MINIOS__
+static void default_xprintf(const char *fmt, ...)
+{
+       va_list args;
+
+       va_start(args, fmt);
+       vsyslog(LOG_ERR, fmt, args);
+       va_end(args);
+}
+#else
 static void default_xprintf(const char *fmt, ...)
 {
        va_list args;
@@ -19,6 +32,7 @@ static void default_xprintf(const char *fmt, ...)
        va_end(args);
        fflush(stderr);
 }
+#endif
 
 void (*xprintf)(const char *fmt, ...) = default_xprintf;
 
-- 
2.24.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.