When xenstored crashes due to an unrecoverable condition it is calling
either barf() or barf_perror() to issue a message and then exit().
Make sure the message is visible somewhere by using syslog()
additionally to xprintf(), as the latter will be visible only with
tracing active.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
Reviewed-by: Julien Grall <jgrall@amazon.com>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
+#include <syslog.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
va_end(arglist);
if (bytes >= 0) {
+ syslog(LOG_CRIT, "%s\n", str);
xprintf("%s\n", str);
free(str);
}
va_end(arglist);
if (bytes >= 0) {
+ syslog(LOG_CRIT, "%s: %s\n", str, strerror(err));
xprintf("%s: %s\n", str, strerror(err));
free(str);
}