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
4e5440c6
Commit
4e5440c6
authored
Oct 09, 2009
by
Daniel Lezcano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use the configuration structure to setup the utsname
Use the configuration structure, not the directory configuration Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
c69bd12f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
37 deletions
+7
-37
conf.c
src/lxc/conf.c
+7
-37
No files found.
src/lxc/conf.c
View file @
4e5440c6
...
@@ -330,20 +330,6 @@ out_link:
...
@@ -330,20 +330,6 @@ out_link:
goto
out
;
goto
out
;
}
}
static
int
configure_utsname
(
const
char
*
name
,
struct
utsname
*
utsname
)
{
char
path
[
MAXPATHLEN
];
snprintf
(
path
,
MAXPATHLEN
,
LXCPATH
"/%s"
,
name
);
if
(
write_info
(
path
,
"utsname"
,
utsname
->
nodename
))
{
ERROR
(
"failed to write the utsname info"
);
return
-
1
;
}
return
0
;
}
static
int
configure_network
(
const
char
*
name
,
struct
lxc_list
*
network
)
static
int
configure_network
(
const
char
*
name
,
struct
lxc_list
*
network
)
{
{
struct
lxc_list
*
iterator
;
struct
lxc_list
*
iterator
;
...
@@ -785,28 +771,17 @@ static int unconfigure_utsname(const char *name)
...
@@ -785,28 +771,17 @@ static int unconfigure_utsname(const char *name)
return
0
;
return
0
;
}
}
static
int
setup_utsname
(
const
char
*
name
)
static
int
setup_utsname
(
struct
utsname
*
uts
name
)
{
{
int
ret
;
if
(
!
utsname
)
char
path
[
MAXPATHLEN
];
return
0
;
struct
utsname
utsname
;
snprintf
(
path
,
MAXPATHLEN
,
LXCPATH
"/%s"
,
name
);
ret
=
read_info
(
path
,
"utsname"
,
utsname
.
nodename
,
sizeof
(
utsname
.
nodename
));
if
(
ret
<
0
)
{
SYSERROR
(
"failed to read utsname info"
);
return
-
1
;
}
if
(
!
ret
&&
sethostname
(
utsname
.
nodename
,
strlen
(
utsname
.
nodename
)))
{
if
(
sethostname
(
utsname
->
nodename
,
strlen
(
utsname
->
nodename
)))
{
SYSERROR
(
"failed to set the hostname to '%s'"
,
SYSERROR
(
"failed to set the hostname to '%s'"
,
utsname
->
nodename
);
utsname
.
nodename
);
return
-
1
;
return
-
1
;
}
}
INFO
(
"'%s' hostname has been setup"
,
utsname
.
nodename
);
INFO
(
"'%s' hostname has been setup"
,
utsname
->
nodename
);
return
0
;
return
0
;
}
}
...
@@ -1430,11 +1405,6 @@ int lxc_configure(const char *name, struct lxc_conf *conf)
...
@@ -1430,11 +1405,6 @@ int lxc_configure(const char *name, struct lxc_conf *conf)
if
(
!
conf
)
if
(
!
conf
)
return
0
;
return
0
;
if
(
conf
->
utsname
&&
configure_utsname
(
name
,
conf
->
utsname
))
{
ERROR
(
"failed to configure the utsname"
);
return
-
1
;
}
if
(
configure_cgroup
(
name
,
&
conf
->
cgroup
))
{
if
(
configure_cgroup
(
name
,
&
conf
->
cgroup
))
{
ERROR
(
"failed to configure the control group"
);
ERROR
(
"failed to configure the control group"
);
return
-
1
;
return
-
1
;
...
@@ -1846,7 +1816,7 @@ int lxc_setup(const char *name, const char *cons,
...
@@ -1846,7 +1816,7 @@ int lxc_setup(const char *name, const char *cons,
}
}
}
}
if
(
lxc_conf
.
utsname
&&
setup_utsname
(
name
))
{
if
(
setup_utsname
(
lxc_conf
.
uts
name
))
{
ERROR
(
"failed to setup the utsname for '%s'"
,
name
);
ERROR
(
"failed to setup the utsname for '%s'"
,
name
);
return
-
1
;
return
-
1
;
}
}
...
...
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