Attn: Quiesce host on SBE vital

When an SBE vital is detected the attention handler will transition the
host to the quiesce state. Code has also been added to make a call to
thread_stop_all (libpdbg) before transitioning host (mpipl and
quiesce cases).

Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: Idac4680e2cb9eacedb6be7b70ae8b0d60dde66b5
diff --git a/attn/ti_handler.cpp b/attn/ti_handler.cpp
index a8daedb..35fb346 100644
--- a/attn/ti_handler.cpp
+++ b/attn/ti_handler.cpp
@@ -1,3 +1,4 @@
+#include <attn/attn_common.hpp>
 #include <attn/attn_handler.hpp>
 #include <attn/attn_logging.hpp>
 #include <attn/ti_handler.hpp>
@@ -52,29 +53,6 @@
 }
 
 /**
- * @brief Transition the host state
- *
- * We will transition the host state by starting the appropriate dbus target.
- *
- * @param i_target the dbus target to start
- */
-void transitionHost(const char* i_target)
-{
-    // We will be transitioning host by starting appropriate dbus target
-    auto bus    = sdbusplus::bus::new_system();
-    auto method = bus.new_method_call(
-        "org.freedesktop.systemd1", "/org/freedesktop/systemd1",
-        "org.freedesktop.systemd1.Manager", "StartUnit");
-
-    method.append(i_target);  // target unit to start
-    method.append("replace"); // mode = replace conflicting queued jobs
-
-    trace<level::INFO>(i_target);
-
-    bus.call_noreply(method); // start the service
-}
-
-/**
  * @brief Handle a PHYP terminate immediate special attention
  *
  * The TI info data area will contain information pertaining to the TI
@@ -92,12 +70,12 @@
     {
         // If autoreboot is enabled we will start diagnostic mode target
         // which will ultimately mpipl the host.
-        transitionHost("obmc-host-diagnostic-mode@0.target");
+        transitionHost(HostState::Diagnostic);
     }
     else
     {
         // If autoreboot is disabled we will quiesce the host
-        transitionHost("obmc-host-quiesce@0.target");
+        transitionHost(HostState::Quiesce);
     }
 
     // gather additional data for PEL
@@ -213,13 +191,13 @@
             // Until HB dump support available just quiesce the host - once
             // dump support is available the dump component will transition
             // (ipl/halt) the host.
-            transitionHost("obmc-host-quiesce@0.target");
+            transitionHost(HostState::Quiesce);
         }
         else
         {
             // Quiese the host - when the host is quiesced it will either
             // "halt" or IPL depending on autoreboot setting.
-            transitionHost("obmc-host-quiesce@0.target");
+            transitionHost(HostState::Quiesce);
         }
     }