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
a7ac0d1e
Unverified
Commit
a7ac0d1e
authored
Dec 08, 2020
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: cleanup set_config_console_size()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
3f5c01db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
confile.c
src/lxc/confile.c
+6
-9
No files found.
src/lxc/confile.c
View file @
a7ac0d1e
...
@@ -2395,29 +2395,26 @@ static int set_config_console_size(const char *key, const char *value,
...
@@ -2395,29 +2395,26 @@ static int set_config_console_size(const char *key, const char *value,
}
}
ret
=
parse_byte_size_string
(
value
,
&
size
);
ret
=
parse_byte_size_string
(
value
,
&
size
);
if
(
ret
<
0
)
if
(
ret
)
return
-
1
;
return
ret_errno
(
EINVAL
)
;
if
(
size
<
0
)
if
(
size
<
0
)
return
-
EINVAL
;
return
ret_errno
(
EINVAL
)
;
/* must be at least a page size */
/* must be at least a page size */
pgsz
=
lxc_getpagesize
();
pgsz
=
lxc_getpagesize
();
if
((
uint64_t
)
size
<
pgsz
)
{
if
((
uint64_t
)
size
<
pgsz
)
{
NOTICE
(
"Requested ringbuffer size for the console is %"
PRId64
NOTICE
(
"Requested ringbuffer size for the console is %"
PRId64
" but must be at least %"
PRId64
" bytes. Setting ringbuffer size to %"
PRId64
" bytes"
,
" but must be at least %"
PRId64
" bytes. Setting ringbuffer size to %"
PRId64
" bytes"
,
size
,
pgsz
,
pgsz
);
size
,
pgsz
,
pgsz
);
size
=
pgsz
;
size
=
pgsz
;
}
}
log_size
=
lxc_find_next_power2
((
uint64_t
)
size
);
log_size
=
lxc_find_next_power2
((
uint64_t
)
size
);
if
(
log_size
==
0
)
if
(
log_size
==
0
)
return
-
EINVAL
;
return
ret_errno
(
EINVAL
)
;
if
(
log_size
!=
size
)
if
(
log_size
!=
size
)
NOTICE
(
"Passed size was not a power of 2. Rounding log size to "
NOTICE
(
"Passed size was not a power of 2. Rounding log size to next power of two: %"
PRIu64
" bytes"
,
log_size
);
"next power of two: %"
PRIu64
" bytes"
,
log_size
);
lxc_conf
->
console
.
log_size
=
log_size
;
lxc_conf
->
console
.
log_size
=
log_size
;
...
...
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