2 * lxc: linux Container library
4 * (C) Copyright IBM Corp. 2007, 2010
7 * Daniel Lezcano <dlezcano at fr.ibm.com>
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.
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.
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
34 #include <lxc/start.h> /* for struct lxc_handler */
35 #include <lxc/utils.h>
36 #include <lxc/error.h>
38 lxc_log_define(lxc_restart
, lxc
);
45 static int restart(struct lxc_handler
*handler
, void* data
)
47 struct restart_args
*arg
__attribute__ ((unused
)) = data
;
49 ERROR("'restart' function not implemented");
53 static int post_restart(struct lxc_handler
*handler
, void* data
)
55 struct restart_args
*arg
__attribute__ ((unused
)) = data
;
57 NOTICE("'%s' container restarting with pid '%d'", handler
->name
,
62 static struct lxc_operations restart_ops
= {
64 .post_start
= post_restart
67 int lxc_restart(const char *name
, int sfd
, struct lxc_conf
*conf
, int flags
)
69 struct restart_args restart_arg
= {
74 if (lxc_check_inherited(conf
, sfd
))
77 return __lxc_start(name
, conf
, &restart_ops
, &restart_arg
);