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
d8c81a7c
Unverified
Commit
d8c81a7c
authored
Feb 23, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commands: handle older clients elegantly
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
d1110354
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
commands.c
src/lxc/commands.c
+11
-2
No files found.
src/lxc/commands.c
View file @
d8c81a7c
...
@@ -609,6 +609,9 @@ int lxc_cmd_get_cgroup_ctx(const char *name, const char *lxcpath,
...
@@ -609,6 +609,9 @@ int lxc_cmd_get_cgroup_ctx(const char *name, const char *lxcpath,
.
datalen
=
size_ret_ctx
,
.
datalen
=
size_ret_ctx
,
.
data
=
ret_ctx
,
.
data
=
ret_ctx
,
},
},
.
rsp
=
{
.
ret
=
-
ENOSYS
,
},
};
};
int
ret
,
stopped
;
int
ret
,
stopped
;
...
@@ -617,7 +620,7 @@ int lxc_cmd_get_cgroup_ctx(const char *name, const char *lxcpath,
...
@@ -617,7 +620,7 @@ int lxc_cmd_get_cgroup_ctx(const char *name, const char *lxcpath,
ret
=
lxc_cmd
(
name
,
&
cmd
,
&
stopped
,
lxcpath
,
NULL
);
ret
=
lxc_cmd
(
name
,
&
cmd
,
&
stopped
,
lxcpath
,
NULL
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
log_debug_errno
(
-
1
,
errno
,
"Failed to process cgroup
fd
command"
);
return
log_debug_errno
(
-
1
,
errno
,
"Failed to process cgroup
context
command"
);
if
(
cmd
.
rsp
.
ret
<
0
)
if
(
cmd
.
rsp
.
ret
<
0
)
return
log_debug_errno
(
-
EBADF
,
errno
,
"Failed to receive cgroup fds"
);
return
log_debug_errno
(
-
EBADF
,
errno
,
"Failed to receive cgroup fds"
);
...
@@ -1542,6 +1545,9 @@ int lxc_cmd_get_cgroup2_fd(const char *name, const char *lxcpath)
...
@@ -1542,6 +1545,9 @@ int lxc_cmd_get_cgroup2_fd(const char *name, const char *lxcpath)
.
req
=
{
.
req
=
{
.
cmd
=
LXC_CMD_GET_CGROUP2_FD
,
.
cmd
=
LXC_CMD_GET_CGROUP2_FD
,
},
},
.
rsp
=
{
ret
=
-
ENOSYS
,
},
};
};
ret
=
lxc_cmd
(
name
,
&
cmd
,
&
stopped
,
lxcpath
,
NULL
);
ret
=
lxc_cmd
(
name
,
&
cmd
,
&
stopped
,
lxcpath
,
NULL
);
...
@@ -1561,6 +1567,9 @@ int lxc_cmd_get_limiting_cgroup2_fd(const char *name, const char *lxcpath)
...
@@ -1561,6 +1567,9 @@ int lxc_cmd_get_limiting_cgroup2_fd(const char *name, const char *lxcpath)
.
req
=
{
.
req
=
{
.
cmd
=
LXC_CMD_GET_LIMITING_CGROUP2_FD
,
.
cmd
=
LXC_CMD_GET_LIMITING_CGROUP2_FD
,
},
},
.
rsp
=
{
.
ret
=
-
ENOSYS
,
},
};
};
ret
=
lxc_cmd
(
name
,
&
cmd
,
&
stopped
,
lxcpath
,
NULL
);
ret
=
lxc_cmd
(
name
,
&
cmd
,
&
stopped
,
lxcpath
,
NULL
);
...
@@ -1568,7 +1577,7 @@ int lxc_cmd_get_limiting_cgroup2_fd(const char *name, const char *lxcpath)
...
@@ -1568,7 +1577,7 @@ int lxc_cmd_get_limiting_cgroup2_fd(const char *name, const char *lxcpath)
return
-
1
;
return
-
1
;
if
(
cmd
.
rsp
.
ret
<
0
)
if
(
cmd
.
rsp
.
ret
<
0
)
return
log_debug_errno
(
cmd
.
rsp
.
ret
,
-
cmd
.
rsp
.
ret
,
"Failed to receive cgroup2
fd"
);
return
syswarn_set
(
cmd
.
rsp
.
ret
,
"Failed to receive cgroup2 limit
fd"
);
return
PTR_TO_INT
(
cmd
.
rsp
.
data
);
return
PTR_TO_INT
(
cmd
.
rsp
.
data
);
}
}
...
...
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