Skip to content

Commit

Permalink
Make sure we still accept the old cacheblocks config
Browse files Browse the repository at this point in the history
  • Loading branch information
jaharkes committed Sep 11, 2018
1 parent 7b5d754 commit df8696d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion coda-src/venus/venus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -675,12 +675,19 @@ static void DefaultCmdlineParms()
/* Load the "venus.conf" configuration file */
codaconf_init("venus.conf");

/* we will prefer the deprecated "cacheblocks" over "cachesize" */
if (!CacheBlocks) {
CODACONF_INT(CacheBlocks, "cacheblocks", 0);
if (CacheBlocks)
eprint("Using deprecated config 'cacheblocks', try the more flexible 'cachesize'");
}

if (!CacheBlocks) {
CODACONF_STR(CacheSize, "cachesize", MIN_CS);
CacheBlocks = ParseSizeWithUnits(CacheSize);
}

/* In case of user missconfiguration */
/* In case of user misconfiguration */
if (CacheBlocks < MIN_CB) {
eprint("Cannot start: minimum cache size is %s", "2MB");
exit(EXIT_UNCONFIGURED);
Expand Down

0 comments on commit df8696d

Please sign in to comment.