Commit 00b3c2e2 by Cedric Le Goater Committed by Daniel Lezcano

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: 's avatarCedric Le Goater <clg@fr.ibm.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent b0691f81
...@@ -39,8 +39,9 @@ ...@@ -39,8 +39,9 @@
#include "error.h" #include "error.h"
#include "config.h" #include "config.h"
#include <lxc/lxc.h>
#include <lxc/log.h> #include <lxc/log.h>
#include <lxc/cgroup.h>
#include <lxc/start.h>
lxc_log_define(lxc_cgroup, lxc); lxc_log_define(lxc_cgroup, lxc);
......
...@@ -36,11 +36,8 @@ ...@@ -36,11 +36,8 @@
#include <netinet/in.h> #include <netinet/in.h>
#include <net/if.h> #include <net/if.h>
#include "error.h"
#include "lxc_plugin.h"
#include <lxc.h>
#include <lxc/log.h> #include <lxc/log.h>
#include "lxc_plugin.h"
lxc_log_define(lxc_checkpoint, lxc); lxc_log_define(lxc_checkpoint, lxc);
......
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
#include <sys/poll.h> #include <sys/poll.h>
#include <sys/param.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 "commands.h"
#include "mainloop.h" #include "mainloop.h"
......
...@@ -50,8 +50,9 @@ ...@@ -50,8 +50,9 @@
#include "parse.h" #include "parse.h"
#include "config.h" #include "config.h"
#include <lxc/lxc.h> #include <lxc/conf.h>
#include <lxc/log.h> #include <lxc/log.h>
#include <lxc/lxc.h> /* for lxc_cgroup_set() */
lxc_log_define(lxc_conf, lxc); lxc_log_define(lxc_conf, lxc);
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include <netinet/in.h> #include <netinet/in.h>
#include <sys/param.h> #include <sys/param.h>
#include <lxc/list.h>
enum { enum {
EMPTY, EMPTY,
VETH, VETH,
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#include "parse.h" #include "parse.h"
#include <lxc/lxc.h>
#include <lxc/log.h> #include <lxc/log.h>
#include <lxc/conf.h>
lxc_log_define(lxc_confile, lxc); lxc_log_define(lxc_confile, lxc);
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 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); extern int lxc_config_read(const char *file, struct lxc_conf *conf);
......
...@@ -27,7 +27,10 @@ ...@@ -27,7 +27,10 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/un.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 "commands.h"
#include "af_unix.h" #include "af_unix.h"
......
...@@ -32,8 +32,9 @@ ...@@ -32,8 +32,9 @@
#include <sys/param.h> #include <sys/param.h>
#include "error.h" #include "error.h"
#include <lxc/lxc.h>
#include <lxc/log.h> #include <lxc/log.h>
#include <lxc/cgroup.h>
lxc_log_define(lxc_freezer, lxc); lxc_log_define(lxc_freezer, lxc);
......
...@@ -33,16 +33,10 @@ extern "C" { ...@@ -33,16 +33,10 @@ extern "C" {
lxc/lxc.h will contain exports of liblxc lxc/lxc.h will contain exports of liblxc
**/ **/
#include <stddef.h>
#include <lxc/state.h> #include <lxc/state.h>
#include <lxc/list.h>
#include <lxc/log.h> struct lxc_msg;
#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>
/* /*
* Start the specified command inside a container * Start the specified command inside a container
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include <sys/types.h> #include <sys/types.h>
#include <lxc/lxc.h> #include <lxc/lxc.h>
#include <lxc/log.h>
#include "arguments.h" #include "arguments.h"
lxc_log_define(lxc_cgroup, lxc); lxc_log_define(lxc_cgroup, lxc);
......
...@@ -27,7 +27,10 @@ ...@@ -27,7 +27,10 @@
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <lxc.h> #include <lxc/lxc.h>
#include <lxc/log.h>
#include <lxc/utils.h>
#include "arguments.h" #include "arguments.h"
#include "config.h" #include "config.h"
......
...@@ -37,8 +37,10 @@ ...@@ -37,8 +37,10 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/poll.h> #include <sys/poll.h>
#include "error.h" #include <lxc/error.h>
#include "lxc.h" #include <lxc/lxc.h>
#include <lxc/log.h>
#include "arguments.h" #include "arguments.h"
lxc_log_define(lxc_console, lxc); lxc_log_define(lxc_console, lxc);
......
...@@ -31,8 +31,10 @@ ...@@ -31,8 +31,10 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/param.h> #include <sys/param.h>
#include <lxc/log.h>
#include <lxc/confile.h>
#include <lxc/lxc.h> #include <lxc/lxc.h>
#include "confile.h"
#include "arguments.h" #include "arguments.h"
#include "config.h" #include "config.h"
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include <string.h> #include <string.h>
#include <lxc/lxc.h> #include <lxc/lxc.h>
#include <lxc/log.h>
#include "arguments.h" #include "arguments.h"
static const struct option my_longopts[] = { static const struct option my_longopts[] = {
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include <sys/types.h> #include <sys/types.h>
#include <lxc/lxc.h> #include <lxc/lxc.h>
#include <lxc/log.h>
#include "arguments.h" #include "arguments.h"
static const struct option my_longopts[] = { static const struct option my_longopts[] = {
......
...@@ -33,7 +33,11 @@ ...@@ -33,7 +33,11 @@
#include <sys/mount.h> #include <sys/mount.h>
#define _GNU_SOURCE #define _GNU_SOURCE
#include <getopt.h> #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); lxc_log_define(lxc_init, lxc);
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include <sys/types.h> #include <sys/types.h>
#include <lxc/lxc.h> #include <lxc/lxc.h>
#include <lxc/log.h>
#include <lxc/monitor.h>
#include "arguments.h" #include "arguments.h"
lxc_log_define(monitor, lxc); lxc_log_define(monitor, lxc);
......
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <lxc.h> #include <lxc/lxc.h>
#include <lxc/log.h>
#include "arguments.h" #include "arguments.h"
static int my_checker(const struct lxc_arguments* args) static int my_checker(const struct lxc_arguments* args)
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include <lxc/lxc.h> #include <lxc/lxc.h>
#include <lxc/log.h> #include <lxc/log.h>
#include <lxc/utils.h>
#include "arguments.h" #include "arguments.h"
lxc_log_define(lxc_start, lxc); lxc_log_define(lxc_start, lxc);
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include <sys/types.h> #include <sys/types.h>
#include <lxc/lxc.h> #include <lxc/lxc.h>
#include <lxc/log.h>
#include "arguments.h" #include "arguments.h"
static const struct option my_longopts[] = { static const struct option my_longopts[] = {
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include <sys/types.h> #include <sys/types.h>
#include <lxc/lxc.h> #include <lxc/lxc.h>
#include <lxc/log.h>
#include "arguments.h" #include "arguments.h"
static const struct option my_longopts[] = { static const struct option my_longopts[] = {
......
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
#include <sys/wait.h> #include <sys/wait.h>
#include <pwd.h> #include <pwd.h>
#include <lxc/lxc.h> #include <lxc/log.h>
#include <lxc/namespace.h>
lxc_log_define(lxc_unshare, lxc); lxc_log_define(lxc_unshare, lxc);
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include <sys/types.h> #include <sys/types.h>
#include <lxc/lxc.h> #include <lxc/lxc.h>
#include <lxc/log.h>
#include <lxc/monitor.h>
#include "arguments.h" #include "arguments.h"
lxc_log_define(lxc_wait, lxc); lxc_log_define(lxc_wait, lxc);
......
...@@ -36,8 +36,10 @@ ...@@ -36,8 +36,10 @@
#include "error.h" #include "error.h"
#include "af_unix.h" #include "af_unix.h"
#include <lxc/lxc.h>
#include <lxc/log.h> #include <lxc/log.h>
#include <lxc/state.h>
#include <lxc/monitor.h>
lxc_log_define(lxc_monitor, lxc); lxc_log_define(lxc_monitor, lxc);
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include <signal.h> #include <signal.h>
#include <namespace.h> #include <namespace.h>
#include <lxc/lxc.h> #include <lxc/log.h>
lxc_log_define(lxc_namespace, lxc); lxc_log_define(lxc_namespace, lxc);
......
...@@ -44,9 +44,6 @@ ...@@ -44,9 +44,6 @@
lxc_log_define(lxc_restart, lxc); 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) int lxc_restart(const char *name, int fd, unsigned long flags)
{ {
return 0; return 0;
......
...@@ -44,9 +44,6 @@ ...@@ -44,9 +44,6 @@
#include <sys/un.h> #include <sys/un.h>
#include <sys/poll.h> #include <sys/poll.h>
#include <lxc/lxc.h>
#include <lxc/confile.h>
#ifdef HAVE_SYS_SIGNALFD_H #ifdef HAVE_SYS_SIGNALFD_H
# include <sys/signalfd.h> # include <sys/signalfd.h>
#else #else
...@@ -91,13 +88,19 @@ int signalfd(int fd, const sigset_t *mask, int flags) ...@@ -91,13 +88,19 @@ int signalfd(int fd, const sigset_t *mask, int flags)
#define PR_CAPBSET_DROP 24 #define PR_CAPBSET_DROP 24
#endif #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 "error.h"
#include "af_unix.h" #include "af_unix.h"
#include "mainloop.h" #include "mainloop.h"
#include "commands.h" #include "commands.h"
#include <lxc/lxc.h>
#include <lxc/log.h>
lxc_log_define(lxc_start, lxc); lxc_log_define(lxc_start, lxc);
......
...@@ -20,6 +20,11 @@ ...@@ -20,6 +20,11 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 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 { struct lxc_handler {
...@@ -40,5 +45,5 @@ extern int lxc_poll(const char *name, struct lxc_handler *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_abort(const char *name, struct lxc_handler *handler);
extern void lxc_fini(const char *name, struct lxc_handler *handler); extern void lxc_fini(const char *name, struct lxc_handler *handler);
#endif
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/file.h> #include <sys/file.h>
#include <lxc/lxc.h>
#include <lxc/log.h> #include <lxc/log.h>
#include <lxc/start.h>
#include "commands.h" #include "commands.h"
#include "config.h" #include "config.h"
......
...@@ -29,10 +29,12 @@ ...@@ -29,10 +29,12 @@
#include <sys/signal.h> #include <sys/signal.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/socket.h>
#include <fcntl.h> #include <fcntl.h>
#include <lxc/lxc.h>
#include <lxc/log.h> #include <lxc/log.h>
#include <lxc/start.h>
#include "commands.h" #include "commands.h"
lxc_log_define(lxc_stop, lxc); lxc_log_define(lxc_stop, lxc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment