Fan control dbus busname and object path

Add fan control's default dbus busname and object path to use or what's
provided thru configure. The fan control manager requests the busname
after all the zones are created.

Tested:
    Found the requested busname for a zone in the busctl list

Change-Id: I8ee1e9e4094dcec958e8ae81ad4299357b8f792d
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/configure.ac b/configure.ac
index f57bb02..8ffda9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -96,6 +96,19 @@
        ])
 
 AS_IF([test "x$enable_control" != "xno"], [
+       # Add fan control Dbus attributes
+       AC_ARG_VAR(CONTROL_BUSNAME, [The fan control busname to own])
+       AS_IF([test "x$CONTROL_BUSNAME" == "x"],
+             [CONTROL_BUSNAME="xyz.openbmc_project.Control.Thermal"])
+       AC_DEFINE_UNQUOTED([CONTROL_BUSNAME], ["$CONTROL_BUSNAME"],
+                          [The fan control busname to own])
+
+       AC_ARG_VAR(CONTROL_OBJPATH, [The fan control root object path])
+       AS_IF([test "x$CONTROL_OBJPATH" == "x"],
+             [CONTROL_OBJPATH="/xyz/openbmc_project/control/thermal"])
+       AC_DEFINE_UNQUOTED([CONTROL_OBJPATH], ["$CONTROL_OBJPATH"],
+                          [The fan control root object path])
+
        # Add optional yaml file arguments
        AC_ARG_VAR(FAN_DEF_YAML_FILE,
                   [The fan definition file to use])
diff --git a/control/manager.cpp b/control/manager.cpp
index 6994f91..c99f4a3 100644
--- a/control/manager.cpp
+++ b/control/manager.cpp
@@ -19,6 +19,7 @@
 #include <phosphor-logging/elog-errors.hpp>
 #include <xyz/openbmc_project/Common/error.hpp>
 #include <unistd.h>
+#include "config.h"
 #include "manager.hpp"
 #include "utility.hpp"
 #include "sdbusplus.hpp"
@@ -106,6 +107,7 @@
         }
     }
 
+    bus.request_name(CONTROL_BUSNAME);
 }