Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
196f1d54
Commit
196f1d54
authored
Jun 01, 2010
by
Cedric Le Goater
Committed by
Daniel Lezcano
Jun 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add restart framework
Signed-off-by:
Cedric Le Goater
<
clg@fr.ibm.com
>
Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
fac80c8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
2 deletions
+47
-2
restart.c
src/lxc/restart.c
+47
-2
No files found.
src/lxc/restart.c
View file @
196f1d54
...
@@ -20,13 +20,58 @@
...
@@ -20,13 +20,58 @@
* 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
*/
*/
#include <lxc/lxc.h>
#include "../config.h"
#include <stdio.h>
#undef _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <lxc/log.h>
#include <lxc/log.h>
#include <lxc/start.h>
/* for struct lxc_handler */
#include <lxc/utils.h>
#include <lxc/error.h>
lxc_log_define
(
lxc_restart
,
lxc
);
lxc_log_define
(
lxc_restart
,
lxc
);
int
lxc_restart
(
const
char
*
name
,
int
sfd
,
struct
lxc_conf
*
conf
,
int
flags
)
struct
restart_args
{
int
sfd
;
int
flags
;
};
static
int
restart
(
struct
lxc_handler
*
handler
,
void
*
data
)
{
{
struct
restart_args
*
arg
__attribute__
((
unused
))
=
data
;
ERROR
(
"'restart' function not implemented"
);
ERROR
(
"'restart' function not implemented"
);
return
-
1
;
return
-
1
;
}
}
static
int
post_restart
(
struct
lxc_handler
*
handler
,
void
*
data
)
{
struct
restart_args
*
arg
__attribute__
((
unused
))
=
data
;
NOTICE
(
"'%s' container restarting with pid '%d'"
,
handler
->
name
,
handler
->
pid
);
return
0
;
}
static
struct
lxc_operations
restart_ops
=
{
.
start
=
restart
,
.
post_start
=
post_restart
};
int
lxc_restart
(
const
char
*
name
,
int
sfd
,
struct
lxc_conf
*
conf
,
int
flags
)
{
struct
restart_args
restart_arg
=
{
.
sfd
=
sfd
,
.
flags
=
flags
};
if
(
lxc_check_inherited
(
sfd
))
return
-
1
;
return
__lxc_start
(
name
,
conf
,
&
restart_ops
,
&
restart_arg
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment