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
7d1fe1ff
Unverified
Commit
7d1fe1ff
authored
Feb 25, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: port lxc_cmd_add_bpf_device_cgropu() to new helpers
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
7c9845b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
commands.c
src/lxc/commands.c
+10
-11
No files found.
src/lxc/commands.c
View file @
7d1fe1ff
...
...
@@ -1328,22 +1328,21 @@ int lxc_cmd_add_bpf_device_cgroup(const char *name, const char *lxcpath,
struct
device_item
*
device
)
{
bool
stopped
=
false
;
struct
lxc_cmd_rr
cmd
=
{
.
req
=
{
.
cmd
=
LXC_CMD_ADD_BPF_DEVICE_CGROUP
,
.
data
=
device
,
.
datalen
=
sizeof
(
struct
device_item
),
},
};
int
ret
;
struct
lxc_cmd_rr
cmd
;
if
(
strlen
(
device
->
access
)
>
STRLITERALLEN
(
"rwm"
))
return
log_error_errno
(
-
1
,
EINVAL
,
"Invalid access mode specified %s"
,
device
->
access
);
return
syserrno_set
(
-
EINVAL
,
"Invalid access mode specified %s"
,
device
->
access
);
lxc_cmd_init
(
&
cmd
,
LXC_CMD_ADD_BPF_DEVICE_CGROUP
);
lxc_cmd_data
(
&
cmd
,
sizeof
(
struct
device_item
),
device
);
ret
=
lxc_cmd
(
name
,
&
cmd
,
&
stopped
,
lxcpath
,
NULL
);
if
(
ret
<
0
||
cmd
.
rsp
.
ret
<
0
)
return
log_error_errno
(
-
1
,
errno
,
"Failed to add new bpf device cgroup rule"
);
if
(
ret
<
0
)
return
syserrno_set
(
ret
,
"Failed to process new bpf device cgroup command"
);
if
(
cmd
.
rsp
.
ret
<
0
)
return
syserrno_set
(
cmd
.
rsp
.
ret
,
"Failed to add new bpf device cgroup rule"
);
return
0
;
}
...
...
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