diff options
-rw-r--r-- | include/dbus_monitor.hpp | 10 | ||||
-rw-r--r-- | include/hostname_monitor.hpp | 6 | ||||
-rw-r--r-- | include/image_upload.hpp | 8 | ||||
-rw-r--r-- | include/openbmc_dbus_rest.hpp | 41 | ||||
-rw-r--r-- | redfish-core/include/event_service_manager.hpp | 6 | ||||
-rw-r--r-- | redfish-core/lib/account_service.hpp | 5 | ||||
-rw-r--r-- | redfish-core/lib/certificate_service.hpp | 7 | ||||
-rw-r--r-- | redfish-core/lib/log_services.hpp | 8 | ||||
-rw-r--r-- | redfish-core/lib/processor.hpp | 4 | ||||
-rw-r--r-- | redfish-core/lib/task.hpp | 25 | ||||
-rw-r--r-- | redfish-core/lib/update_service.hpp | 18 |
11 files changed, 64 insertions, 74 deletions
diff --git a/include/dbus_monitor.hpp b/include/dbus_monitor.hpp index ce0550d341..129422e4ae 100644 --- a/include/dbus_monitor.hpp +++ b/include/dbus_monitor.hpp @@ -18,7 +18,7 @@ namespace dbus_monitor struct DbusWebsocketSession { - std::vector<std::unique_ptr<sdbusplus::bus::match::match>> matches; + std::vector<std::unique_ptr<sdbusplus::bus::match_t>> matches; boost::container::flat_set<std::string, std::less<>, std::vector<std::string>> interfaces; @@ -44,7 +44,7 @@ inline int onPropertyUpdate(sd_bus_message* m, void* userdata, BMCWEB_LOG_ERROR << "Couldn't find dbus connection " << connection; return 0; } - sdbusplus::message::message message(m); + sdbusplus::message_t message(m); nlohmann::json json; json["event"] = message.get_member(); json["path"] = message.get_path(); @@ -206,7 +206,7 @@ inline void requestRoutes(App& app) BMCWEB_LOG_DEBUG << "Creating match " << propertiesMatchString; thisSession.matches.emplace_back( - std::make_unique<sdbusplus::bus::match::match>( + std::make_unique<sdbusplus::bus::match_t>( *crow::connections::systemBus, propertiesMatchString, onPropertyUpdate, &conn)); } @@ -229,7 +229,7 @@ inline void requestRoutes(App& app) ifaceMatchString += "'"; BMCWEB_LOG_DEBUG << "Creating match " << ifaceMatchString; thisSession.matches.emplace_back( - std::make_unique<sdbusplus::bus::match::match>( + std::make_unique<sdbusplus::bus::match_t>( *crow::connections::systemBus, ifaceMatchString, onPropertyUpdate, &conn)); } @@ -243,7 +243,7 @@ inline void requestRoutes(App& app) "member='InterfacesAdded'"); BMCWEB_LOG_DEBUG << "Creating match " << objectManagerMatchString; thisSession.matches.emplace_back( - std::make_unique<sdbusplus::bus::match::match>( + std::make_unique<sdbusplus::bus::match_t>( *crow::connections::systemBus, objectManagerMatchString, onPropertyUpdate, &conn)); } diff --git a/include/hostname_monitor.hpp b/include/hostname_monitor.hpp index 738dc1b22b..3fb42e49c0 100644 --- a/include/hostname_monitor.hpp +++ b/include/hostname_monitor.hpp @@ -11,7 +11,7 @@ namespace crow { namespace hostname_monitor { -static std::unique_ptr<sdbusplus::bus::match::match> hostnameSignalMonitor; +static std::unique_ptr<sdbusplus::bus::match_t> hostnameSignalMonitor; inline void installCertificate(const std::filesystem::path& certPath) { @@ -41,7 +41,7 @@ inline int onPropertyUpdate(sd_bus_message* m, void* /* userdata */, return 0; } - sdbusplus::message::message message(m); + sdbusplus::message_t message(m); std::string iface; dbus::utility::DBusPropertiesMap changedProperties; @@ -133,7 +133,7 @@ inline void registerHostnameSignal() "arg0='xyz.openbmc_project.Network.SystemConfiguration'," "member='PropertiesChanged'"); - hostnameSignalMonitor = std::make_unique<sdbusplus::bus::match::match>( + hostnameSignalMonitor = std::make_unique<sdbusplus::bus::match_t>( *crow::connections::systemBus, propertiesMatchString, onPropertyUpdate, nullptr); } diff --git a/include/image_upload.hpp b/include/image_upload.hpp index 0fff1ea03f..4defbb6682 100644 --- a/include/image_upload.hpp +++ b/include/image_upload.hpp @@ -16,7 +16,7 @@ namespace crow namespace image_upload { -static std::unique_ptr<sdbusplus::bus::match::match> fwUpdateMatcher; +static std::unique_ptr<sdbusplus::bus::match_t> fwUpdateMatcher; inline void uploadImageHandler(const crow::Request& req, @@ -57,8 +57,8 @@ inline void asyncResp->res.jsonValue["status"] = "error"; }; - std::function<void(sdbusplus::message::message&)> callback = - [asyncResp](sdbusplus::message::message& m) { + std::function<void(sdbusplus::message_t&)> callback = + [asyncResp](sdbusplus::message_t& m) { BMCWEB_LOG_DEBUG << "Match fired"; sdbusplus::message::object_path path; @@ -84,7 +84,7 @@ inline void fwUpdateMatcher = nullptr; } }; - fwUpdateMatcher = std::make_unique<sdbusplus::bus::match::match>( + fwUpdateMatcher = std::make_unique<sdbusplus::bus::match_t>( *crow::connections::systemBus, "interface='org.freedesktop.DBus.ObjectManager',type='signal'," "member='InterfacesAdded',path='/xyz/openbmc_project/software'", diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp index d4700a379b..9c8d9f5e71 100644 --- a/include/openbmc_dbus_rest.hpp +++ b/include/openbmc_dbus_rest.hpp @@ -938,7 +938,7 @@ inline int convertJsonToDbus(sd_bus_message* m, const std::string& argType, } template <typename T> -int readMessageItem(const std::string& typeCode, sdbusplus::message::message& m, +int readMessageItem(const std::string& typeCode, sdbusplus::message_t& m, nlohmann::json& data) { T value; @@ -955,11 +955,11 @@ int readMessageItem(const std::string& typeCode, sdbusplus::message::message& m, return 0; } -int convertDBusToJSON(const std::string& returnType, - sdbusplus::message::message& m, nlohmann::json& response); +int convertDBusToJSON(const std::string& returnType, sdbusplus::message_t& m, + nlohmann::json& response); inline int readDictEntryFromMessage(const std::string& typeCode, - sdbusplus::message::message& m, + sdbusplus::message_t& m, nlohmann::json& object) { std::vector<std::string> types = dbusArgSplit(typeCode); @@ -1018,8 +1018,7 @@ inline int readDictEntryFromMessage(const std::string& typeCode, } inline int readArrayFromMessage(const std::string& typeCode, - sdbusplus::message::message& m, - nlohmann::json& data) + sdbusplus::message_t& m, nlohmann::json& data) { if (typeCode.size() < 2) { @@ -1098,8 +1097,7 @@ inline int readArrayFromMessage(const std::string& typeCode, } inline int readStructFromMessage(const std::string& typeCode, - sdbusplus::message::message& m, - nlohmann::json& data) + sdbusplus::message_t& m, nlohmann::json& data) { if (typeCode.size() < 3) { @@ -1139,8 +1137,7 @@ inline int readStructFromMessage(const std::string& typeCode, return 0; } -inline int readVariantFromMessage(sdbusplus::message::message& m, - nlohmann::json& data) +inline int readVariantFromMessage(sdbusplus::message_t& m, nlohmann::json& data) { const char* containerType = nullptr; int r = sd_bus_message_peek_type(m.get(), nullptr, &containerType); @@ -1176,8 +1173,7 @@ inline int readVariantFromMessage(sdbusplus::message::message& m, } inline int convertDBusToJSON(const std::string& returnType, - sdbusplus::message::message& m, - nlohmann::json& response) + sdbusplus::message_t& m, nlohmann::json& response) { int r = 0; const std::vector<std::string> returnTypes = dbusArgSplit(returnType); @@ -1317,7 +1313,7 @@ inline int convertDBusToJSON(const std::string& returnType, inline void handleMethodResponse( const std::shared_ptr<InProgressActionData>& transaction, - sdbusplus::message::message& m, const std::string& returnType) + sdbusplus::message_t& m, const std::string& returnType) { nlohmann::json data; @@ -1434,7 +1430,7 @@ inline void findActionOnInterface( BMCWEB_LOG_DEBUG << "Found method named " << thisMethodName << " on interface " << thisInterfaceName; - sdbusplus::message::message m = + sdbusplus::message_t m = crow::connections::systemBus->new_method_call( connectionName.c_str(), transaction->path.c_str(), thisInterfaceName, @@ -1500,7 +1496,7 @@ inline void findActionOnInterface( m, [transaction, returnType](boost::system::error_code ec2, - sdbusplus::message::message& m2) { + sdbusplus::message_t& m2) { if (ec2) { transaction->methodFailed = true; @@ -1748,7 +1744,7 @@ inline void handleGet(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, for (const std::string& interface : interfaceNames) { - sdbusplus::message::message m = + sdbusplus::message_t m = crow::connections::systemBus->new_method_call( connection.first.c_str(), path->c_str(), "org.freedesktop.DBus.Properties", "GetAll"); @@ -1756,7 +1752,7 @@ inline void handleGet(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, crow::connections::systemBus->async_send( m, [asyncResp, response, propertyName](const boost::system::error_code ec2, - sdbusplus::message::message& msg) { + sdbusplus::message_t& msg) { if (ec2) { BMCWEB_LOG_ERROR << "Bad dbus request error: " @@ -1942,7 +1938,7 @@ inline void handlePut(const crow::Request& req, const char* argType = propNode->Attribute("type"); if (argType != nullptr) { - sdbusplus::message::message m = + sdbusplus::message_t m = crow::connections::systemBus ->new_method_call( connectionName.c_str(), @@ -1988,9 +1984,8 @@ inline void handlePut(const crow::Request& req, } crow::connections::systemBus->async_send( m, - [transaction]( - boost::system::error_code ec, - sdbusplus::message::message& m2) { + [transaction](boost::system::error_code ec, + sdbusplus::message_t& m2) { BMCWEB_LOG_DEBUG << "sent"; if (ec) { @@ -2366,7 +2361,7 @@ inline void const char* type = property->Attribute("type"); if (type != nullptr && name != nullptr) { - sdbusplus::message::message m = + sdbusplus::message_t m = crow::connections::systemBus->new_method_call( processName.c_str(), objectPath.c_str(), "org.freedesktop." @@ -2378,7 +2373,7 @@ inline void crow::connections::systemBus->async_send( m, [&propertyItem, asyncResp](const boost::system::error_code& e, - sdbusplus::message::message& msg) { + sdbusplus::message_t& msg) { if (e) { return; diff --git a/redfish-core/include/event_service_manager.hpp b/redfish-core/include/event_service_manager.hpp index 0bce29f541..6b3f84fc90 100644 --- a/redfish-core/include/event_service_manager.hpp +++ b/redfish-core/include/event_service_manager.hpp @@ -606,7 +606,7 @@ class EventServiceManager std::streampos redfishLogFilePosition{0}; size_t noOfEventLogSubscribers{0}; size_t noOfMetricReportSubscribers{0}; - std::shared_ptr<sdbusplus::bus::match::match> matchTelemetryMonitor; + std::shared_ptr<sdbusplus::bus::match_t> matchTelemetryMonitor; boost::container::flat_map<std::string, std::shared_ptr<Subscription>> subscriptionsMap; @@ -1337,7 +1337,7 @@ class EventServiceManager } #endif - static void getReadingsForReport(sdbusplus::message::message& msg) + static void getReadingsForReport(sdbusplus::message_t& msg) { if (msg.is_method_error()) { @@ -1409,7 +1409,7 @@ class EventServiceManager "interface='org.freedesktop.DBus.Properties'," "arg0=xyz.openbmc_project.Telemetry.Report"; - matchTelemetryMonitor = std::make_shared<sdbusplus::bus::match::match>( + matchTelemetryMonitor = std::make_shared<sdbusplus::bus::match_t>( *crow::connections::systemBus, matchStr, getReadingsForReport); } }; diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp index f8ba322566..9a8142da66 100644 --- a/redfish-core/lib/account_service.hpp +++ b/redfish-core/lib/account_service.hpp @@ -1584,7 +1584,7 @@ inline void handleAccountCollectionPost( crow::connections::systemBus->async_method_call( [asyncResp, username, password](const boost::system::error_code ec2, - sdbusplus::message::message& m) { + sdbusplus::message_t& m) { if (ec2) { userErrorMessageHandler(m.get_error(), asyncResp, username, ""); @@ -1900,8 +1900,7 @@ inline void crow::connections::systemBus->async_method_call( [asyncResp, username, password(std::move(password)), roleId(std::move(roleId)), enabled, newUser{std::string(*newUserName)}, - locked](const boost::system::error_code ec, - sdbusplus::message::message& m) { + locked](const boost::system::error_code ec, sdbusplus::message_t& m) { if (ec) { userErrorMessageHandler(m.get_error(), asyncResp, newUser, diff --git a/redfish-core/lib/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp index c2c873d6b9..22d77a728b 100644 --- a/redfish-core/lib/certificate_service.hpp +++ b/redfish-core/lib/certificate_service.hpp @@ -199,7 +199,7 @@ class CertificateFile std::filesystem::path certDirectory; }; -static std::unique_ptr<sdbusplus::bus::match::match> csrMatcher; +static std::unique_ptr<sdbusplus::bus::match_t> csrMatcher; /** * @brief Read data from CSR D-bus object and set to response * @@ -441,10 +441,9 @@ inline void requestRoutesCertificateActionGenerateCSR(App& app) objectPath + "'," "member='InterfacesAdded'"); - csrMatcher = std::make_unique<sdbusplus::bus::match::match>( + csrMatcher = std::make_unique<sdbusplus::bus::match_t>( *crow::connections::systemBus, match, - [asyncResp, service, objectPath, - certURI](sdbusplus::message::message& m) { + [asyncResp, service, objectPath, certURI](sdbusplus::message_t& m) { timeout.cancel(); if (m.is_method_error()) { diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp index 120a751dc4..6285aa8603 100644 --- a/redfish-core/lib/log_services.hpp +++ b/redfish-core/lib/log_services.hpp @@ -693,9 +693,9 @@ inline void const std::string& dumpType) { std::shared_ptr<task::TaskData> task = task::TaskData::createTask( - [dumpId, dumpPath, dumpType]( - boost::system::error_code err, sdbusplus::message::message& m, - const std::shared_ptr<task::TaskData>& taskData) { + [dumpId, dumpPath, + dumpType](boost::system::error_code err, sdbusplus::message_t& m, + const std::shared_ptr<task::TaskData>& taskData) { if (err) { BMCWEB_LOG_ERROR << "Error in creating a dump"; @@ -3087,7 +3087,7 @@ inline void requestRoutesCrashdumpCollect(App& app) return; } std::shared_ptr<task::TaskData> task = task::TaskData::createTask( - [](boost::system::error_code err, sdbusplus::message::message&, + [](boost::system::error_code err, sdbusplus::message_t&, const std::shared_ptr<task::TaskData>& taskData) { if (!err) { diff --git a/redfish-core/lib/processor.hpp b/redfish-core/lib/processor.hpp index a7f8a413fe..becb7949a1 100644 --- a/redfish-core/lib/processor.hpp +++ b/redfish-core/lib/processor.hpp @@ -929,7 +929,7 @@ inline void handleAppliedConfigResponse(const std::shared_ptr<bmcweb::AsyncResp>& resp, const std::string& setPropVal, boost::system::error_code ec, - const sdbusplus::message::message& msg) + const sdbusplus::message_t& msg) { if (!ec) { @@ -1035,7 +1035,7 @@ inline void patchAppliedOperatingConfig( // Set the property, with handler to check error responses crow::connections::systemBus->async_method_call( [resp, appliedConfigUri](const boost::system::error_code ec, - const sdbusplus::message::message& msg) { + const sdbusplus::message_t& msg) { handleAppliedConfigResponse(resp, appliedConfigUri, ec, msg); }, *controlService, cpuObjectPath, "org.freedesktop.DBus.Properties", diff --git a/redfish-core/lib/task.hpp b/redfish-core/lib/task.hpp index 88926146f0..7d96e42e62 100644 --- a/redfish-core/lib/task.hpp +++ b/redfish-core/lib/task.hpp @@ -84,10 +84,10 @@ struct Payload struct TaskData : std::enable_shared_from_this<TaskData> { private: - TaskData(std::function<bool(boost::system::error_code, - sdbusplus::message::message&, - const std::shared_ptr<TaskData>&)>&& handler, - const std::string& matchIn, size_t idx) : + TaskData( + std::function<bool(boost::system::error_code, sdbusplus::message_t&, + const std::shared_ptr<TaskData>&)>&& handler, + const std::string& matchIn, size_t idx) : callback(std::move(handler)), matchStr(matchIn), index(idx), startTime(std::chrono::system_clock::to_time_t( @@ -101,8 +101,7 @@ struct TaskData : std::enable_shared_from_this<TaskData> TaskData() = delete; static std::shared_ptr<TaskData>& createTask( - std::function<bool(boost::system::error_code, - sdbusplus::message::message&, + std::function<bool(boost::system::error_code, sdbusplus::message_t&, const std::shared_ptr<TaskData>&)>&& handler, const std::string& match) { @@ -111,7 +110,7 @@ struct TaskData : std::enable_shared_from_this<TaskData> { MakeSharedHelper( std::function<bool(boost::system::error_code, - sdbusplus::message::message&, + sdbusplus::message_t&, const std::shared_ptr<TaskData>&)>&& handler, const std::string& match2, size_t idx) : TaskData(std::move(handler), match2, idx) @@ -179,7 +178,7 @@ struct TaskData : std::enable_shared_from_this<TaskData> ec = boost::asio::error::operation_aborted; } self->match.reset(); - sdbusplus::message::message msg; + sdbusplus::message_t msg; self->finishTask(); self->state = "Cancelled"; self->status = "Warning"; @@ -268,10 +267,10 @@ struct TaskData : std::enable_shared_from_this<TaskData> { return; } - match = std::make_unique<sdbusplus::bus::match::match>( - static_cast<sdbusplus::bus::bus&>(*crow::connections::systemBus), + match = std::make_unique<sdbusplus::bus::match_t>( + static_cast<sdbusplus::bus_t&>(*crow::connections::systemBus), matchStr, - [self = shared_from_this()](sdbusplus::message::message& message) { + [self = shared_from_this()](sdbusplus::message_t& message) { boost::system::error_code ec; // callback to return True if callback is done, callback needs @@ -298,7 +297,7 @@ struct TaskData : std::enable_shared_from_this<TaskData> sendTaskEvent(state, index); } - std::function<bool(boost::system::error_code, sdbusplus::message::message&, + std::function<bool(boost::system::error_code, sdbusplus::message_t&, const std::shared_ptr<TaskData>&)> callback; std::string matchStr; @@ -308,7 +307,7 @@ struct TaskData : std::enable_shared_from_this<TaskData> std::string state; nlohmann::json messages; boost::asio::steady_timer timer; - std::unique_ptr<sdbusplus::bus::match::match> match; + std::unique_ptr<sdbusplus::bus::match_t> match; std::optional<time_t> endTime; std::optional<Payload> payload; bool gave204 = false; diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp index 1beef2e865..6cf15d6150 100644 --- a/redfish-core/lib/update_service.hpp +++ b/redfish-core/lib/update_service.hpp @@ -28,8 +28,8 @@ namespace redfish { // Match signals added on software path -static std::unique_ptr<sdbusplus::bus::match::match> fwUpdateMatcher; -static std::unique_ptr<sdbusplus::bus::match::match> fwUpdateErrorMatcher; +static std::unique_ptr<sdbusplus::bus::match_t> fwUpdateMatcher; +static std::unique_ptr<sdbusplus::bus::match_t> fwUpdateErrorMatcher; // Only allow one update at a time static bool fwUpdateInProgress = false; // Timer for software available @@ -63,8 +63,7 @@ inline static void activateImage(const std::string& objPath, // then no asyncResp updates will occur static void softwareInterfaceAdded(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp, - sdbusplus::message::message& m, - task::Payload&& payload) + sdbusplus::message_t& m, task::Payload&& payload) { dbus::utility::DBusInteracesMap interfacesProperties; @@ -120,7 +119,7 @@ static void std::shared_ptr<task::TaskData> task = task::TaskData::createTask( [](boost::system::error_code ec, - sdbusplus::message::message& msg, + sdbusplus::message_t& msg, const std::shared_ptr<task::TaskData>& taskData) { if (ec) @@ -296,26 +295,25 @@ static void monitorForSoftwareAvailable( } }); task::Payload payload(req); - auto callback = - [asyncResp, payload](sdbusplus::message::message& m) mutable { + auto callback = [asyncResp, payload](sdbusplus::message_t& m) mutable { BMCWEB_LOG_DEBUG << "Match fired"; softwareInterfaceAdded(asyncResp, m, std::move(payload)); }; fwUpdateInProgress = true; - fwUpdateMatcher = std::make_unique<sdbusplus::bus::match::match>( + fwUpdateMatcher = std::make_unique<sdbusplus::bus::match_t>( *crow::connections::systemBus, "interface='org.freedesktop.DBus.ObjectManager',type='signal'," "member='InterfacesAdded',path='/xyz/openbmc_project/software'", callback); - fwUpdateErrorMatcher = std::make_unique<sdbusplus::bus::match::match>( + fwUpdateErrorMatcher = std::make_unique<sdbusplus::bus::match_t>( *crow::connections::systemBus, "interface='org.freedesktop.DBus.ObjectManager',type='signal'," "member='InterfacesAdded'," "path='/xyz/openbmc_project/logging'", - [asyncResp, url](sdbusplus::message::message& m) { + [asyncResp, url](sdbusplus::message_t& m) { std::vector<std::pair<std::string, dbus::utility::DBusPropertiesMap>> interfacesProperties; sdbusplus::message::object_path objPath; |