Implement user requested system dump.

Add method to set the diag mode target to start the creation of
user requested system dump.

Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
Change-Id: Id4986b615133db575767956d435e6a14faa147b8
diff --git a/dump_manager_system.cpp b/dump_manager_system.cpp
index ab7ca72..865ed91 100644
--- a/dump_manager_system.cpp
+++ b/dump_manager_system.cpp
@@ -38,6 +38,21 @@
     lastEntryId++;
 }
 
+uint32_t Manager::createDump()
+{
+    constexpr auto SYSTEMD_SERVICE = "org.freedesktop.systemd1";
+    constexpr auto SYSTEMD_OBJ_PATH = "/org/freedesktop/systemd1";
+    constexpr auto SYSTEMD_INTERFACE = "org.freedesktop.systemd1.Manager";
+    constexpr auto DIAG_MOD_TARGET = "obmc-host-diagnostic-mode@0.target";
+    auto b = sdbusplus::bus::new_default();
+    auto method = bus.new_method_call(SYSTEMD_SERVICE, SYSTEMD_OBJ_PATH,
+                                      SYSTEMD_INTERFACE, "StartUnit");
+    method.append(DIAG_MOD_TARGET); // unit to activate
+    method.append("replace");
+    bus.call_noreply(method);
+    return ++lastEntryId;
+}
+
 } // namespace system
 } // namespace dump
 } // namespace phosphor