log-handler: Add a config option for log size.
Allow a configuration option to specify a log size. The parameter takes and
interprets common size suffixes k/M/G. 1kB = 1024B, 1MB=1024kB, 1GB=1024MB.
Default unit is byte. If "B" is specified at the end it will be ignored.
Tested:
Tested that "logsize = 567kB" correctly sets up a 567KB log buffer.
Tested that invalid/overflow values will be ignored and 16KB will be used.
Tested that if log size smaller than pagesize is rounded up.
Change-Id: I2fb50462c6ff7873130be80f7d57ef8065acc5da
Signed-off-by: Kun Yi <kunyi731@gmail.com>
diff --git a/console-server.h b/console-server.h
index 0be567e..d2ac87f 100644
--- a/console-server.h
+++ b/console-server.h
@@ -118,6 +118,7 @@
void config_fini(struct config *config);
int config_parse_baud(speed_t *speed, const char *baud_string);
+int config_parse_logsize(const char *size_str, size_t *size);
/* socket paths */
extern const char *console_socket_path;