Cap the number of dumps

Calculate number of dumps allowed in a system based on
individual dump Max size configured in the system.

Algorithm: Setting Dump size to maximum size,
if (dump entries + active dumps) is less than total allowed dump entries.
Otherwise return error.

Next patch will provide additional algorithm to cap the
dump based on actual size of the dump files.

Change-Id: Id8916a31d72f5c2f2f23eaf68062b829b7e4100c
Signed-off-by: Jayanth Othayoth <ojayanth@in.ibm.com>
diff --git a/configure.ac b/configure.ac
index 7d93605..3a042cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,5 +63,13 @@
 AS_IF([test "x$BMC_DUMP_PATH" == "x"], [BMC_DUMP_PATH="/tmp/dumps"])
 AC_DEFINE_UNQUOTED([BMC_DUMP_PATH], ["$BMC_DUMP_PATH"], [Directory where bmc dumps are placed])
 
+AC_ARG_VAR(BMC_DUMP_MAX_SIZE, [Maximum size of one bmc dump in kilo bytes])
+AS_IF([test x$BMC_DUMP_MAX_SIZE == x], [BMC_DUMP_MAX_SIZE=200])
+AC_DEFINE_UNQUOTED([BMC_DUMP_MAX_SIZE], [$BMC_DUMP_MAX_SIZE], [Maximum size of one bmc dump in kilo bytes])
+
+AC_ARG_VAR(BMC_DUMP_TOTAL_SIZE, [Total size of the bmc dump in kilo bytes])
+AS_IF([test x$BMC_DUMP_TOTAL_SIZE == x], [BMC_DUMP_TOTAL_SIZE=1024])
+AC_DEFINE_UNQUOTED([BMC_DUMP_TOTAL_SIZE], [$BMC_DUMP_TOTAL_SIZE], [Total size of the dump in kilo bytes])
+
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT