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
58a44782
Commit
58a44782
authored
May 27, 2016
by
Aleksandr Mezin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python-lxc: don't use private lxc/confile.h
Signed-off-by:
Aleksandr Mezin
<
mezin.alexander@gmail.com
>
parent
0fbd2f6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
1 deletion
+34
-1
lxc.c
src/python-lxc/lxc.c
+34
-1
No files found.
src/python-lxc/lxc.c
View file @
58a44782
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
#include <Python.h>
#include <Python.h>
#include "structmember.h"
#include "structmember.h"
#include <lxc/lxccontainer.h>
#include <lxc/lxccontainer.h>
#include "lxc/confile.h"
#include <stdio.h>
#include <stdio.h>
#include <sys/wait.h>
#include <sys/wait.h>
#include <sched.h>
#include <sched.h>
...
@@ -58,6 +57,10 @@
...
@@ -58,6 +57,10 @@
# define CLONE_NEWNET 0x40000000
# define CLONE_NEWNET 0x40000000
#endif
#endif
/* From sys/personality.h */
#define PER_LINUX 0x0000
#define PER_LINUX32 0x0008
/* Helper functions */
/* Helper functions */
/* Copied from lxc/utils.c */
/* Copied from lxc/utils.c */
...
@@ -77,6 +80,36 @@ again:
...
@@ -77,6 +80,36 @@ again:
return
status
;
return
status
;
}
}
/* Copied from lxc/confile.c, with HAVE_SYS_PERSONALITY_H check removed */
signed
long
lxc_config_parse_arch
(
const
char
*
arch
)
{
struct
per_name
{
char
*
name
;
unsigned
long
per
;
}
pername
[]
=
{
{
"x86"
,
PER_LINUX32
},
{
"linux32"
,
PER_LINUX32
},
{
"i386"
,
PER_LINUX32
},
{
"i486"
,
PER_LINUX32
},
{
"i586"
,
PER_LINUX32
},
{
"i686"
,
PER_LINUX32
},
{
"athlon"
,
PER_LINUX32
},
{
"linux64"
,
PER_LINUX
},
{
"x86_64"
,
PER_LINUX
},
{
"amd64"
,
PER_LINUX
},
};
size_t
len
=
sizeof
(
pername
)
/
sizeof
(
pername
[
0
]);
size_t
i
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
if
(
!
strcmp
(
pername
[
i
].
name
,
arch
))
return
pername
[
i
].
per
;
}
return
-
1
;
}
char
**
char
**
convert_tuple_to_char_pointer_array
(
PyObject
*
argv
)
{
convert_tuple_to_char_pointer_array
(
PyObject
*
argv
)
{
int
argc
;
int
argc
;
...
...
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