From 14cc043f48a23f6e7e9cf46b6475b0b32880c984 Mon Sep 17 00:00:00 2001 From: Matthew Barth Date: Wed, 16 Jan 2019 15:06:41 -0600 Subject: 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 --- configure.ac | 13 +++++++++++++ control/manager.cpp | 2 ++ 2 files changed, 15 insertions(+) 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_presence" != "xno"], [ ]) 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 #include #include +#include "config.h" #include "manager.hpp" #include "utility.hpp" #include "sdbusplus.hpp" @@ -106,6 +107,7 @@ Manager::Manager(sdbusplus::bus::bus& bus, } } + bus.request_name(CONTROL_BUSNAME); } -- cgit v1.2.1