mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 12:37:35 +00:00
support case ignored suffix for sizes
suffix of console max size and console buffer max size Signed-off-by: l00355512 <liuhao27@huawei.com>
This commit is contained in:
parent
503c783780
commit
39ebeb725b
@ -819,15 +819,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|||||||
ringbuffer. Note that ringbuffer must be at least as big as a
|
ringbuffer. Note that ringbuffer must be at least as big as a
|
||||||
standard page size. When passed a value smaller than a single page
|
standard page size. When passed a value smaller than a single page
|
||||||
size liblxc will allocate a ringbuffer of a single page size. A page
|
size liblxc will allocate a ringbuffer of a single page size. A page
|
||||||
size is usually 4kB.
|
size is usually 4KB.
|
||||||
|
|
||||||
The keyword 'auto' will cause liblxc to allocate a ringbuffer of
|
The keyword 'auto' will cause liblxc to allocate a ringbuffer of
|
||||||
128kB.
|
128KB.
|
||||||
|
|
||||||
When manually specifying a size for the ringbuffer the value should
|
When manually specifying a size for the ringbuffer the value should
|
||||||
be a power of 2 when converted to bytes. Valid size prefixes are
|
be a power of 2 when converted to bytes. Valid size prefixes are
|
||||||
'kB', 'MB', 'GB'. (Note that all conversions are based on multiples
|
'KB', 'MB', 'GB'. (Note that all conversions are based on multiples
|
||||||
of 1024. That means 'kb' == 'KiB', 'MB' == 'MiB', 'GB' == 'GiB'.)
|
of 1024. That means 'KB' == 'KiB', 'MB' == 'MiB', 'GB' == 'GiB'.
|
||||||
|
And ignored case, for example 'kB', 'KB' and 'Kb' is same.)
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -843,15 +844,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|||||||
<option>lxc.console.logfile</option>. Note that size of the log file
|
<option>lxc.console.logfile</option>. Note that size of the log file
|
||||||
must be at least as big as a standard page size. When passed a value
|
must be at least as big as a standard page size. When passed a value
|
||||||
smaller than a single page size liblxc will set the size of log file
|
smaller than a single page size liblxc will set the size of log file
|
||||||
to a single page size. A page size is usually 4kB.
|
to a single page size. A page size is usually 4KB.
|
||||||
|
|
||||||
The keyword 'auto' will cause liblxc to place a limit of 128kB on
|
The keyword 'auto' will cause liblxc to place a limit of 128KB on
|
||||||
the log file.
|
the log file.
|
||||||
|
|
||||||
When manually specifying a size for the log file the value should
|
When manually specifying a size for the log file the value should
|
||||||
be a power of 2 when converted to bytes. Valid size prefixes are
|
be a power of 2 when converted to bytes. Valid size prefixes are
|
||||||
'kB', 'MB', 'GB'. (Note that all conversions are based on multiples
|
'KB', 'MB', 'GB'. (Note that all conversions are based on multiples
|
||||||
of 1024. That means 'kb' == 'KiB', 'MB' == 'MiB', 'GB' == 'GiB'.)
|
of 1024. That means 'KB' == 'KiB', 'MB' == 'MiB', 'GB' == 'GiB'.
|
||||||
|
And ignored case, for example 'kB', 'KB' and 'Kb' is same.)
|
||||||
|
|
||||||
If users want to mirror the console ringbuffer on disk they should set
|
If users want to mirror the console ringbuffer on disk they should set
|
||||||
<option>lxc.console.size</option> equal to
|
<option>lxc.console.size</option> equal to
|
||||||
|
@ -2450,11 +2450,11 @@ int parse_byte_size_string(const char *s, int64_t *converted)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(suffix, "kB"))
|
if (!strcasecmp(suffix, "KB"))
|
||||||
mltpl = 1024;
|
mltpl = 1024;
|
||||||
else if (!strcmp(suffix, "MB"))
|
else if (!strcasecmp(suffix, "MB"))
|
||||||
mltpl = 1024 * 1024;
|
mltpl = 1024 * 1024;
|
||||||
else if (!strcmp(suffix, "GB"))
|
else if (!strcasecmp(suffix, "GB"))
|
||||||
mltpl = 1024 * 1024 * 1024;
|
mltpl = 1024 * 1024 * 1024;
|
||||||
else
|
else
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
Loading…
Reference in New Issue
Block a user