aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Le Goater <clg@vnet.ibm.com>2009-11-17 10:56:23 +0100
committerDaniel Lezcano <dlezcano@fr.ibm.com>2009-11-17 10:56:23 +0100
commit00b3c2e2845792face31017e905f9b8b4ea48653 (patch)
tree6f87ee54157260f1a9d295a5220e734f76585556
parenttypo in 488624016575d092d56211347b2bbe8367cd339a (V2) (diff)
downloadlxc-00b3c2e2845792face31017e905f9b8b4ea48653.tar.gz
lxc-00b3c2e2845792face31017e905f9b8b4ea48653.tar.bz2
lxc-00b3c2e2845792face31017e905f9b8b4ea48653.zip
cleanup <lxc/lxc.h>
<lxc/lxc.h> should only include what is needed. This patch removes all useless headers from lxc.h and fixed other .c files. Signed-off-by: Cedric Le Goater <clg@fr.ibm.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
-rw-r--r--src/lxc/cgroup.c3
-rw-r--r--src/lxc/checkpoint.c5
-rw-r--r--src/lxc/commands.c4
-rw-r--r--src/lxc/conf.c3
-rw-r--r--src/lxc/conf.h2
-rw-r--r--src/lxc/confile.c2
-rw-r--r--src/lxc/confile.h2
-rw-r--r--src/lxc/console.c5
-rw-r--r--src/lxc/freezer.c3
-rw-r--r--src/lxc/lxc.h12
-rw-r--r--src/lxc/lxc_cgroup.c2
-rw-r--r--src/lxc/lxc_checkpoint.c5
-rw-r--r--src/lxc/lxc_console.c6
-rw-r--r--src/lxc/lxc_execute.c4
-rw-r--r--src/lxc/lxc_freeze.c2
-rw-r--r--src/lxc/lxc_info.c2
-rw-r--r--src/lxc/lxc_init.c6
-rw-r--r--src/lxc/lxc_monitor.c2
-rw-r--r--src/lxc/lxc_restart.c4
-rw-r--r--src/lxc/lxc_start.c2
-rw-r--r--src/lxc/lxc_stop.c2
-rw-r--r--src/lxc/lxc_unfreeze.c2
-rw-r--r--src/lxc/lxc_unshare.c3
-rw-r--r--src/lxc/lxc_wait.c2
-rw-r--r--src/lxc/monitor.c4
-rw-r--r--src/lxc/namespace.c2
-rw-r--r--src/lxc/restart.c3
-rw-r--r--src/lxc/start.c13
-rw-r--r--src/lxc/start.h7
-rw-r--r--src/lxc/state.c2
-rw-r--r--src/lxc/stop.c4
31 files changed, 81 insertions, 39 deletions
diff --git a/src/lxc/cgroup.c b/src/lxc/cgroup.c
index 17abb16..3fff51e 100644
--- a/src/lxc/cgroup.c
+++ b/src/lxc/cgroup.c
@@ -39,8 +39,9 @@
#include "error.h"
#include "config.h"
-#include <lxc/lxc.h>
#include <lxc/log.h>
+#include <lxc/cgroup.h>
+#include <lxc/start.h>
lxc_log_define(lxc_cgroup, lxc);
diff --git a/src/lxc/checkpoint.c b/src/lxc/checkpoint.c
index b7f172d..7c35331 100644
--- a/src/lxc/checkpoint.c
+++ b/src/lxc/checkpoint.c
@@ -36,11 +36,8 @@
#include <netinet/in.h>
#include <net/if.h>
-#include "error.h"
-#include "lxc_plugin.h"
-#include <lxc.h>
-
#include <lxc/log.h>
+#include "lxc_plugin.h"
lxc_log_define(lxc_checkpoint, lxc);
diff --git a/src/lxc/commands.c b/src/lxc/commands.c
index e0ca348..02239e5 100644
--- a/src/lxc/commands.c
+++ b/src/lxc/commands.c
@@ -30,7 +30,9 @@
#include <sys/poll.h>
#include <sys/param.h>
-#include <lxc/lxc.h>
+#include <lxc/log.h>
+#include <lxc/conf.h>
+#include <lxc/start.h> /* for struct lxc_handler */
#include "commands.h"
#include "mainloop.h"
diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index ab324ab..b4e3a3e 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -50,8 +50,9 @@
#include "parse.h"
#include "config.h"
-#include <lxc/lxc.h>
+#include <lxc/conf.h>
#include <lxc/log.h>
+#include <lxc/lxc.h> /* for lxc_cgroup_set() */
lxc_log_define(lxc_conf, lxc);
diff --git a/src/lxc/conf.h b/src/lxc/conf.h
index 8a3ebf0..215f1e5 100644
--- a/src/lxc/conf.h
+++ b/src/lxc/conf.h
@@ -26,6 +26,8 @@
#include <netinet/in.h>
#include <sys/param.h>
+#include <lxc/list.h>
+
enum {
EMPTY,
VETH,
diff --git a/src/lxc/confile.c b/src/lxc/confile.c
index 5e0081c..43bede4 100644
--- a/src/lxc/confile.c
+++ b/src/lxc/confile.c
@@ -34,8 +34,8 @@
#include "parse.h"
-#include <lxc/lxc.h>
#include <lxc/log.h>
+#include <lxc/conf.h>
lxc_log_define(lxc_confile, lxc);
diff --git a/src/lxc/confile.h b/src/lxc/confile.h
index d0e7653..20c9b39 100644
--- a/src/lxc/confile.h
+++ b/src/lxc/confile.h
@@ -21,6 +21,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+struct lxc_conf;
+
extern int lxc_config_read(const char *file, struct lxc_conf *conf);
diff --git a/src/lxc/console.c b/src/lxc/console.c
index bd117a5..52f6cec 100644
--- a/src/lxc/console.c
+++ b/src/lxc/console.c
@@ -27,7 +27,10 @@
#include <sys/types.h>
#include <sys/un.h>
-#include <lxc/lxc.h>
+#include <lxc/log.h>
+#include <lxc/conf.h>
+#include <lxc/start.h> /* for struct lxc_handler */
+
#include "commands.h"
#include "af_unix.h"
diff --git a/src/lxc/freezer.c b/src/lxc/freezer.c
index f4b4018..cff954e 100644
--- a/src/lxc/freezer.c
+++ b/src/lxc/freezer.c
@@ -32,8 +32,9 @@
#include <sys/param.h>
#include "error.h"
-#include <lxc/lxc.h>
+
#include <lxc/log.h>
+#include <lxc/cgroup.h>
lxc_log_define(lxc_freezer, lxc);
diff --git a/src/lxc/lxc.h b/src/lxc/lxc.h
index 1d04b9f..a78fb65 100644
--- a/src/lxc/lxc.h
+++ b/src/lxc/lxc.h
@@ -33,16 +33,10 @@ extern "C" {
lxc/lxc.h will contain exports of liblxc
**/
+#include <stddef.h>
#include <lxc/state.h>
-#include <lxc/list.h>
-#include <lxc/log.h>
-#include <lxc/conf.h>
-#include <lxc/namespace.h>
-#include <lxc/utils.h>
-#include <lxc/error.h>
-#include <lxc/cgroup.h>
-#include <lxc/monitor.h>
-#include <lxc/start.h>
+
+struct lxc_msg;
/*
* Start the specified command inside a container
diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c
index ae1c964..f394d26 100644
--- a/src/lxc/lxc_cgroup.c
+++ b/src/lxc/lxc_cgroup.c
@@ -27,6 +27,8 @@
#include <sys/types.h>
#include <lxc/lxc.h>
+#include <lxc/log.h>
+
#include "arguments.h"
lxc_log_define(lxc_cgroup, lxc);
diff --git a/src/lxc/lxc_checkpoint.c b/src/lxc/lxc_checkpoint.c
index 4d0e210..ff59048 100644
--- a/src/lxc/lxc_checkpoint.c
+++ b/src/lxc/lxc_checkpoint.c
@@ -27,7 +27,10 @@
#include <unistd.h>
#include <sys/types.h>
-#include <lxc.h>
+#include <lxc/lxc.h>
+#include <lxc/log.h>
+#include <lxc/utils.h>
+
#include "arguments.h"
#include "config.h"
diff --git a/src/lxc/lxc_console.c b/src/lxc/lxc_console.c
index b662572..cff208f 100644
--- a/src/lxc/lxc_console.c
+++ b/src/lxc/lxc_console.c
@@ -37,8 +37,10 @@
#include <sys/stat.h>
#include <sys/poll.h>
-#include "error.h"
-#include "lxc.h"
+#include <lxc/error.h>
+#include <lxc/lxc.h>
+#include <lxc/log.h>
+
#include "arguments.h"
lxc_log_define(lxc_console, lxc);
diff --git a/src/lxc/lxc_execute.c b/src/lxc/lxc_execute.c
index 746cb4e..5821350 100644
--- a/src/lxc/lxc_execute.c
+++ b/src/lxc/lxc_execute.c
@@ -31,8 +31,10 @@
#include <sys/stat.h>
#include <sys/param.h>
+#include <lxc/log.h>
+#include <lxc/confile.h>
#include <lxc/lxc.h>
-#include "confile.h"
+
#include "arguments.h"
#include "config.h"
diff --git a/src/lxc/lxc_freeze.c b/src/lxc/lxc_freeze.c
index a5be16c..770d923 100644
--- a/src/lxc/lxc_freeze.c
+++ b/src/lxc/lxc_freeze.c
@@ -27,6 +27,8 @@
#include <string.h>
#include <lxc/lxc.h>
+#include <lxc/log.h>
+
#include "arguments.h"
static const struct option my_longopts[] = {
diff --git a/src/lxc/lxc_info.c b/src/lxc/lxc_info.c
index 34518d9..4facbf2 100644
--- a/src/lxc/lxc_info.c
+++ b/src/lxc/lxc_info.c
@@ -26,6 +26,8 @@
#include <sys/types.h>
#include <lxc/lxc.h>
+#include <lxc/log.h>
+
#include "arguments.h"
static const struct option my_longopts[] = {
diff --git a/src/lxc/lxc_init.c b/src/lxc/lxc_init.c
index deef343..191f7c4 100644
--- a/src/lxc/lxc_init.c
+++ b/src/lxc/lxc_init.c
@@ -33,7 +33,11 @@
#include <sys/mount.h>
#define _GNU_SOURCE
#include <getopt.h>
-#include "lxc.h"
+
+#include <lxc/lxc.h>
+#include <lxc/log.h>
+#include <lxc/utils.h>
+#include <lxc/error.h>
lxc_log_define(lxc_init, lxc);
diff --git a/src/lxc/lxc_monitor.c b/src/lxc/lxc_monitor.c
index 4befa15..7d14188 100644
--- a/src/lxc/lxc_monitor.c
+++ b/src/lxc/lxc_monitor.c
@@ -29,6 +29,8 @@
#include <sys/types.h>
#include <lxc/lxc.h>
+#include <lxc/log.h>
+#include <lxc/monitor.h>
#include "arguments.h"
lxc_log_define(monitor, lxc);
diff --git a/src/lxc/lxc_restart.c b/src/lxc/lxc_restart.c
index 9f4bb1d..77895a0 100644
--- a/src/lxc/lxc_restart.c
+++ b/src/lxc/lxc_restart.c
@@ -25,7 +25,9 @@
#include <unistd.h>
#include <sys/types.h>
-#include <lxc.h>
+#include <lxc/lxc.h>
+#include <lxc/log.h>
+
#include "arguments.h"
static int my_checker(const struct lxc_arguments* args)
diff --git a/src/lxc/lxc_start.c b/src/lxc/lxc_start.c
index ffeb66b..de78290 100644
--- a/src/lxc/lxc_start.c
+++ b/src/lxc/lxc_start.c
@@ -39,6 +39,8 @@
#include <lxc/lxc.h>
#include <lxc/log.h>
+#include <lxc/utils.h>
+
#include "arguments.h"
lxc_log_define(lxc_start, lxc);
diff --git a/src/lxc/lxc_stop.c b/src/lxc/lxc_stop.c
index 01d6d8f..639b750 100644
--- a/src/lxc/lxc_stop.c
+++ b/src/lxc/lxc_stop.c
@@ -26,6 +26,8 @@
#include <sys/types.h>
#include <lxc/lxc.h>
+#include <lxc/log.h>
+
#include "arguments.h"
static const struct option my_longopts[] = {
diff --git a/src/lxc/lxc_unfreeze.c b/src/lxc/lxc_unfreeze.c
index 02ca70d..22be839 100644
--- a/src/lxc/lxc_unfreeze.c
+++ b/src/lxc/lxc_unfreeze.c
@@ -26,6 +26,8 @@
#include <sys/types.h>
#include <lxc/lxc.h>
+#include <lxc/log.h>
+
#include "arguments.h"
static const struct option my_longopts[] = {
diff --git a/src/lxc/lxc_unshare.c b/src/lxc/lxc_unshare.c
index f91d4cd..4639687 100644
--- a/src/lxc/lxc_unshare.c
+++ b/src/lxc/lxc_unshare.c
@@ -32,7 +32,8 @@
#include <sys/wait.h>
#include <pwd.h>
-#include <lxc/lxc.h>
+#include <lxc/log.h>
+#include <lxc/namespace.h>
lxc_log_define(lxc_unshare, lxc);
diff --git a/src/lxc/lxc_wait.c b/src/lxc/lxc_wait.c
index bc1bb06..a5199e2 100644
--- a/src/lxc/lxc_wait.c
+++ b/src/lxc/lxc_wait.c
@@ -27,6 +27,8 @@
#include <sys/types.h>
#include <lxc/lxc.h>
+#include <lxc/log.h>
+#include <lxc/monitor.h>
#include "arguments.h"
lxc_log_define(lxc_wait, lxc);
diff --git a/src/lxc/monitor.c b/src/lxc/monitor.c
index 700f5bc..7ec1701 100644
--- a/src/lxc/monitor.c
+++ b/src/lxc/monitor.c
@@ -36,8 +36,10 @@
#include "error.h"
#include "af_unix.h"
-#include <lxc/lxc.h>
+
#include <lxc/log.h>
+#include <lxc/state.h>
+#include <lxc/monitor.h>
lxc_log_define(lxc_monitor, lxc);
diff --git a/src/lxc/namespace.c b/src/lxc/namespace.c
index 70f6726..72e47e1 100644
--- a/src/lxc/namespace.c
+++ b/src/lxc/namespace.c
@@ -27,7 +27,7 @@
#include <signal.h>
#include <namespace.h>
-#include <lxc/lxc.h>
+#include <lxc/log.h>
lxc_log_define(lxc_namespace, lxc);
diff --git a/src/lxc/restart.c b/src/lxc/restart.c
index f382ae3..ce8cd80 100644
--- a/src/lxc/restart.c
+++ b/src/lxc/restart.c
@@ -44,9 +44,6 @@
lxc_log_define(lxc_restart, lxc);
-LXC_TTY_HANDLER(SIGINT);
-LXC_TTY_HANDLER(SIGQUIT);
-
int lxc_restart(const char *name, int fd, unsigned long flags)
{
return 0;
diff --git a/src/lxc/start.c b/src/lxc/start.c
index 6537780..e59b4e3 100644
--- a/src/lxc/start.c
+++ b/src/lxc/start.c
@@ -44,9 +44,6 @@
#include <sys/un.h>
#include <sys/poll.h>
-#include <lxc/lxc.h>
-#include <lxc/confile.h>
-
#ifdef HAVE_SYS_SIGNALFD_H
# include <sys/signalfd.h>
#else
@@ -91,13 +88,19 @@ int signalfd(int fd, const sigset_t *mask, int flags)
#define PR_CAPBSET_DROP 24
#endif
+#include <lxc/log.h>
+#include <lxc/conf.h>
+#include <lxc/confile.h>
+#include <lxc/start.h>
+#include <lxc/utils.h>
+#include <lxc/cgroup.h>
+#include <lxc/monitor.h>
+
#include "error.h"
#include "af_unix.h"
#include "mainloop.h"
#include "commands.h"
-#include <lxc/lxc.h>
-#include <lxc/log.h>
lxc_log_define(lxc_start, lxc);
diff --git a/src/lxc/start.h b/src/lxc/start.h
index 03d8762..ca0c08a 100644
--- a/src/lxc/start.h
+++ b/src/lxc/start.h
@@ -20,6 +20,11 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#ifndef __lxc_state_h
+#define __lxc_state_h
+
+#include <lxc/conf.h>
+#include <lxc/state.h>
struct lxc_handler {
@@ -40,5 +45,5 @@ extern int lxc_poll(const char *name, struct lxc_handler *handler);
extern void lxc_abort(const char *name, struct lxc_handler *handler);
extern void lxc_fini(const char *name, struct lxc_handler *handler);
-
+#endif
diff --git a/src/lxc/state.c b/src/lxc/state.c
index 6125fa3..0496657 100644
--- a/src/lxc/state.c
+++ b/src/lxc/state.c
@@ -31,8 +31,8 @@
#include <sys/stat.h>
#include <sys/file.h>
-#include <lxc/lxc.h>
#include <lxc/log.h>
+#include <lxc/start.h>
#include "commands.h"
#include "config.h"
diff --git a/src/lxc/stop.c b/src/lxc/stop.c
index 504d27e..b751af5 100644
--- a/src/lxc/stop.c
+++ b/src/lxc/stop.c
@@ -29,10 +29,12 @@
#include <sys/signal.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/socket.h>
#include <fcntl.h>
-#include <lxc/lxc.h>
#include <lxc/log.h>
+#include <lxc/start.h>
+
#include "commands.h"
lxc_log_define(lxc_stop, lxc);