Add assoc-trim-path option and Board match
When a custom object path is being used (not the default object path
that comes from IPMI), allow the Board interface to be a valid
interface for associating the Inventory object with, not just the
System interface.
The purpose is to support large systems of the blade server style,
which have CPU and DIMM attached to a Board that is itself attached to
a System, not attached to the System directly.
Adding the assoc-trim-path option, disabled by default, to drop the
rightmost path component when setting up this association. This
bypasses the Board and associates the CPU and DIMM directly with the
underlying System.
Cleaning up the systemInfoUpdate() function, to correct a logic error
in which the match rule would not be set up for later if an exception
happened the first time. Also sleeping, to work around a race condition
with Object Mapper.
Tested: I tested it both with and without the assoc-trim-path option,
and it seemed to have the desired effect. With this option enabled, I
was able to attach CPU and DIMM to the proper System, even though there
was a Board object in the hierarchy between them.
Change-Id: Ibb5302e01b9d1b0453bdb14092ede594a9e71415
Signed-off-by: Josh Lehan <krellan@google.com>
diff --git a/src/meson.build b/src/meson.build
index 4a54d28..620eae4 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -3,6 +3,10 @@
cpp_args_smbios += ['-DDIMM_DBUS']
endif
+if get_option('assoc-trim-path').allowed()
+ cpp_args_smbios += ['-DASSOC_TRIM_PATH']
+endif
+
if get_option('dimm-only-locator').allowed()
cpp_args_smbios += ['-DDIMM_ONLY_LOCATOR']
endif