PHAL: mpreboot- exit with failure if no functional processor found

On some special cases noticed DeviceTree was returning no
functional processor when queried.

As there are no functional processors present MPreboot was
not performed and no error/PEL was created to notify the user.
Rather the method was exiting with SUCCESS.

Now modified to log an error message and create a PEL if
no functional processors are found to perform MPReboot.

openpower-proc-control[3663]: Starting memory preserving reboot
openpower-proc-control[3663]: EnterMPReboot is not executed on any
processors
phosphor-log-manager[320]: Event not found in PEL message registry:
org.open_power.Processor.Error.MemoryPreservingReboot
phosphor-log-manager[320]: Created PEL 0x50014017 (BMC ID 750) with SRC BD752004

Signed-off-by: Marri Devender Rao <devenrao@in.ibm.com>
Change-Id: Id781fc1bc9fac869c96c29562f62260c1a7c909d
diff --git a/procedures/phal/enter_mpreboot.cpp b/procedures/phal/enter_mpreboot.cpp
index c901be3..0db9889 100644
--- a/procedures/phal/enter_mpreboot.cpp
+++ b/procedures/phal/enter_mpreboot.cpp
@@ -173,6 +173,14 @@
         }
     }
 
+    // if no functional proc found exit with failure
+    if (pidList.size() == 0)
+    {
+        log<level::ERR>("EnterMPReboot is not executed on any processors");
+        openpower::pel::createPEL("org.open_power.PHAL.Error.MPReboot");
+        std::exit(EXIT_FAILURE);
+    }
+
     for (auto& p : pidList)
     {
         int status = 0;