debuggers.hg

view tools/console/daemon/utils.h @ 22848:6341fe0f4e5a

Added tag 4.1.0-rc2 for changeset 9dca60d88c63
author Keir Fraser <keir@xen.org>
date Tue Jan 25 14:06:55 2011 +0000 (2011-01-25)
parents 779c0ef9682c
children
line source
1 /*\
2 * Copyright (C) International Business Machines Corp., 2005
3 * Author(s): Anthony Liguori <aliguori@us.ibm.com>
4 *
5 * Xen Console Daemon
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; under version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 \*/
21 #ifndef CONSOLED_UTILS_H
22 #define CONSOLED_UTILS_H
24 #include <stdbool.h>
25 #include <syslog.h>
26 #include <stdio.h>
27 #include <xenctrl.h>
29 #include "xs.h"
31 void daemonize(const char *pidfile);
32 bool xen_setup(void);
34 extern struct xs_handle *xs;
35 extern xc_interface *xc;
37 #if 1
38 #define dolog(val, fmt, ...) do { \
39 if ((val) == LOG_ERR) \
40 fprintf(stderr, fmt "\n", ## __VA_ARGS__); \
41 syslog(val, fmt, ## __VA_ARGS__); \
42 } while (/* CONSTCOND */0)
43 #else
44 #define dolog(val, fmt, ...) fprintf(stderr, fmt "\n", ## __VA_ARGS__)
45 #endif
47 #endif