]> git.proxmox.com Git - mirror_lxc.git/blame - src/lxc/restart.c
Makefile.am: use right .h file name for seccomp
[mirror_lxc.git] / src / lxc / restart.c
CommitLineData
925aaa31 1/*
2 * lxc: linux Container library
3 *
267d974e 4 * (C) Copyright IBM Corp. 2007, 2010
925aaa31 5 *
6 * Authors:
7 * Daniel Lezcano <dlezcano at fr.ibm.com>
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
196f1d54 23
f549edcc
GK
24#include "config.h"
25
196f1d54
CLG
26#include <stdio.h>
27#undef _GNU_SOURCE
28#include <string.h>
29#include <stdlib.h>
30#include <errno.h>
31#include <unistd.h>
32
36eb9bde 33#include <lxc/log.h>
196f1d54
CLG
34#include <lxc/start.h> /* for struct lxc_handler */
35#include <lxc/utils.h>
36#include <lxc/error.h>
36eb9bde
CLG
37
38lxc_log_define(lxc_restart, lxc);
925aaa31 39
196f1d54
CLG
40struct restart_args {
41 int sfd;
42 int flags;
43};
44
45static int restart(struct lxc_handler *handler, void* data)
925aaa31 46{
196f1d54
CLG
47 struct restart_args *arg __attribute__ ((unused)) = data;
48
9b8e796c
MN
49 ERROR("'restart' function not implemented");
50 return -1;
925aaa31 51}
196f1d54
CLG
52
53static int post_restart(struct lxc_handler *handler, void* data)
54{
55 struct restart_args *arg __attribute__ ((unused)) = data;
56
57 NOTICE("'%s' container restarting with pid '%d'", handler->name,
58 handler->pid);
59 return 0;
60}
61
62static struct lxc_operations restart_ops = {
63 .start = restart,
64 .post_start = post_restart
65};
66
67int lxc_restart(const char *name, int sfd, struct lxc_conf *conf, int flags)
68{
69 struct restart_args restart_arg = {
70 .sfd = sfd,
71 .flags = flags
72 };
73
b119f362 74 if (lxc_check_inherited(conf, sfd))
196f1d54
CLG
75 return -1;
76
77 return __lxc_start(name, conf, &restart_ops, &restart_arg);
78}