Option to override dump request D-Bus path

Added option for overriding the object path for requesting OpenPOWER
dumps. On recent systems the object path is changed so adding option
to override the path in the recipe.

Change-Id: I457831630aa4208e0455082a8f0c4096b084d843
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
diff --git a/attn/attn_dump.cpp b/attn/attn_dump.cpp
index 167835a..6199f85 100644
--- a/attn/attn_dump.cpp
+++ b/attn/attn_dump.cpp
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #include <attn/attn_dbus.hpp>
 #include <attn/attn_dump.hpp>
 #include <attn/attn_logging.hpp>
@@ -113,14 +115,13 @@
 /** Request a dump from the dump manager */
 void requestDump(uint32_t i_logId, const DumpParameters& i_dumpParameters)
 {
-    constexpr auto path = "/org/openpower/dump";
     constexpr auto interface = "xyz.openbmc_project.Dump.Create";
     constexpr auto function = "CreateDump";
 
     sdbusplus::message_t method;
     bool watchdogDisabled = false;
 
-    if (0 == dbusMethod(path, interface, function, method))
+    if (0 == dbusMethod(OP_DUMP_OBJ_PATH, interface, function, method))
     {
         try
         {
diff --git a/config.h.in b/config.h.in
index 4156e49..2a67c89 100644
--- a/config.h.in
+++ b/config.h.in
@@ -20,4 +20,7 @@
 
 #mesondefine CONFIG_PHAL_API
 
+// D-Bus path for requesting dumps
+constexpr auto OP_DUMP_OBJ_PATH = @OP_DUMP_OBJ_PATH@;
+
 // clang-format on
diff --git a/meson.build b/meson.build
index 2d294f9..64e8394 100644
--- a/meson.build
+++ b/meson.build
@@ -36,6 +36,9 @@
 
 conf = configuration_data()
 
+# OpenPOWER dump object path override
+conf.set_quoted('OP_DUMP_OBJ_PATH', get_option('op_dump_obj_path'))
+
 conf.set('CONFIG_PHAL_API', get_option('phal').allowed())
 
 configure_file(input: 'config.h.in', output: 'config.h', configuration: conf)
diff --git a/meson.options b/meson.options
index 5587317..73675e4 100644
--- a/meson.options
+++ b/meson.options
@@ -5,3 +5,5 @@
                          Systems device tree''')
 option('attn_config', type : 'string', value : '',
         description : '''Attention handler default configuration override''')
+option('op_dump_obj_path', type: 'string', value: '/org/openpower/dump',
+        description : '''Object path requesting OpenPOWER dumps''')