Add the BMC code version to error logs

Add the xyz.openbmc_project.Software.Version interface to
the elog entries.  This allows a user to know what BMC code
level was running when the error was created.  The level is
persisted along with the other elog fields.

If this code is flashed on a system that was running older code,
and there were existing error logs, the version property will
be left empty in the restored log entries.

Older code is still able to restore logs created by this code
as the version property is at the end of the serialized data
and so is just ignored by Cereal.

Resolves openbmc/openbmc#3133

Tested:  Check that new error logs have the code level, and that
         restarting phosphor-log-manager preserves that property
         on the existing logs.  Various incantations of running
         the older code with logs created by this code, and running
         this code with logs created by older code.

Change-Id: I682aa3bf97c8352ce6dda05dfdf55d33173de891
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/configure.ac b/configure.ac
index 2e4cdd1..d9c022d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,6 +76,8 @@
 AC_DEFINE(CALLOUT_FWD_ASSOCIATION, "callout", [The name of the callout's forward association.])
 AC_DEFINE(CALLOUT_REV_ASSOCIATION, "fault", [The name of the callout's reverse association.])
 AC_DEFINE(BMC_VERSION_FILE, "/etc/os-release", [The file that contains the BMC firmware version])
+AC_DEFINE(FIRST_CEREAL_CLASS_VERSION_WITH_FWLEVEL, "2",
+          [First Cereal class version with the BMC code version persisted])
 
 AC_ARG_VAR(YAML_DIR_TEST, [The path to the test error yaml files.])
 AS_IF([test "x$YAML_DIR_TEST" == "x"], \
@@ -109,7 +111,7 @@
     [Cap on informational (and below) severity errors])
 
 AC_ARG_VAR(CLASS_VERSION, [Class version to register with Cereal])
-AS_IF([test "x$CLASS_VERSION" == "x"], [CLASS_VERSION=1])
+AS_IF([test "x$CLASS_VERSION" == "x"], [CLASS_VERSION=2])
 AC_DEFINE_UNQUOTED([CLASS_VERSION], [$CLASS_VERSION], [Class version to register with Cereal])
 
 AC_CONFIG_HEADERS([config.h])