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
b4242db0
Unverified
Commit
b4242db0
authored
Mar 15, 2020
by
Stéphane Graber
Committed by
GitHub
Mar 15, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3295 from brauner/2020-03-15/fixes
smaller cleanups and simplifications
parents
1f423252
fd5be714
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
64 additions
and
72 deletions
+64
-72
conf.c
src/lxc/conf.c
+4
-4
criu.c
src/lxc/criu.c
+3
-3
execute.c
src/lxc/execute.c
+1
-1
lxc.h
src/lxc/lxc.h
+2
-4
lxccontainer.c
src/lxc/lxccontainer.c
+2
-2
start.c
src/lxc/start.c
+48
-53
start.h
src/lxc/start.h
+4
-5
No files found.
src/lxc/conf.c
View file @
b4242db0
...
@@ -941,13 +941,13 @@ int lxc_allocate_ttys(struct lxc_conf *conf)
...
@@ -941,13 +941,13 @@ int lxc_allocate_ttys(struct lxc_conf *conf)
/* Prevent leaking the file descriptors to the container */
/* Prevent leaking the file descriptors to the container */
ret
=
fd_cloexec
(
tty
->
master
,
true
);
ret
=
fd_cloexec
(
tty
->
master
,
true
);
if
(
ret
<
0
)
if
(
ret
<
0
)
SYSWARN
(
"Failed to set FD_CLOEXEC flag on master fd %d of
"
SYSWARN
(
"Failed to set FD_CLOEXEC flag on master fd %d of
tty device
\"
%s
\"
"
,
"tty device
\"
%s
\"
"
,
tty
->
master
,
tty
->
name
);
tty
->
master
,
tty
->
name
);
ret
=
fd_cloexec
(
tty
->
slave
,
true
);
ret
=
fd_cloexec
(
tty
->
slave
,
true
);
if
(
ret
<
0
)
if
(
ret
<
0
)
SYSWARN
(
"Failed to set FD_CLOEXEC flag on slave fd %d of
"
SYSWARN
(
"Failed to set FD_CLOEXEC flag on slave fd %d of
tty device
\"
%s
\"
"
,
"tty device
\"
%s
\"
"
,
tty
->
slave
,
tty
->
name
);
tty
->
slave
,
tty
->
name
);
tty
->
busy
=
-
1
;
tty
->
busy
=
-
1
;
}
}
...
...
src/lxc/criu.c
View file @
b4242db0
...
@@ -1134,8 +1134,8 @@ static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_
...
@@ -1134,8 +1134,8 @@ static void do_restore(struct lxc_container *c, int status_pipe, struct migrate_
ret
=
lxc_poll
(
c
->
name
,
handler
);
ret
=
lxc_poll
(
c
->
name
,
handler
);
if
(
ret
)
if
(
ret
)
lxc_abort
(
c
->
name
,
handler
);
lxc_abort
(
handler
);
lxc_
fini
(
c
->
name
,
handler
);
lxc_
end
(
handler
);
_exit
(
ret
);
_exit
(
ret
);
}
}
...
@@ -1145,7 +1145,7 @@ out_fini_handler:
...
@@ -1145,7 +1145,7 @@ out_fini_handler:
if
(
pipes
[
1
]
>=
0
)
if
(
pipes
[
1
]
>=
0
)
close
(
pipes
[
1
]);
close
(
pipes
[
1
]);
lxc_
fini
(
c
->
name
,
handler
);
lxc_
end
(
handler
);
out:
out:
if
(
status_pipe
>=
0
)
{
if
(
status_pipe
>=
0
)
{
...
...
src/lxc/execute.c
View file @
b4242db0
...
@@ -96,6 +96,6 @@ int lxc_execute(const char *name, char *const argv[], int quiet,
...
@@ -96,6 +96,6 @@ int lxc_execute(const char *name, char *const argv[], int quiet,
TRACE
(
"Doing lxc_execute"
);
TRACE
(
"Doing lxc_execute"
);
handler
->
conf
->
is_execute
=
true
;
handler
->
conf
->
is_execute
=
true
;
return
__lxc_start
(
name
,
handler
,
&
execute_start_ops
,
&
args
,
lxcpath
,
return
__lxc_start
(
handler
,
&
execute_start_ops
,
&
args
,
lxcpath
,
daemonize
,
error_num
);
daemonize
,
error_num
);
}
}
src/lxc/lxc.h
View file @
b4242db0
...
@@ -27,15 +27,13 @@ struct lxc_handler;
...
@@ -27,15 +27,13 @@ struct lxc_handler;
/*
/*
* Start the specified command inside a system container
* Start the specified command inside a system container
* @name : the name of the container
* @argv : an array of char * corresponding to the command line
* @argv : an array of char * corresponding to the command line
* @conf : configuration
* @conf : configuration
* @daemonize : whether or not the container is daemonized
* @daemonize : whether or not the container is daemonized
* Returns 0 on success, < 0 otherwise
* Returns 0 on success, < 0 otherwise
*/
*/
extern
int
lxc_start
(
const
char
*
name
,
char
*
const
argv
[],
extern
int
lxc_start
(
char
*
const
argv
[],
struct
lxc_handler
*
handler
,
struct
lxc_handler
*
handler
,
const
char
*
lxcpath
,
const
char
*
lxcpath
,
bool
daemonize
,
int
*
error_num
);
bool
daemonize
,
int
*
error_num
);
/*
/*
* Start the specified command inside an application container
* Start the specified command inside an application container
...
...
src/lxc/lxccontainer.c
View file @
b4242db0
...
@@ -1117,8 +1117,8 @@ reboot:
...
@@ -1117,8 +1117,8 @@ reboot:
ret
=
lxc_execute
(
c
->
name
,
argv
,
1
,
handler
,
c
->
config_path
,
ret
=
lxc_execute
(
c
->
name
,
argv
,
1
,
handler
,
c
->
config_path
,
c
->
daemonize
,
&
c
->
error_num
);
c
->
daemonize
,
&
c
->
error_num
);
else
else
ret
=
lxc_start
(
c
->
name
,
argv
,
handler
,
c
->
config_path
,
ret
=
lxc_start
(
argv
,
handler
,
c
->
config_path
,
c
->
daemonize
,
c
->
daemonize
,
&
c
->
error_num
);
&
c
->
error_num
);
if
(
conf
->
reboot
==
REBOOT_REQ
)
{
if
(
conf
->
reboot
==
REBOOT_REQ
)
{
INFO
(
"Container requested reboot"
);
INFO
(
"Container requested reboot"
);
...
...
src/lxc/start.c
View file @
b4242db0
...
@@ -731,27 +731,21 @@ int lxc_init(const char *name, struct lxc_handler *handler)
...
@@ -731,27 +731,21 @@ int lxc_init(const char *name, struct lxc_handler *handler)
handler
->
monitor_pid
=
lxc_raw_getpid
();
handler
->
monitor_pid
=
lxc_raw_getpid
();
status_fd
=
open
(
"/proc/self/status"
,
O_RDONLY
|
O_CLOEXEC
);
status_fd
=
open
(
"/proc/self/status"
,
O_RDONLY
|
O_CLOEXEC
);
if
(
status_fd
<
0
)
{
if
(
status_fd
<
0
)
SYSERROR
(
"Failed to open monitor status fd"
);
return
log_error_errno
(
-
1
,
errno
,
"Failed to open monitor status fd"
);
goto
out_close_maincmd_fd
;
}
lsm_init
();
lsm_init
();
TRACE
(
"Initialized LSM"
);
TRACE
(
"Initialized LSM"
);
ret
=
lxc_read_seccomp_config
(
conf
);
ret
=
lxc_read_seccomp_config
(
conf
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
ERROR
(
"Failed loading seccomp policy"
);
return
log_error
(
-
1
,
"Failed loading seccomp policy"
);
goto
out_close_maincmd_fd
;
}
TRACE
(
"Read seccomp policy"
);
TRACE
(
"Read seccomp policy"
);
/* Begin by setting the state to STARTING. */
/* Begin by setting the state to STARTING. */
ret
=
lxc_set_state
(
name
,
handler
,
STARTING
);
ret
=
lxc_set_state
(
name
,
handler
,
STARTING
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
ERROR
(
"Failed to set state to
\"
%s
\"
"
,
lxc_state2str
(
STARTING
));
return
log_error
(
-
1
,
"Failed to set state to
\"
%s
\"
"
,
lxc_state2str
(
STARTING
));
goto
out_close_maincmd_fd
;
}
TRACE
(
"Set container state to
\"
STARTING
\"
"
);
TRACE
(
"Set container state to
\"
STARTING
\"
"
);
/* Start of environment variable setup for hooks. */
/* Start of environment variable setup for hooks. */
...
@@ -811,10 +805,8 @@ int lxc_init(const char *name, struct lxc_handler *handler)
...
@@ -811,10 +805,8 @@ int lxc_init(const char *name, struct lxc_handler *handler)
TRACE
(
"Set environment variables"
);
TRACE
(
"Set environment variables"
);
ret
=
run_lxc_hooks
(
name
,
"pre-start"
,
conf
,
NULL
);
ret
=
run_lxc_hooks
(
name
,
"pre-start"
,
conf
,
NULL
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
ERROR
(
"Failed to run lxc.hook.pre-start for container
\"
%s
\"
"
,
name
);
return
log_error
(
-
1
,
"Failed to run lxc.hook.pre-start for container
\"
%s
\"
"
,
name
);
goto
out_aborting
;
}
TRACE
(
"Ran pre-start hooks"
);
TRACE
(
"Ran pre-start hooks"
);
/* The signal fd has to be created before forking otherwise if the child
/* The signal fd has to be created before forking otherwise if the child
...
@@ -822,10 +814,8 @@ int lxc_init(const char *name, struct lxc_handler *handler)
...
@@ -822,10 +814,8 @@ int lxc_init(const char *name, struct lxc_handler *handler)
* and the command will be stuck.
* and the command will be stuck.
*/
*/
handler
->
sigfd
=
setup_signal_fd
(
&
handler
->
oldmask
);
handler
->
sigfd
=
setup_signal_fd
(
&
handler
->
oldmask
);
if
(
handler
->
sigfd
<
0
)
{
if
(
handler
->
sigfd
<
0
)
ERROR
(
"Failed to setup SIGCHLD fd handler."
);
return
log_error
(
-
1
,
"Failed to setup SIGCHLD fd handler."
);
goto
out_delete_tty
;
}
TRACE
(
"Set up signal fd"
);
TRACE
(
"Set up signal fd"
);
/* Do this after setting up signals since it might unblock SIGWINCH. */
/* Do this after setting up signals since it might unblock SIGWINCH. */
...
@@ -867,24 +857,17 @@ out_delete_terminal:
...
@@ -867,24 +857,17 @@ out_delete_terminal:
out_restore_sigmask:
out_restore_sigmask:
(
void
)
pthread_sigmask
(
SIG_SETMASK
,
&
handler
->
oldmask
,
NULL
);
(
void
)
pthread_sigmask
(
SIG_SETMASK
,
&
handler
->
oldmask
,
NULL
);
out_delete_tty:
lxc_delete_tty
(
&
conf
->
ttys
);
out_aborting:
(
void
)
lxc_set_state
(
name
,
handler
,
ABORTING
);
out_close_maincmd_fd:
close_prot_errno_disarm
(
conf
->
maincmd_fd
);
return
-
1
;
return
-
1
;
}
}
void
lxc_
fini
(
const
char
*
name
,
struct
lxc_handler
*
handler
)
void
lxc_
end
(
struct
lxc_handler
*
handler
)
{
{
int
ret
;
int
ret
;
pid_t
self
;
pid_t
self
;
struct
lxc_list
*
cur
,
*
next
;
struct
lxc_list
*
cur
,
*
next
;
char
*
namespaces
[
LXC_NS_MAX
+
1
];
char
*
namespaces
[
LXC_NS_MAX
+
1
];
size_t
namespace_count
=
0
;
size_t
namespace_count
=
0
;
const
char
*
name
=
handler
->
name
;
struct
cgroup_ops
*
cgroup_ops
=
handler
->
cgroup_ops
;
struct
cgroup_ops
*
cgroup_ops
=
handler
->
cgroup_ops
;
/* The STOPPING state is there for future cleanup code which can take
/* The STOPPING state is there for future cleanup code which can take
...
@@ -977,6 +960,7 @@ void lxc_fini(const char *name, struct lxc_handler *handler)
...
@@ -977,6 +960,7 @@ void lxc_fini(const char *name, struct lxc_handler *handler)
TRACE
(
"Set container state to
\"
STOPPED
\"
"
);
TRACE
(
"Set container state to
\"
STOPPED
\"
"
);
}
else
{
}
else
{
lxc_set_state
(
name
,
handler
,
STOPPED
);
lxc_set_state
(
name
,
handler
,
STOPPED
);
TRACE
(
"Set container state to
\"
STOPPED
\"
"
);
}
}
/* Avoid lingering namespace references. */
/* Avoid lingering namespace references. */
...
@@ -1027,12 +1011,12 @@ void lxc_fini(const char *name, struct lxc_handler *handler)
...
@@ -1027,12 +1011,12 @@ void lxc_fini(const char *name, struct lxc_handler *handler)
lxc_free_handler
(
handler
);
lxc_free_handler
(
handler
);
}
}
void
lxc_abort
(
const
char
*
name
,
struct
lxc_handler
*
handler
)
void
lxc_abort
(
struct
lxc_handler
*
handler
)
{
{
int
ret
=
0
;
int
ret
=
0
;
int
status
;
int
status
;
lxc_set_state
(
name
,
handler
,
ABORTING
);
lxc_set_state
(
handler
->
name
,
handler
,
ABORTING
);
if
(
handler
->
pidfd
>=
0
)
{
if
(
handler
->
pidfd
>=
0
)
{
ret
=
lxc_raw_pidfd_send_signal
(
handler
->
pidfd
,
SIGKILL
,
NULL
,
0
);
ret
=
lxc_raw_pidfd_send_signal
(
handler
->
pidfd
,
SIGKILL
,
NULL
,
0
);
...
@@ -1041,7 +1025,7 @@ void lxc_abort(const char *name, struct lxc_handler *handler)
...
@@ -1041,7 +1025,7 @@ void lxc_abort(const char *name, struct lxc_handler *handler)
handler
->
pidfd
,
handler
->
pid
);
handler
->
pidfd
,
handler
->
pid
);
}
}
if
(
!
ret
||
errno
!=
ESRCH
)
if
(
(
!
ret
||
errno
!=
ESRCH
)
&&
handler
->
pid
>
0
)
if
(
kill
(
handler
->
pid
,
SIGKILL
))
if
(
kill
(
handler
->
pid
,
SIGKILL
))
SYSWARN
(
"Failed to send SIGKILL to %d"
,
handler
->
pid
);
SYSWARN
(
"Failed to send SIGKILL to %d"
,
handler
->
pid
);
...
@@ -1887,7 +1871,7 @@ out_delete_net:
...
@@ -1887,7 +1871,7 @@ out_delete_net:
lxc_delete_network
(
handler
);
lxc_delete_network
(
handler
);
out_abort:
out_abort:
lxc_abort
(
name
,
handler
);
lxc_abort
(
handler
);
out_sync_fini:
out_sync_fini:
lxc_sync_fini
(
handler
);
lxc_sync_fini
(
handler
);
...
@@ -1896,18 +1880,18 @@ out_sync_fini:
...
@@ -1896,18 +1880,18 @@ out_sync_fini:
return
-
1
;
return
-
1
;
}
}
int
__lxc_start
(
const
char
*
name
,
struct
lxc_handler
*
handler
,
int
__lxc_start
(
struct
lxc_handler
*
handler
,
struct
lxc_operations
*
ops
,
struct
lxc_operations
*
ops
,
void
*
data
,
const
char
*
lxcpath
,
void
*
data
,
const
char
*
lxcpath
,
bool
daemonize
,
int
*
error_num
)
bool
daemonize
,
int
*
error_num
)
{
{
int
ret
,
status
;
int
ret
,
status
;
const
char
*
name
=
handler
->
name
;
struct
lxc_conf
*
conf
=
handler
->
conf
;
struct
lxc_conf
*
conf
=
handler
->
conf
;
struct
cgroup_ops
*
cgroup_ops
;
struct
cgroup_ops
*
cgroup_ops
;
ret
=
lxc_init
(
name
,
handler
);
ret
=
lxc_init
(
name
,
handler
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
ERROR
(
"Failed to initialize container
\"
%s
\"
"
,
name
);
ERROR
(
"Failed to initialize container
\"
%s
\"
"
,
name
);
goto
out_
fini_none
t
;
goto
out_
abor
t
;
}
}
handler
->
ops
=
ops
;
handler
->
ops
=
ops
;
handler
->
data
=
data
;
handler
->
data
=
data
;
...
@@ -1917,25 +1901,25 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
...
@@ -1917,25 +1901,25 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
if
(
!
attach_block_device
(
handler
->
conf
))
{
if
(
!
attach_block_device
(
handler
->
conf
))
{
ERROR
(
"Failed to attach block device"
);
ERROR
(
"Failed to attach block device"
);
ret
=
-
1
;
ret
=
-
1
;
goto
out_
fini_none
t
;
goto
out_
abor
t
;
}
}
if
(
!
cgroup_ops
->
monitor_create
(
cgroup_ops
,
handler
))
{
if
(
!
cgroup_ops
->
monitor_create
(
cgroup_ops
,
handler
))
{
ERROR
(
"Failed to create monitor cgroup"
);
ERROR
(
"Failed to create monitor cgroup"
);
ret
=
-
1
;
ret
=
-
1
;
goto
out_
fini_none
t
;
goto
out_
abor
t
;
}
}
if
(
!
cgroup_ops
->
monitor_enter
(
cgroup_ops
,
handler
))
{
if
(
!
cgroup_ops
->
monitor_enter
(
cgroup_ops
,
handler
))
{
ERROR
(
"Failed to enter monitor cgroup"
);
ERROR
(
"Failed to enter monitor cgroup"
);
ret
=
-
1
;
ret
=
-
1
;
goto
out_
fini_none
t
;
goto
out_
abor
t
;
}
}
if
(
!
cgroup_ops
->
monitor_delegate_controllers
(
cgroup_ops
))
{
if
(
!
cgroup_ops
->
monitor_delegate_controllers
(
cgroup_ops
))
{
ERROR
(
"Failed to delegate controllers to monitor cgroup"
);
ERROR
(
"Failed to delegate controllers to monitor cgroup"
);
ret
=
-
1
;
ret
=
-
1
;
goto
out_
fini_none
t
;
goto
out_
abor
t
;
}
}
if
(
geteuid
()
==
0
&&
!
lxc_list_empty
(
&
conf
->
id_map
))
{
if
(
geteuid
()
==
0
&&
!
lxc_list_empty
(
&
conf
->
id_map
))
{
...
@@ -1944,7 +1928,7 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
...
@@ -1944,7 +1928,7 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
ret
=
unshare
(
CLONE_NEWNS
);
ret
=
unshare
(
CLONE_NEWNS
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
ERROR
(
"Failed to unshare CLONE_NEWNS"
);
ERROR
(
"Failed to unshare CLONE_NEWNS"
);
goto
out_
fini_none
t
;
goto
out_
abor
t
;
}
}
INFO
(
"Unshared CLONE_NEWNS"
);
INFO
(
"Unshared CLONE_NEWNS"
);
...
@@ -1952,7 +1936,7 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
...
@@ -1952,7 +1936,7 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
ret
=
lxc_setup_rootfs_prepare_root
(
conf
,
name
,
lxcpath
);
ret
=
lxc_setup_rootfs_prepare_root
(
conf
,
name
,
lxcpath
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
ERROR
(
"Error setting up rootfs mount as root before spawn"
);
ERROR
(
"Error setting up rootfs mount as root before spawn"
);
goto
out_
fini_none
t
;
goto
out_
abor
t
;
}
}
INFO
(
"Set up container rootfs as host root"
);
INFO
(
"Set up container rootfs as host root"
);
}
}
...
@@ -1969,13 +1953,13 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
...
@@ -1969,13 +1953,13 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
ret
=
lxc_poll
(
name
,
handler
);
ret
=
lxc_poll
(
name
,
handler
);
if
(
ret
)
{
if
(
ret
)
{
ERROR
(
"LXC mainloop exited with error: %d"
,
ret
);
ERROR
(
"LXC mainloop exited with error: %d"
,
ret
);
goto
out_
abort
;
goto
out_
delete_network
;
}
}
if
(
!
handler
->
init_died
&&
handler
->
pid
>
0
)
{
if
(
!
handler
->
init_died
&&
handler
->
pid
>
0
)
{
ERROR
(
"Child process is not killed"
);
ERROR
(
"Child process is not killed"
);
ret
=
-
1
;
ret
=
-
1
;
goto
out_
abort
;
goto
out_
delete_network
;
}
}
status
=
lxc_wait_for_pid_status
(
handler
->
pid
);
status
=
lxc_wait_for_pid_status
(
handler
->
pid
);
...
@@ -2015,19 +1999,30 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
...
@@ -2015,19 +1999,30 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
if
(
error_num
)
if
(
error_num
)
*
error_num
=
handler
->
exit_status
;
*
error_num
=
handler
->
exit_status
;
out_fini:
/* These are not the droids you are looking for. */
__private_goto1:
lxc_delete_network
(
handler
);
lxc_delete_network
(
handler
);
out_detach_blockdev
:
__private_goto2
:
detach_block_device
(
handler
->
conf
);
detach_block_device
(
handler
->
conf
);
out_fini_nonet:
__private_goto3:
lxc_fini
(
name
,
handler
);
lxc_end
(
handler
);
return
ret
;
return
ret
;
/* These are the droids you are looking for. */
out_abort:
out_abort:
lxc_abort
(
name
,
handler
);
lxc_abort
(
handler
);
goto
out_fini
;
goto
__private_goto3
;
out_detach_blockdev:
lxc_abort
(
handler
);
goto
__private_goto2
;
out_delete_network:
lxc_abort
(
handler
);
goto
__private_goto1
;
}
}
struct
start_args
{
struct
start_args
{
...
@@ -2058,7 +2053,7 @@ static struct lxc_operations start_ops = {
...
@@ -2058,7 +2053,7 @@ static struct lxc_operations start_ops = {
.
post_start
=
post_start
.
post_start
=
post_start
};
};
int
lxc_start
(
c
onst
char
*
name
,
c
har
*
const
argv
[],
struct
lxc_handler
*
handler
,
int
lxc_start
(
char
*
const
argv
[],
struct
lxc_handler
*
handler
,
const
char
*
lxcpath
,
bool
daemonize
,
int
*
error_num
)
const
char
*
lxcpath
,
bool
daemonize
,
int
*
error_num
)
{
{
struct
start_args
start_arg
=
{
struct
start_args
start_arg
=
{
...
@@ -2066,7 +2061,7 @@ int lxc_start(const char *name, char *const argv[], struct lxc_handler *handler,
...
@@ -2066,7 +2061,7 @@ int lxc_start(const char *name, char *const argv[], struct lxc_handler *handler,
};
};
TRACE
(
"Doing lxc_start"
);
TRACE
(
"Doing lxc_start"
);
return
__lxc_start
(
name
,
handler
,
&
start_ops
,
&
start_arg
,
lxcpath
,
daemonize
,
error_num
);
return
__lxc_start
(
handler
,
&
start_ops
,
&
start_arg
,
lxcpath
,
daemonize
,
error_num
);
}
}
static
void
lxc_destroy_container_on_signal
(
struct
lxc_handler
*
handler
,
static
void
lxc_destroy_container_on_signal
(
struct
lxc_handler
*
handler
,
...
...
src/lxc/start.h
View file @
b4242db0
...
@@ -142,7 +142,7 @@ extern int lxc_set_state(const char *name, struct lxc_handler *handler,
...
@@ -142,7 +142,7 @@ extern int lxc_set_state(const char *name, struct lxc_handler *handler,
extern
int
lxc_serve_state_clients
(
const
char
*
name
,
extern
int
lxc_serve_state_clients
(
const
char
*
name
,
struct
lxc_handler
*
handler
,
struct
lxc_handler
*
handler
,
lxc_state_t
state
);
lxc_state_t
state
);
extern
void
lxc_abort
(
const
char
*
name
,
struct
lxc_handler
*
handler
);
extern
void
lxc_abort
(
struct
lxc_handler
*
handler
);
extern
struct
lxc_handler
*
lxc_init_handler
(
const
char
*
name
,
extern
struct
lxc_handler
*
lxc_init_handler
(
const
char
*
name
,
struct
lxc_conf
*
conf
,
struct
lxc_conf
*
conf
,
const
char
*
lxcpath
,
const
char
*
lxcpath
,
...
@@ -150,7 +150,7 @@ extern struct lxc_handler *lxc_init_handler(const char *name,
...
@@ -150,7 +150,7 @@ extern struct lxc_handler *lxc_init_handler(const char *name,
extern
void
lxc_zero_handler
(
struct
lxc_handler
*
handler
);
extern
void
lxc_zero_handler
(
struct
lxc_handler
*
handler
);
extern
void
lxc_free_handler
(
struct
lxc_handler
*
handler
);
extern
void
lxc_free_handler
(
struct
lxc_handler
*
handler
);
extern
int
lxc_init
(
const
char
*
name
,
struct
lxc_handler
*
handler
);
extern
int
lxc_init
(
const
char
*
name
,
struct
lxc_handler
*
handler
);
extern
void
lxc_
fini
(
const
char
*
name
,
struct
lxc_handler
*
handler
);
extern
void
lxc_
end
(
struct
lxc_handler
*
handler
);
/* lxc_check_inherited: Check for any open file descriptors and close them if
/* lxc_check_inherited: Check for any open file descriptors and close them if
* requested.
* requested.
...
@@ -161,9 +161,8 @@ extern void lxc_fini(const char *name, struct lxc_handler *handler);
...
@@ -161,9 +161,8 @@ extern void lxc_fini(const char *name, struct lxc_handler *handler);
*/
*/
extern
int
lxc_check_inherited
(
struct
lxc_conf
*
conf
,
bool
closeall
,
extern
int
lxc_check_inherited
(
struct
lxc_conf
*
conf
,
bool
closeall
,
int
*
fds_to_ignore
,
size_t
len_fds
);
int
*
fds_to_ignore
,
size_t
len_fds
);
extern
int
__lxc_start
(
const
char
*
,
struct
lxc_handler
*
,
extern
int
__lxc_start
(
struct
lxc_handler
*
,
struct
lxc_operations
*
,
void
*
,
struct
lxc_operations
*
,
void
*
,
const
char
*
,
bool
,
const
char
*
,
bool
,
int
*
);
int
*
);
extern
int
resolve_clone_flags
(
struct
lxc_handler
*
handler
);
extern
int
resolve_clone_flags
(
struct
lxc_handler
*
handler
);
...
...
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