sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I41103c892db258a85640aa1442acd9a295c8a847
diff --git a/bmc_state_manager.cpp b/bmc_state_manager.cpp
index 85eb3cf..e1cbaf2 100644
--- a/bmc_state_manager.cpp
+++ b/bmc_state_manager.cpp
@@ -59,7 +59,7 @@
auto result = this->bus.call(method);
result.read(unitTargetPath);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
// Not all input units will have been loaded yet so just return an
// empty string if an exception is caught in this path
@@ -81,7 +81,7 @@
// Is input target active or inactive?
result.read(currentState);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
info("Error in ActiveState Get: {ERROR}", "ERROR", e);
return std::string{};
@@ -125,7 +125,7 @@
{
this->bus.call(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Failed to subscribe to systemd signals: {ERROR}", "ERROR", e);
elog<InternalFailure>();
@@ -151,7 +151,7 @@
{
this->bus.call(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
info("Error in HardReboot: {ERROR}", "ERROR", e);
}
@@ -181,7 +181,7 @@
{
this->bus.call(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
info("Error in StartUnit - replace-irreversibly: {ERROR}", "ERROR",
e);
@@ -190,7 +190,7 @@
return;
}
-int BMC::bmcStateChange(sdbusplus::message::message& msg)
+int BMC::bmcStateChange(sdbusplus::message_t& msg)
{
uint32_t newStateID{};
sdbusplus::message::object_path newStateObjPath;
@@ -215,7 +215,7 @@
{
this->bus.call(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
info("Error in Unsubscribe: {ERROR}", "ERROR", e);
}
diff --git a/bmc_state_manager.hpp b/bmc_state_manager.hpp
index 239ad10..026cb3f 100644
--- a/bmc_state_manager.hpp
+++ b/bmc_state_manager.hpp
@@ -15,7 +15,7 @@
namespace manager
{
-using BMCInherit = sdbusplus::server::object::object<
+using BMCInherit = sdbusplus::server::object_t<
sdbusplus::xyz::openbmc_project::State::server::BMC>;
namespace sdbusRule = sdbusplus::bus::match::rules;
@@ -33,7 +33,7 @@
* @param[in] busName - The Dbus name to own
* @param[in] objPath - The Dbus object path
*/
- BMC(sdbusplus::bus::bus& bus, const char* objPath) :
+ BMC(sdbusplus::bus_t& bus, const char* objPath) :
BMCInherit(bus, objPath, BMCInherit::action::defer_emit), bus(bus),
stateSignal(std::make_unique<decltype(stateSignal)::element_type>(
bus,
@@ -97,10 +97,10 @@
* @param[in] msg - Data associated with subscribed signal
*
*/
- int bmcStateChange(sdbusplus::message::message& msg);
+ int bmcStateChange(sdbusplus::message_t& msg);
/** @brief Persistent sdbusplus DBus bus connection. **/
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/** @brief Used to subscribe to dbus system state changes **/
std::unique_ptr<sdbusplus::bus::match_t> stateSignal;
diff --git a/bmc_state_manager_main.cpp b/bmc_state_manager_main.cpp
index 5867e51..1d6f617 100644
--- a/bmc_state_manager_main.cpp
+++ b/bmc_state_manager_main.cpp
@@ -13,7 +13,7 @@
auto objPathInst = std::string(BMC_OBJPATH) + '0';
// Add sdbusplus ObjectManager.
- sdbusplus::server::manager::manager objManager(bus, objPathInst.c_str());
+ sdbusplus::server::manager_t objManager(bus, objPathInst.c_str());
phosphor::state::manager::BMC manager(bus, objPathInst.c_str());
diff --git a/chassis_state_manager.cpp b/chassis_state_manager.cpp
index 0e962c1..9c16ea0 100644
--- a/chassis_state_manager.cpp
+++ b/chassis_state_manager.cpp
@@ -78,7 +78,7 @@
SYSTEMD_SERVICE, SYSTEMD_OBJ_PATH, SYSTEMD_INTERFACE, "Subscribe");
this->bus.call(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Failed to subscribe to systemd signals: {ERROR}", "ERROR", e);
elog<InternalFailure>();
@@ -179,7 +179,7 @@
}
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
// It's acceptable for the pgood state service to not be available
// since it will notify us of the pgood state when it comes up.
@@ -248,7 +248,7 @@
auto mapperResponseMsg = bus.call(mapper);
mapperResponseMsg.read(mapperResponse);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in mapper GetSubTree call for UPS: {ERROR}", "ERROR", e);
throw;
@@ -326,7 +326,7 @@
return false;
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error reading UPS property, error: {ERROR}, "
"service: {SERVICE} path: {PATH}",
@@ -354,7 +354,7 @@
auto mapperResponseMsg = bus.call(mapper);
mapperResponseMsg.read(mapperResponse);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in mapper GetSubTree call for PowerSystemInputs: {ERROR}",
"ERROR", e);
@@ -392,7 +392,7 @@
return false;
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error(
"Error reading Power System Inputs property, error: {ERROR}, "
@@ -405,7 +405,7 @@
return true;
}
-void Chassis::uPowerChangeEvent(sdbusplus::message::message& msg)
+void Chassis::uPowerChangeEvent(sdbusplus::message_t& msg)
{
debug("UPS Property Change Event Triggered");
std::string statusInterface;
@@ -444,7 +444,7 @@
return;
}
-void Chassis::powerSysInputsChangeEvent(sdbusplus::message::message& msg)
+void Chassis::powerSysInputsChangeEvent(sdbusplus::message_t& msg)
{
debug("Power System Inputs Property Change Event Triggered");
std::string statusInterface;
@@ -507,7 +507,7 @@
auto result = this->bus.call(method);
result.read(unitTargetPath);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in GetUnit call: {ERROR}", "ERROR", e);
return false;
@@ -525,7 +525,7 @@
auto result = this->bus.call(method);
result.read(currentState);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in ActiveState Get: {ERROR}", "ERROR", e);
return false;
@@ -536,7 +536,7 @@
currentStateStr == ACTIVATING_STATE;
}
-int Chassis::sysStateChange(sdbusplus::message::message& msg)
+int Chassis::sysStateChange(sdbusplus::message_t& msg)
{
sdbusplus::message::object_path newStateObjPath;
std::string newStateUnit{};
@@ -550,7 +550,7 @@
uint32_t newStateID{};
msg.read(newStateID, newStateObjPath, newStateUnit, newStateResult);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in state change - bad encoding: {ERROR} {REPLY_SIG}",
"ERROR", e, "REPLY_SIG", msg.get_signature());
diff --git a/chassis_state_manager.hpp b/chassis_state_manager.hpp
index 9053951..d12ad36 100644
--- a/chassis_state_manager.hpp
+++ b/chassis_state_manager.hpp
@@ -22,7 +22,7 @@
namespace manager
{
-using ChassisInherit = sdbusplus::server::object::object<
+using ChassisInherit = sdbusplus::server::object_t<
sdbusplus::xyz::openbmc_project::State::server::Chassis,
sdbusplus::xyz::openbmc_project::State::server::PowerOnHours>;
namespace sdbusRule = sdbusplus::bus::match::rules;
@@ -46,7 +46,7 @@
* @param[in] objPath - The Dbus object path
* @param[in] id - Chassis id
*/
- Chassis(sdbusplus::bus::bus& bus, const char* objPath, size_t id) :
+ Chassis(sdbusplus::bus_t& bus, const char* objPath, size_t id) :
ChassisInherit(bus, objPath, ChassisInherit::action::defer_emit),
bus(bus),
systemdSignals(
@@ -160,10 +160,10 @@
* @param[in] msg - Data associated with subscribed signal
*
*/
- int sysStateChange(sdbusplus::message::message& msg);
+ int sysStateChange(sdbusplus::message_t& msg);
/** @brief Persistent sdbusplus DBus connection. */
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/** @brief Used to subscribe to dbus systemd signals **/
sdbusplus::bus::match_t systemdSignals;
@@ -253,7 +253,7 @@
* @param[in] msg - Data associated with subscribed signal
*
*/
- void uPowerChangeEvent(sdbusplus::message::message& msg);
+ void uPowerChangeEvent(sdbusplus::message_t& msg);
/** @brief Process PowerSystemInputs property changes
*
@@ -263,7 +263,7 @@
* @param[in] msg - Data associated with subscribed signal
*
*/
- void powerSysInputsChangeEvent(sdbusplus::message::message& msg);
+ void powerSysInputsChangeEvent(sdbusplus::message_t& msg);
};
} // namespace manager
diff --git a/chassis_state_manager_main.cpp b/chassis_state_manager_main.cpp
index c1dccf7..96542b9 100644
--- a/chassis_state_manager_main.cpp
+++ b/chassis_state_manager_main.cpp
@@ -69,7 +69,7 @@
}
// Add sdbusplus ObjectManager.
- sdbusplus::server::manager::manager objManager(bus, objPathInst.c_str());
+ sdbusplus::server::manager_t objManager(bus, objPathInst.c_str());
phosphor::state::manager::Chassis manager(bus, objPathInst.c_str(),
chassisId);
diff --git a/discover_system_state.cpp b/discover_system_state.cpp
index e7f0978..28399bd 100644
--- a/discover_system_state.cpp
+++ b/discover_system_state.cpp
@@ -182,7 +182,7 @@
}
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in PowerRestorePolicy Get: {ERROR}", "ERROR", e);
elog<InternalFailure>();
diff --git a/host_check.cpp b/host_check.cpp
index 7e6dbef..ced4ba3 100644
--- a/host_check.cpp
+++ b/host_check.cpp
@@ -46,7 +46,7 @@
// Find all implementations of Condition interface and check if host is
// running over it
-bool checkFirmwareConditionRunning(sdbusplus::bus::bus& bus)
+bool checkFirmwareConditionRunning(sdbusplus::bus_t& bus)
{
using FirmwareCondition = HostFirmware::FirmwareCondition;
// Find all implementations of host firmware condition interface
@@ -63,7 +63,7 @@
auto mapperResponseMsg = bus.call(mapper);
mapperResponseMsg.read(mapperResponse);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error(
"Error in mapper GetSubTree call for HostFirmware condition: {ERROR}",
@@ -116,7 +116,7 @@
return true;
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error reading HostFirmware condition, error: {ERROR}, "
"service: {SERVICE} path: {PATH}",
@@ -129,7 +129,7 @@
}
// Helper function to check if chassis power is on
-bool isChassiPowerOn(sdbusplus::bus::bus& bus, size_t id)
+bool isChassiPowerOn(sdbusplus::bus_t& bus, size_t id)
{
auto svcname = std::string{CHASSIS_STATE_SVC} + std::to_string(id);
auto objpath = std::string{CHASSIS_STATE_PATH} + std::to_string(id);
@@ -153,7 +153,7 @@
return true;
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error reading Chassis Power State, error: {ERROR}, "
"service: {SERVICE} path: {PATH}",
diff --git a/host_condition_gpio/host_condition.hpp b/host_condition_gpio/host_condition.hpp
index eaeefc7..35d8313 100644
--- a/host_condition_gpio/host_condition.hpp
+++ b/host_condition_gpio/host_condition.hpp
@@ -11,7 +11,7 @@
namespace condition
{
-using HostIntf = sdbusplus::server::object::object<
+using HostIntf = sdbusplus::server::object_t<
sdbusplus::xyz::openbmc_project::Condition::server::HostFirmware>;
class Host : public HostIntf
@@ -24,7 +24,7 @@
Host& operator=(Host&&) = delete;
virtual ~Host() = default;
- Host(sdbusplus::bus::bus& bus, const std::string& path,
+ Host(sdbusplus::bus_t& bus, const std::string& path,
const std::string& hostId) :
HostIntf(bus, path.c_str()),
lineName("host" + hostId)
diff --git a/host_condition_gpio/host_condition_main.cpp b/host_condition_gpio/host_condition_main.cpp
index 6148450..cdac79c 100644
--- a/host_condition_gpio/host_condition_main.cpp
+++ b/host_condition_gpio/host_condition_main.cpp
@@ -27,7 +27,7 @@
std::string busName = HOST_GPIOS_BUSNAME;
// Add sdbusplus ObjectManager
- sdbusplus::server::manager::manager objManager(bus, objGroupName.c_str());
+ sdbusplus::server::manager_t objManager(bus, objGroupName.c_str());
// For now, we only support checking Host0 status
auto host = std::make_unique<phosphor::condition::Host>(
diff --git a/host_reset_recovery.cpp b/host_reset_recovery.cpp
index 7898622..fe94f72 100644
--- a/host_reset_recovery.cpp
+++ b/host_reset_recovery.cpp
@@ -38,7 +38,7 @@
constexpr auto SYSTEMD_INTERFACE = "org.freedesktop.systemd1.Manager";
constexpr auto HOST_STATE_QUIESCE_TGT = "obmc-host-quiesce@0.target";
-bool wasHostBooting(sdbusplus::bus::bus& bus)
+bool wasHostBooting(sdbusplus::bus_t& bus)
{
try
{
@@ -64,7 +64,7 @@
info("Host was booting before BMC reboot: {BOOTPROGRESS}",
"BOOTPROGRESS", bootProgress);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error reading BootProgress, error {ERROR}, service {SERVICE}, "
"path {PATH}",
@@ -76,7 +76,7 @@
return true;
}
-void createErrorLog(sdbusplus::bus::bus& bus)
+void createErrorLog(sdbusplus::bus_t& bus)
{
try
{
@@ -95,7 +95,7 @@
method.append(errorMessage, level, additionalData);
auto resp = bus.call(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error(
"sdbusplus D-Bus call exception, error {ERROR}, objpath {OBJPATH}, "
@@ -126,7 +126,7 @@
return !f.good();
}
-void moveToHostQuiesce(sdbusplus::bus::bus& bus)
+void moveToHostQuiesce(sdbusplus::bus_t& bus)
{
try
{
@@ -138,7 +138,7 @@
bus.call_noreply(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("sdbusplus call exception starting quiesce target: {ERROR}",
"ERROR", e);
diff --git a/host_state_manager.cpp b/host_state_manager.cpp
index f1709cd..6ff1f56 100644
--- a/host_state_manager.cpp
+++ b/host_state_manager.cpp
@@ -67,7 +67,7 @@
{
this->bus.call_noreply(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Failed to subscribe to systemd signals: {ERROR}", "ERROR", e);
elog<InternalFailure>();
@@ -170,7 +170,7 @@
auto result = this->bus.call(method);
result.read(unitTargetPath);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in GetUnit call: {ERROR}", "ERROR", e);
return false;
@@ -188,7 +188,7 @@
auto result = this->bus.call(method);
result.read(currentState);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in ActiveState Get: {ERROR}", "ERROR", e);
return false;
@@ -275,14 +275,14 @@
return false;
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in AutoReboot Get, {ERROR}", "ERROR", e);
return false;
}
}
-void Host::sysStateChangeJobRemoved(sdbusplus::message::message& msg)
+void Host::sysStateChangeJobRemoved(sdbusplus::message_t& msg)
{
uint32_t newStateID{};
sdbusplus::message::object_path newStateObjPath;
@@ -339,7 +339,7 @@
}
}
-void Host::sysStateChangeJobNew(sdbusplus::message::message& msg)
+void Host::sysStateChangeJobNew(sdbusplus::message_t& msg)
{
uint32_t newStateID{};
sdbusplus::message::object_path newStateObjPath;
diff --git a/host_state_manager.hpp b/host_state_manager.hpp
index 087b5f0..cd1389c 100644
--- a/host_state_manager.hpp
+++ b/host_state_manager.hpp
@@ -24,7 +24,7 @@
namespace manager
{
-using HostInherit = sdbusplus::server::object::object<
+using HostInherit = sdbusplus::server::object_t<
sdbusplus::xyz::openbmc_project::State::server::Host,
sdbusplus::xyz::openbmc_project::State::Boot::server::Progress,
sdbusplus::xyz::openbmc_project::Control::Boot::server::RebootAttempts,
@@ -53,7 +53,7 @@
* @param[in] objPath - The Dbus object path
* @param[in] id - The Host id
*/
- Host(sdbusplus::bus::bus& bus, const char* objPath, size_t id) :
+ Host(sdbusplus::bus_t& bus, const char* objPath, size_t id) :
HostInherit(bus, objPath, HostInherit::action::defer_emit), bus(bus),
systemdSignalJobRemoved(
bus,
@@ -211,7 +211,7 @@
* @param[in] msg - Data associated with subscribed signal
*
*/
- void sysStateChangeJobRemoved(sdbusplus::message::message& msg);
+ void sysStateChangeJobRemoved(sdbusplus::message_t& msg);
/** @brief Check if JobNew systemd signal is relevant to this object
*
@@ -224,7 +224,7 @@
* @param[in] msg - Data associated with subscribed signal
*
*/
- void sysStateChangeJobNew(sdbusplus::message::message& msg);
+ void sysStateChangeJobNew(sdbusplus::message_t& msg);
/** @brief Decrement reboot count
*
@@ -334,7 +334,7 @@
const std::string& getTarget(Transition tranReq);
/** @brief Persistent sdbusplus DBus bus connection. */
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/** @brief Used to subscribe to dbus systemd JobRemoved signal **/
sdbusplus::bus::match_t systemdSignalJobRemoved;
diff --git a/host_state_manager_main.cpp b/host_state_manager_main.cpp
index 13c8f53..484d6e5 100644
--- a/host_state_manager_main.cpp
+++ b/host_state_manager_main.cpp
@@ -61,7 +61,7 @@
}
// Add sdbusplus ObjectManager.
- sdbusplus::server::manager::manager objManager(bus, objPathInst.c_str());
+ sdbusplus::server::manager_t objManager(bus, objPathInst.c_str());
phosphor::state::manager::Host manager(bus, objPathInst.c_str(), hostId);
diff --git a/hypervisor_state_manager.cpp b/hypervisor_state_manager.cpp
index d0fd193..8e8697b 100644
--- a/hypervisor_state_manager.cpp
+++ b/hypervisor_state_manager.cpp
@@ -91,7 +91,7 @@
}
}
-void Hypervisor::bootProgressChangeEvent(sdbusplus::message::message& msg)
+void Hypervisor::bootProgressChangeEvent(sdbusplus::message_t& msg)
{
std::string statusInterface;
std::map<std::string, std::variant<std::string>> msgData;
diff --git a/hypervisor_state_manager.hpp b/hypervisor_state_manager.hpp
index 929c1aa..7b005f6 100644
--- a/hypervisor_state_manager.hpp
+++ b/hypervisor_state_manager.hpp
@@ -14,7 +14,7 @@
namespace manager
{
-using HypervisorInherit = sdbusplus::server::object::object<
+using HypervisorInherit = sdbusplus::server::object_t<
sdbusplus::xyz::openbmc_project::State::server::Host>;
namespace server = sdbusplus::xyz::openbmc_project::State::server;
@@ -40,7 +40,7 @@
* @param[in] bus - The Dbus bus object
* @param[in] objPath - The Dbus object path
*/
- Hypervisor(sdbusplus::bus::bus& bus, const char* objPath) :
+ Hypervisor(sdbusplus::bus_t& bus, const char* objPath) :
HypervisorInherit(bus, objPath,
HypervisorInherit::action::emit_object_added),
bus(bus),
@@ -80,10 +80,10 @@
* @param[in] msg - Data associated with subscribed signal
*
*/
- void bootProgressChangeEvent(sdbusplus::message::message& msg);
+ void bootProgressChangeEvent(sdbusplus::message_t& msg);
/** @brief Persistent sdbusplus DBus bus connection. */
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/** @brief Watch BootProgress changes to know hypervisor state **/
sdbusplus::bus::match_t bootProgressChangeSignal;
diff --git a/hypervisor_state_manager_main.cpp b/hypervisor_state_manager_main.cpp
index 61154d6..bb94750 100644
--- a/hypervisor_state_manager_main.cpp
+++ b/hypervisor_state_manager_main.cpp
@@ -14,7 +14,7 @@
auto objPathInst = std::string{HYPERVISOR_OBJPATH} + '0';
// Add sdbusplus ObjectManager.
- sdbusplus::server::manager::manager objManager(bus, objPathInst.c_str());
+ sdbusplus::server::manager_t objManager(bus, objPathInst.c_str());
phosphor::state::manager::Hypervisor manager(bus, objPathInst.c_str());
diff --git a/scheduled_host_transition.hpp b/scheduled_host_transition.hpp
index ec97c52..352fc8c 100644
--- a/scheduled_host_transition.hpp
+++ b/scheduled_host_transition.hpp
@@ -18,7 +18,7 @@
using Transition =
sdbusplus::xyz::openbmc_project::State::server::Host::Transition;
-using ScheduledHostTransitionInherit = sdbusplus::server::object::object<
+using ScheduledHostTransitionInherit = sdbusplus::server::object_t<
sdbusplus::xyz::openbmc_project::State::server::ScheduledHostTransition>;
/** @class ScheduledHostTransition
@@ -29,7 +29,7 @@
class ScheduledHostTransition : public ScheduledHostTransitionInherit
{
public:
- ScheduledHostTransition(sdbusplus::bus::bus& bus, const char* objPath,
+ ScheduledHostTransition(sdbusplus::bus_t& bus, const char* objPath,
size_t id, const sdeventplus::Event& event) :
ScheduledHostTransitionInherit(
bus, objPath, ScheduledHostTransition::action::defer_emit),
@@ -60,7 +60,7 @@
friend class TestScheduledHostTransition;
/** @brief sdbusplus bus client connection */
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/** @brief Host id. **/
const size_t id = 0;
diff --git a/scheduled_host_transition_main.cpp b/scheduled_host_transition_main.cpp
index 600ee72..7e02f8d 100644
--- a/scheduled_host_transition_main.cpp
+++ b/scheduled_host_transition_main.cpp
@@ -51,7 +51,7 @@
}
// Add sdbusplus ObjectManager.
- sdbusplus::server::manager::manager objManager(bus, objPathInst.c_str());
+ sdbusplus::server::manager_t objManager(bus, objPathInst.c_str());
phosphor::state::manager::ScheduledHostTransition manager(
bus, objPathInst.c_str(), hostId, event);
diff --git a/secure_boot_check.cpp b/secure_boot_check.cpp
index 877b318..fc5cec0 100644
--- a/secure_boot_check.cpp
+++ b/secure_boot_check.cpp
@@ -36,7 +36,7 @@
auto reply = bus.call(method);
reply.read(mfgModeEnabled);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in property Get, error {ERROR}, property {PROPERTY}",
"ERROR", e, "PROPERTY", propertyName);
diff --git a/settings.cpp b/settings.cpp
index 8146261..ac99660 100644
--- a/settings.cpp
+++ b/settings.cpp
@@ -18,7 +18,7 @@
constexpr auto mapperPath = "/xyz/openbmc_project/object_mapper";
constexpr auto mapperIntf = "xyz.openbmc_project.ObjectMapper";
-Objects::Objects(sdbusplus::bus::bus& bus, const Path& root) : bus(bus)
+Objects::Objects(sdbusplus::bus_t& bus, const Path& root) : bus(bus)
{
std::vector<std::string> settingsIntfs = {autoRebootIntf, powerRestoreIntf};
auto depth = 0;
@@ -44,7 +44,7 @@
elog<InternalFailure>();
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in mapper GetSubTree: {ERROR}", "ERROR", e);
elog<InternalFailure>();
@@ -112,7 +112,7 @@
auto response = bus.call(mapperCall);
response.read(result);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in mapper GetObject: {ERROR}", "ERROR", e);
elog<InternalFailure>();
@@ -127,7 +127,7 @@
return result.begin()->first;
}
-HostObjects::HostObjects(sdbusplus::bus::bus& bus, size_t id) :
+HostObjects::HostObjects(sdbusplus::bus_t& bus, size_t id) :
Objects(bus, Path("/xyz/openbmc_project/control/host") + std::to_string(id))
{}
diff --git a/settings.hpp b/settings.hpp
index b54f202..8f2dcda 100644
--- a/settings.hpp
+++ b/settings.hpp
@@ -27,7 +27,7 @@
* @param[in] bus - The Dbus bus object
* @param[in] root - The root object path
*/
- explicit Objects(sdbusplus::bus::bus& bus, const Path& root = defaultRoot);
+ explicit Objects(sdbusplus::bus_t& bus, const Path& root = defaultRoot);
Objects(const Objects&) = delete;
Objects& operator=(const Objects&) = delete;
Objects(Objects&&) = delete;
@@ -58,7 +58,7 @@
Path powerRestorePolicyOneTime;
/** @brief The Dbus bus object */
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
};
/** @class HostObjects
@@ -74,7 +74,7 @@
* @param[in] bus - The Dbus bus object
* @param[in] id - The Host id
*/
- HostObjects(sdbusplus::bus::bus& bus, size_t id);
+ HostObjects(sdbusplus::bus_t& bus, size_t id);
};
} // namespace settings
diff --git a/systemd_target_signal.cpp b/systemd_target_signal.cpp
index 5f7036f..8c76b97 100644
--- a/systemd_target_signal.cpp
+++ b/systemd_target_signal.cpp
@@ -34,7 +34,7 @@
{
this->bus.call_noreply(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Failed to start BMC quiesce target, exception:{ERROR}", "ERROR",
e);
@@ -62,7 +62,7 @@
{
this->bus.call_noreply(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Failed to create systemd target error, error:{ERROR_MSG}, "
"result:{RESULT}, exception:{ERROR}",
@@ -113,7 +113,7 @@
return (std::string{});
}
-void SystemdTargetLogging::systemdUnitChange(sdbusplus::message::message& msg)
+void SystemdTargetLogging::systemdUnitChange(sdbusplus::message_t& msg)
{
uint32_t id;
sdbusplus::message::object_path objPath;
@@ -136,8 +136,7 @@
return;
}
-void SystemdTargetLogging::processNameChangeSignal(
- sdbusplus::message::message& msg)
+void SystemdTargetLogging::processNameChangeSignal(sdbusplus::message_t& msg)
{
std::string name; // well-known
std::string old_owner; // unique-name
@@ -164,7 +163,7 @@
{
this->bus.call(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
// If error indicates systemd is not on dbus yet then do nothing.
// The systemdNameChangeSignals callback will detect when it is on
diff --git a/systemd_target_signal.hpp b/systemd_target_signal.hpp
index 61f3f06..e6bbcbe 100644
--- a/systemd_target_signal.hpp
+++ b/systemd_target_signal.hpp
@@ -30,7 +30,7 @@
SystemdTargetLogging(const TargetErrorData& targetData,
const ServiceMonitorData& serviceData,
- sdbusplus::bus::bus& bus) :
+ sdbusplus::bus_t& bus) :
targetData(targetData),
serviceData(serviceData), bus(bus),
systemdJobRemovedSignal(
@@ -92,7 +92,7 @@
* @param[in] msg - Data associated with subscribed signal
*
*/
- void systemdUnitChange(sdbusplus::message::message& msg);
+ void systemdUnitChange(sdbusplus::message_t& msg);
/** @brief Wait for systemd to show up on dbus
*
@@ -102,7 +102,7 @@
* @param[in] msg - Data associated with subscribed signal
*
*/
- void processNameChangeSignal(sdbusplus::message::message& msg);
+ void processNameChangeSignal(sdbusplus::message_t& msg);
/** @brief Systemd targets to monitor and error logs to create */
const TargetErrorData& targetData;
@@ -111,7 +111,7 @@
const ServiceMonitorData& serviceData;
/** @brief Persistent sdbusplus DBus bus connection. */
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/** @brief Used to subscribe to dbus systemd JobRemoved signals **/
sdbusplus::bus::match_t systemdJobRemovedSignal;
diff --git a/test/test_scheduled_host_transition.cpp b/test/test_scheduled_host_transition.cpp
index 972248c..76b625a 100644
--- a/test/test_scheduled_host_transition.cpp
+++ b/test/test_scheduled_host_transition.cpp
@@ -26,7 +26,7 @@
public:
sdeventplus::Event event;
sdbusplus::SdBusMock sdbusMock;
- sdbusplus::bus::bus mockedBus = sdbusplus::get_mocked_new(&sdbusMock);
+ sdbusplus::bus_t mockedBus = sdbusplus::get_mocked_new(&sdbusMock);
ScheduledHostTransition scheduledHostTransition;
TestScheduledHostTransition() :
diff --git a/utils.cpp b/utils.cpp
index 77b20eb..ced4e90 100644
--- a/utils.cpp
+++ b/utils.cpp
@@ -20,7 +20,7 @@
constexpr auto MAPPER_INTERFACE = "xyz.openbmc_project.ObjectMapper";
constexpr auto PROPERTY_INTERFACE = "org.freedesktop.DBus.Properties";
-std::string getService(sdbusplus::bus::bus& bus, std::string path,
+std::string getService(sdbusplus::bus_t& bus, std::string path,
std::string interface)
{
auto mapper = bus.new_method_call(MAPPER_BUSNAME, MAPPER_PATH,
@@ -44,7 +44,7 @@
throw std::runtime_error("Error no matching service");
}
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in mapper call with path {PATH}, interface "
"{INTERFACE}, and exception {ERROR}",
@@ -55,7 +55,7 @@
return mapperResponse.begin()->first;
}
-std::string getProperty(sdbusplus::bus::bus& bus, const std::string& path,
+std::string getProperty(sdbusplus::bus_t& bus, const std::string& path,
const std::string& interface,
const std::string& propertyName)
{
@@ -72,7 +72,7 @@
auto reply = bus.call(method);
reply.read(property);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Error in property Get, error {ERROR}, property {PROPERTY}",
"ERROR", e, "PROPERTY", propertyName);
@@ -89,7 +89,7 @@
return std::get<std::string>(property);
}
-void setProperty(sdbusplus::bus::bus& bus, const std::string& path,
+void setProperty(sdbusplus::bus_t& bus, const std::string& path,
const std::string& interface, const std::string& property,
const std::string& value)
{
@@ -130,7 +130,7 @@
}
void createError(
- sdbusplus::bus::bus& bus, const std::string& errorMsg,
+ sdbusplus::bus_t& bus, const std::string& errorMsg,
sdbusplus::xyz::openbmc_project::Logging::server::Entry::Level errLevel,
std::map<std::string, std::string> additionalData)
{
@@ -146,7 +146,7 @@
method.append(errorMsg, errLevel, additionalData);
auto resp = bus.call(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("sdbusplus D-Bus call exception, error {ERROR} trying to create "
"an error with {ERROR_MSG}",
@@ -162,7 +162,7 @@
}
}
-void createBmcDump(sdbusplus::bus::bus& bus)
+void createBmcDump(sdbusplus::bus_t& bus)
{
auto method = bus.new_method_call(
"xyz.openbmc_project.Dump.Manager", "/xyz/openbmc_project/dump/bmc",
@@ -174,7 +174,7 @@
{
bus.call_noreply(method);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
error("Failed to create BMC dump, exception:{ERROR}", "ERROR", e);
// just continue, this is error path anyway so we're just collecting
diff --git a/utils.hpp b/utils.hpp
index 5e747b7..c7f3947 100644
--- a/utils.hpp
+++ b/utils.hpp
@@ -20,7 +20,7 @@
*
* @return The name of the service
*/
-std::string getService(sdbusplus::bus::bus& bus, std::string path,
+std::string getService(sdbusplus::bus_t& bus, std::string path,
std::string interface);
/** @brief Get the value of input property
@@ -32,7 +32,7 @@
*
* @return The value of the property
*/
-std::string getProperty(sdbusplus::bus::bus& bus, const std::string& path,
+std::string getProperty(sdbusplus::bus_t& bus, const std::string& path,
const std::string& interface,
const std::string& propertyName);
@@ -44,7 +44,7 @@
* @param[in] property - The property name to set
* @param[in] value - The value of property
*/
-void setProperty(sdbusplus::bus::bus& bus, const std::string& path,
+void setProperty(sdbusplus::bus_t& bus, const std::string& path,
const std::string& interface, const std::string& property,
const std::string& value);
@@ -64,7 +64,7 @@
* parampin] additionalData - Optional extra data to add to the log
*/
void createError(
- sdbusplus::bus::bus& bus, const std::string& errorMsg,
+ sdbusplus::bus_t& bus, const std::string& errorMsg,
sdbusplus::xyz::openbmc_project::Logging::server::Entry::Level errLevel,
std::map<std::string, std::string> additionalData = {});
@@ -72,7 +72,7 @@
*
* @param[in] bus - The Dbus bus object
*/
-void createBmcDump(sdbusplus::bus::bus& bus);
+void createBmcDump(sdbusplus::bus_t& bus);
} // namespace utils
} // namespace manager