From 5e7e2dc585dc7a7e62d2b648b541e7f50c39ea5d Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Thu, 16 Feb 2023 10:37:01 -0800 Subject: Take boost error_code by reference By convention, we should be following boost here, and passing error_code by reference, not by value. This makes our code consistent, and removes the need for a copy in some cases. Signed-off-by: Ed Tanous Change-Id: Id42ea4a90b6685a84818b87d1506c11256b3b9ae --- COMMON_ERRORS.md | 4 +- http/http_client.hpp | 2 +- http/http_server.hpp | 2 +- http/routing.hpp | 2 +- http/websocket.hpp | 4 +- include/async_resolve.hpp | 2 +- include/dbus_utility.hpp | 6 +- include/google/google_service_root.hpp | 6 +- include/hostname_monitor.hpp | 2 +- include/nbd_proxy.hpp | 24 +++---- include/openbmc_dbus_rest.hpp | 27 ++++---- redfish-core/include/redfish_aggregator.hpp | 2 +- redfish-core/include/utils/sw_utils.hpp | 8 +-- redfish-core/lib/account_service.hpp | 55 +++++++-------- redfish-core/lib/bios.hpp | 2 +- redfish-core/lib/cable.hpp | 4 +- redfish-core/lib/certificate_service.hpp | 16 ++--- redfish-core/lib/chassis.hpp | 20 +++--- redfish-core/lib/ethernet.hpp | 45 +++++++------ redfish-core/lib/health.hpp | 2 +- redfish-core/lib/hypervisor_system.hpp | 22 +++--- redfish-core/lib/led.hpp | 17 ++--- redfish-core/lib/log_services.hpp | 51 +++++++------- redfish-core/lib/managers.hpp | 36 +++++----- redfish-core/lib/memory.hpp | 4 +- redfish-core/lib/metric_report.hpp | 2 +- redfish-core/lib/metric_report_definition.hpp | 6 +- redfish-core/lib/network_protocol.hpp | 16 ++--- redfish-core/lib/pcie.hpp | 6 +- redfish-core/lib/pcie_slots.hpp | 8 +-- redfish-core/lib/power.hpp | 6 +- redfish-core/lib/processor.hpp | 24 +++---- redfish-core/lib/redfish_util.hpp | 4 +- redfish-core/lib/roles.hpp | 2 +- redfish-core/lib/sensors.hpp | 16 ++--- redfish-core/lib/storage.hpp | 18 ++--- redfish-core/lib/systems.hpp | 96 ++++++++++++++------------- redfish-core/lib/telemetry_service.hpp | 2 +- redfish-core/lib/trigger.hpp | 4 +- redfish-core/lib/update_service.hpp | 12 ++-- redfish-core/lib/virtual_media.hpp | 14 ++-- 41 files changed, 304 insertions(+), 297 deletions(-) diff --git a/COMMON_ERRORS.md b/COMMON_ERRORS.md index aa4b042654..70c09e3476 100644 --- a/COMMON_ERRORS.md +++ b/COMMON_ERRORS.md @@ -210,7 +210,7 @@ whole. BMCWEB_ROUTE("/myendpoint/", [](Request& req, Response& res, const std::string& id){ crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const std::string& myProperty) { if (ec) { @@ -242,7 +242,7 @@ An implementation of the above that handles 404 would look like: BMCWEB_ROUTE("/myendpoint/", [](Request& req, Response& res, const std::string& id){ crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const std::string& myProperty) { if (ec == ){ messages::resourceNotFound(res); diff --git a/http/http_client.hpp b/http/http_client.hpp index c902e1a66b..fff261fe46 100644 --- a/http/http_client.hpp +++ b/http/http_client.hpp @@ -401,7 +401,7 @@ class ConnectionInfo : public std::enable_shared_from_this } static void onTimeout(const std::weak_ptr& weakSelf, - const boost::system::error_code ec) + const boost::system::error_code& ec) { if (ec == boost::asio::error::operation_aborted) { diff --git a/http/http_server.hpp b/http/http_server.hpp index cc4fc2294d..3949a46ab0 100644 --- a/http/http_server.hpp +++ b/http/http_server.hpp @@ -181,7 +181,7 @@ class Server } acceptor->async_accept( boost::beast::get_lowest_layer(connection->socket()), - [this, connection](boost::system::error_code ec) { + [this, connection](const boost::system::error_code& ec) { if (!ec) { boost::asio::post(*this->ioService, diff --git a/http/routing.hpp b/http/routing.hpp index ae63f0504c..736ec38c7a 100644 --- a/http/routing.hpp +++ b/http/routing.hpp @@ -1374,7 +1374,7 @@ class Router crow::connections::systemBus->async_method_call( [req{std::move(req)}, asyncResp, &rule, params]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& userInfoMap) mutable { if (ec) { diff --git a/http/websocket.hpp b/http/websocket.hpp index c36e579ea8..f17ee5e7d0 100644 --- a/http/websocket.hpp +++ b/http/websocket.hpp @@ -138,7 +138,7 @@ class ConnectionImpl : public Connection // Perform the websocket upgrade ws.async_accept(req, [this, self(shared_from_this())]( - boost::system::error_code ec) { + const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "Error in ws.async_accept " << ec; @@ -180,7 +180,7 @@ class ConnectionImpl : public Connection { ws.async_close( {boost::beast::websocket::close_code::normal, msg}, - [self(shared_from_this())](boost::system::error_code ec) { + [self(shared_from_this())](const boost::system::error_code& ec) { if (ec == boost::asio::error::operation_aborted) { return; diff --git a/include/async_resolve.hpp b/include/async_resolve.hpp index 0027a054f9..f44be4b73f 100644 --- a/include/async_resolve.hpp +++ b/include/async_resolve.hpp @@ -37,7 +37,7 @@ class Resolver uint64_t flag = 0; crow::connections::systemBus->async_method_call( [host, port, handler{std::forward(handler)}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const std::vector< std::tuple>>& resp, const std::string& hostName, const uint64_t flagNum) { diff --git a/include/dbus_utility.hpp b/include/dbus_utility.hpp index e953a9f0eb..f41c422d30 100644 --- a/include/dbus_utility.hpp +++ b/include/dbus_utility.hpp @@ -133,7 +133,7 @@ inline void checkDbusPathExists(const std::string& path, Callback&& callback) { crow::connections::systemBus->async_method_call( [callback{std::forward(callback)}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::MapperGetObject& objectNames) { callback(!ec && !objectNames.empty()); }, @@ -151,7 +151,7 @@ inline void { crow::connections::systemBus->async_method_call( [callback{std::move(callback)}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const MapperGetSubTreeResponse& subtree) { callback(ec, subtree); }, "xyz.openbmc_project.ObjectMapper", "/xyz/openbmc_project/object_mapper", @@ -167,7 +167,7 @@ inline void getSubTreePaths( { crow::connections::systemBus->async_method_call( [callback{std::move(callback)}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const MapperGetSubTreePathsResponse& subtreePaths) { callback(ec, subtreePaths); }, diff --git a/include/google/google_service_root.hpp b/include/google/google_service_root.hpp index d5d340a984..cbcf15d78e 100644 --- a/include/google/google_service_root.hpp +++ b/include/google/google_service_root.hpp @@ -65,7 +65,7 @@ inline void hothGetSubtreeCallback( const std::string& command, const std::shared_ptr& asyncResp, const std::string& rotId, const ResolvedEntityHandler& entityHandler, - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::MapperGetSubTreeResponse& subtree) { if (ec) @@ -147,7 +147,7 @@ inline void inline void invocationCallback(const std::shared_ptr& asyncResp, - const boost::system::error_code ec, + const boost::system::error_code& ec, const std::vector& responseBytes) { if (ec) @@ -177,7 +177,7 @@ inline void } crow::connections::systemBus->async_method_call( - [asyncResp{asyncResp}](const boost::system::error_code ec, + [asyncResp{asyncResp}](const boost::system::error_code& ec, const std::vector& responseBytes) { invocationCallback(asyncResp, ec, responseBytes); }, diff --git a/include/hostname_monitor.hpp b/include/hostname_monitor.hpp index f0d8bdf322..ed719d5c9c 100644 --- a/include/hostname_monitor.hpp +++ b/include/hostname_monitor.hpp @@ -19,7 +19,7 @@ static std::unique_ptr hostnameSignalMonitor; inline void installCertificate(const std::filesystem::path& certPath) { crow::connections::systemBus->async_method_call( - [certPath](const boost::system::error_code ec) { + [certPath](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "Replace Certificate Fail.."; diff --git a/include/nbd_proxy.hpp b/include/nbd_proxy.hpp index 500ea76555..7ffa9aad18 100644 --- a/include/nbd_proxy.hpp +++ b/include/nbd_proxy.hpp @@ -65,9 +65,9 @@ struct NbdProxyServer : std::enable_shared_from_this void run() { - acceptor.async_accept( - [this, self(shared_from_this())](boost::system::error_code ec, - stream_protocol::socket socket) { + acceptor.async_accept([this, self(shared_from_this())]( + const boost::system::error_code& ec, + stream_protocol::socket socket) { if (ec) { BMCWEB_LOG_ERROR << "UNIX socket: async_accept error = " @@ -93,8 +93,8 @@ struct NbdProxyServer : std::enable_shared_from_this }); auto mountHandler = - [this, self(shared_from_this())](const boost::system::error_code ec, - const bool) { + [this, self(shared_from_this())]( + const boost::system::error_code& ec, const bool) { if (ec) { BMCWEB_LOG_ERROR << "DBus error: cannot call mount method = " @@ -130,7 +130,7 @@ struct NbdProxyServer : std::enable_shared_from_this } // The reference to session should exists until unmount is // called - auto unmountHandler = [](const boost::system::error_code ec) { + auto unmountHandler = [](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "DBus error: " << ec @@ -157,8 +157,8 @@ struct NbdProxyServer : std::enable_shared_from_this // Trigger async read peerSocket->async_read_some( ux2wsBuf.prepare(nbdBufferSize), - [this, self(shared_from_this())](boost::system::error_code ec, - std::size_t bytesRead) { + [this, self(shared_from_this())]( + const boost::system::error_code& ec, std::size_t bytesRead) { if (ec) { BMCWEB_LOG_ERROR << "UNIX socket: async_read_some error = " @@ -208,8 +208,8 @@ struct NbdProxyServer : std::enable_shared_from_this uxWriteInProgress = true; boost::asio::async_write( *peerSocket, ws2uxBuf.data(), - [this, self(shared_from_this())](boost::system::error_code ec, - std::size_t bytesWritten) { + [this, self(shared_from_this())]( + const boost::system::error_code& ec, std::size_t bytesWritten) { ws2uxBuf.consume(bytesWritten); uxWriteInProgress = false; if (ec) @@ -261,7 +261,7 @@ inline void requestRoutes(App& app) BMCWEB_LOG_DEBUG << "nbd-proxy.onopen(" << &conn << ")"; auto getUserInfoHandler = - [&conn](const boost::system::error_code ec, + [&conn](const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& userInfo) { if (ec) { @@ -304,7 +304,7 @@ inline void requestRoutes(App& app) } auto openHandler = - [&conn](const boost::system::error_code ec2, + [&conn](const boost::system::error_code& ec2, const dbus::utility::ManagedObjectType& objects) { const std::string* socketValue = nullptr; const std::string* endpointValue = nullptr; diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp index 30351051dd..98dfb843fa 100644 --- a/include/openbmc_dbus_rest.hpp +++ b/include/openbmc_dbus_rest.hpp @@ -131,7 +131,7 @@ inline void crow::connections::systemBus->async_method_call( [transaction, processName{std::string(processName)}, objectPath{std::string(objectPath)}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const std::string& introspectXml) { if (ec) { @@ -192,7 +192,7 @@ inline void getPropertiesForEnumerate( sdbusplus::asio::getAllProperties( *crow::connections::systemBus, service, objectPath, interface, [asyncResp, objectPath, service, - interface](const boost::system::error_code ec, + interface](const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& propertiesList) { if (ec) { @@ -305,7 +305,7 @@ inline void getManagedObjectsForEnumerate( << " connection_name " << connectionName; crow::connections::systemBus->async_method_call( [transaction, objectName, - connectionName](const boost::system::error_code ec, + connectionName](const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& objects) { if (ec) { @@ -375,7 +375,7 @@ inline void findObjectManagerPathForEnumerate( << " on connection:" << connectionName; crow::connections::systemBus->async_method_call( [transaction, objectName, connectionName]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::MapperGetAncestorsResponse& objects) { if (ec) { @@ -1383,7 +1383,7 @@ inline void findActionOnInterface( << connectionName; crow::connections::systemBus->async_method_call( [transaction, connectionName{std::string(connectionName)}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const std::string& introspectXml) { BMCWEB_LOG_DEBUG << "got xml:\n " << introspectXml; if (ec) @@ -1495,7 +1495,7 @@ inline void findActionOnInterface( crow::connections::systemBus->async_send( m, [transaction, - returnType](boost::system::error_code ec2, + returnType](const boost::system::error_code& ec2, sdbusplus::message_t& m2) { if (ec2) { @@ -1747,7 +1747,7 @@ inline void handleGet(const std::shared_ptr& asyncResp, m.append(interface); crow::connections::systemBus->async_send( m, [asyncResp, response, - propertyName](const boost::system::error_code ec2, + propertyName](const boost::system::error_code& ec2, sdbusplus::message_t& msg) { if (ec2) { @@ -1900,7 +1900,7 @@ inline void handlePut(const crow::Request& req, crow::connections::systemBus->async_method_call( [connectionName{std::string(connectionName)}, - transaction](const boost::system::error_code ec3, + transaction](const boost::system::error_code& ec3, const std::string& introspectXml) { if (ec3) { @@ -1984,8 +1984,9 @@ inline void handlePut(const crow::Request& req, } crow::connections::systemBus->async_send( m, - [transaction](boost::system::error_code ec, - sdbusplus::message_t& m2) { + [transaction]( + const boost::system::error_code& ec, + sdbusplus::message_t& m2) { BMCWEB_LOG_DEBUG << "sent"; if (ec) { @@ -2157,7 +2158,7 @@ inline void { crow::connections::systemBus->async_method_call( [asyncResp, processName, - objectPath](const boost::system::error_code ec, + objectPath](const boost::system::error_code& ec, const std::string& introspectXml) { if (ec) { @@ -2212,7 +2213,7 @@ inline void { crow::connections::systemBus->async_method_call( [asyncResp, processName, objectPath, - interfaceName](const boost::system::error_code ec, + interfaceName](const boost::system::error_code& ec, const std::string& introspectXml) { if (ec) { @@ -2445,7 +2446,7 @@ inline void requestRoutes(App& app) .methods(boost::beast::http::verb::get)( [](const crow::Request&, const std::shared_ptr& asyncResp) { - auto myCallback = [asyncResp](const boost::system::error_code ec, + auto myCallback = [asyncResp](const boost::system::error_code& ec, std::vector& names) { if (ec) { diff --git a/redfish-core/include/redfish_aggregator.hpp b/redfish-core/include/redfish_aggregator.hpp index 080e67e681..6c5cf76ad0 100644 --- a/redfish-core/include/redfish_aggregator.hpp +++ b/redfish-core/include/redfish_aggregator.hpp @@ -254,7 +254,7 @@ class RedfishAggregator { BMCWEB_LOG_DEBUG << "Gathering satellite configs"; crow::connections::systemBus->async_method_call( - [handler](const boost::system::error_code ec, + [handler](const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& objects) { if (ec) { diff --git a/redfish-core/include/utils/sw_utils.hpp b/redfish-core/include/utils/sw_utils.hpp index aa3bd4f6a9..0b560f8c7f 100644 --- a/redfish-core/include/utils/sw_utils.hpp +++ b/redfish-core/include/utils/sw_utils.hpp @@ -53,7 +53,7 @@ inline void "/xyz/openbmc_project/software/functional", "xyz.openbmc_project.Association", "endpoints", [aResp, swVersionPurpose, activeVersionPropName, - populateLinkToImages](const boost::system::error_code ec, + populateLinkToImages](const boost::system::error_code& ec, const std::vector& functionalSw) { BMCWEB_LOG_DEBUG << "populateSoftwareInformation enter"; if (ec) @@ -139,7 +139,7 @@ inline void obj.first, "xyz.openbmc_project.Software.Version", [aResp, swId, runningImage, swVersionPurpose, activeVersionPropName, populateLinkToImages]( - const boost::system::error_code ec3, + const boost::system::error_code& ec3, const dbus::utility::DBusPropertiesMap& propertiesList) { if (ec3) @@ -306,7 +306,7 @@ inline void getSwStatus(const std::shared_ptr& asyncResp, "/xyz/openbmc_project/software/" + *swId, "xyz.openbmc_project.Software.Activation", [asyncResp, - swId](const boost::system::error_code errorCode, + swId](const boost::system::error_code& errorCode, const dbus::utility::DBusPropertiesMap& propertiesList) { if (errorCode) { @@ -359,7 +359,7 @@ inline void *crow::connections::systemBus, "xyz.openbmc_project.ObjectMapper", "/xyz/openbmc_project/software/updateable", "xyz.openbmc_project.Association", "endpoints", - [asyncResp, swId](const boost::system::error_code ec, + [asyncResp, swId](const boost::system::error_code& ec, const std::vector& objPaths) { if (ec) { diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp index 9a931ad93a..ea1571ef8b 100644 --- a/redfish-core/lib/account_service.hpp +++ b/redfish-core/lib/account_service.hpp @@ -258,7 +258,7 @@ inline void handleRoleMapPatch( { crow::connections::systemBus->async_method_call( [asyncResp, roleMapObjData, serverType, - index](const boost::system::error_code ec) { + index](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "DBUS response error: " << ec; @@ -313,7 +313,7 @@ inline void handleRoleMapPatch( { crow::connections::systemBus->async_method_call( [asyncResp, roleMapObjData, serverType, index, - remoteGroup](const boost::system::error_code ec) { + remoteGroup](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "DBUS response error: " << ec; @@ -337,7 +337,7 @@ inline void handleRoleMapPatch( { crow::connections::systemBus->async_method_call( [asyncResp, roleMapObjData, serverType, index, - localRole](const boost::system::error_code ec) { + localRole](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "DBUS response error: " << ec; @@ -392,7 +392,7 @@ inline void handleRoleMapPatch( crow::connections::systemBus->async_method_call( [asyncResp, serverType, localRole, - remoteGroup](const boost::system::error_code ec) { + remoteGroup](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "DBUS response error: " << ec; @@ -442,7 +442,7 @@ inline void getLDAPConfigData(const std::string& ldapType, std::string service = resp.begin()->first; crow::connections::systemBus->async_method_call( [callback, - ldapType](const boost::system::error_code errorCode, + ldapType](const boost::system::error_code& errorCode, const dbus::utility::ManagedObjectType& ldapObjects) { LDAPConfigData confData{}; if (errorCode) @@ -665,7 +665,7 @@ inline void handleServiceAddressPatch( { crow::connections::systemBus->async_method_call( [asyncResp, ldapServerElementName, - serviceAddressList](const boost::system::error_code ec) { + serviceAddressList](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG @@ -705,7 +705,7 @@ inline void { crow::connections::systemBus->async_method_call( [asyncResp, username, - ldapServerElementName](const boost::system::error_code ec) { + ldapServerElementName](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG << "Error occurred in updating the username"; @@ -738,7 +738,7 @@ inline void { crow::connections::systemBus->async_method_call( [asyncResp, password, - ldapServerElementName](const boost::system::error_code ec) { + ldapServerElementName](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG << "Error occurred in updating the password"; @@ -772,7 +772,7 @@ inline void { crow::connections::systemBus->async_method_call( [asyncResp, baseDNList, - ldapServerElementName](const boost::system::error_code ec) { + ldapServerElementName](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG << "Error Occurred in Updating the base DN"; @@ -812,7 +812,7 @@ inline void { crow::connections::systemBus->async_method_call( [asyncResp, userNameAttribute, - ldapServerElementName](const boost::system::error_code ec) { + ldapServerElementName](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG << "Error Occurred in Updating the " @@ -847,7 +847,7 @@ inline void handleGroupNameAttrPatch( { crow::connections::systemBus->async_method_call( [asyncResp, groupsAttribute, - ldapServerElementName](const boost::system::error_code ec) { + ldapServerElementName](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG << "Error Occurred in Updating the " @@ -881,7 +881,7 @@ inline void handleServiceEnablePatch( { crow::connections::systemBus->async_method_call( [asyncResp, serviceEnabled, - ldapServerElementName](const boost::system::error_code ec) { + ldapServerElementName](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG << "Error Occurred in Updating the service enable"; @@ -1203,7 +1203,7 @@ inline void updateUserProperties(std::shared_ptr asyncResp, if (enabled) { crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec; @@ -1230,7 +1230,7 @@ inline void updateUserProperties(std::shared_ptr asyncResp, } crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec; @@ -1258,7 +1258,7 @@ inline void updateUserProperties(std::shared_ptr asyncResp, } crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec; @@ -1337,7 +1337,7 @@ inline void sdbusplus::asio::getAllProperties( *crow::connections::systemBus, "xyz.openbmc_project.User.Manager", "/xyz/openbmc_project/user", "xyz.openbmc_project.User.AccountPolicy", - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& propertiesList) { if (ec) { @@ -1424,7 +1424,7 @@ inline void handleAccountServicePatch( if (minPasswordLength) { crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -1472,7 +1472,7 @@ inline void handleAccountServicePatch( if (unlockTimeout) { crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -1488,7 +1488,7 @@ inline void handleAccountServicePatch( if (lockoutThreshold) { crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -1541,7 +1541,7 @@ inline void handleAccountCollectionGet( } crow::connections::systemBus->async_method_call( [asyncResp, thisUser, effectiveUserPrivileges]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& users) { if (ec) { @@ -1621,7 +1621,7 @@ inline void handleAccountCollectionPost( "/xyz/openbmc_project/user", "xyz.openbmc_project.User.Manager", "AllGroups", [asyncResp, username, password{std::move(password)}, roleId, - enabled](const boost::system::error_code ec, + enabled](const boost::system::error_code& ec, const std::vector& allGroupsList) { if (ec) { @@ -1637,8 +1637,8 @@ inline void handleAccountCollectionPost( } crow::connections::systemBus->async_method_call( - [asyncResp, username, password](const boost::system::error_code ec2, - sdbusplus::message_t& m) { + [asyncResp, username, password]( + const boost::system::error_code& ec2, sdbusplus::message_t& m) { if (ec2) { userErrorMessageHandler(m.get_error(), asyncResp, username, ""); @@ -1656,7 +1656,8 @@ inline void handleAccountCollectionPost( const std::string userPath(tempObjPath); crow::connections::systemBus->async_method_call( - [asyncResp, password](const boost::system::error_code ec3) { + [asyncResp, + password](const boost::system::error_code& ec3) { if (ec3) { messages::internalError(asyncResp->res); @@ -1736,7 +1737,7 @@ inline void crow::connections::systemBus->async_method_call( [asyncResp, - accountName](const boost::system::error_code ec, + accountName](const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& users) { if (ec) { @@ -1891,7 +1892,7 @@ inline void const std::string userPath(tempObjPath); crow::connections::systemBus->async_method_call( - [asyncResp, username](const boost::system::error_code ec) { + [asyncResp, username](const boost::system::error_code& ec) { if (ec) { messages::resourceNotFound(asyncResp->res, "ManagerAccount", @@ -1979,7 +1980,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_t& 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/bios.hpp b/redfish-core/lib/bios.hpp index 74a22d4355..11535165e6 100644 --- a/redfish-core/lib/bios.hpp +++ b/redfish-core/lib/bios.hpp @@ -71,7 +71,7 @@ inline void } crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "Failed to reset bios: " << ec; diff --git a/redfish-core/lib/cable.hpp b/redfish-core/lib/cable.hpp index 0fc36b415c..423ea9dffb 100644 --- a/redfish-core/lib/cable.hpp +++ b/redfish-core/lib/cable.hpp @@ -24,7 +24,7 @@ namespace redfish */ inline void fillCableProperties(crow::Response& resp, - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& properties) { if (ec) @@ -97,7 +97,7 @@ inline void *crow::connections::systemBus, service, cableObjectPath, interface, [asyncResp]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& properties) { fillCableProperties(asyncResp->res, ec, properties); }); diff --git a/redfish-core/lib/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp index 93cb366d99..178e38de0d 100644 --- a/redfish-core/lib/certificate_service.hpp +++ b/redfish-core/lib/certificate_service.hpp @@ -299,7 +299,7 @@ static void getCertificateProperties( sdbusplus::asio::getAllProperties( *crow::connections::systemBus, service, objectPath, certs::certPropIntf, [asyncResp, certURL, certId, - name](const boost::system::error_code ec, + name](const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& properties) { if (ec) { @@ -383,7 +383,7 @@ static void { crow::connections::systemBus->async_method_call( [asyncResp, - id{objectPath.filename()}](const boost::system::error_code ec) { + id{objectPath.filename()}](const boost::system::error_code& ec) { if (ec) { messages::resourceNotFound(asyncResp->res, "Certificate", id); @@ -551,7 +551,7 @@ inline void handleReplaceCertificateAction( std::make_shared(certificate); crow::connections::systemBus->async_method_call( [asyncResp, certFile, objectPath, service, url{*parsedUrl}, id, - name](const boost::system::error_code ec) { + name](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "DBUS response error: " << ec; @@ -593,7 +593,7 @@ static void getCSR(const std::shared_ptr& asyncResp, << " CSRObjectPath=" << csrObjPath << " service=" << service; crow::connections::systemBus->async_method_call( - [asyncResp, certURI](const boost::system::error_code ec, + [asyncResp, certURI](const boost::system::error_code& ec, const std::string& csr) { if (ec) { @@ -831,7 +831,7 @@ inline void } }); crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec, const std::string&) { + [asyncResp](const boost::system::error_code& ec, const std::string&) { if (ec) { BMCWEB_LOG_ERROR << "DBUS response error: " << ec.message(); @@ -922,7 +922,7 @@ inline void handleHTTPSCertificateCollectionPost( std::make_shared(certFileBody); crow::connections::systemBus->async_method_call( - [asyncResp, certFile](const boost::system::error_code ec, + [asyncResp, certFile](const boost::system::error_code& ec, const std::string& objectPath) { if (ec) { @@ -1029,7 +1029,7 @@ inline void handleLDAPCertificateCollectionPost( std::make_shared(certFileBody); crow::connections::systemBus->async_method_call( - [asyncResp, certFile](const boost::system::error_code ec, + [asyncResp, certFile](const boost::system::error_code& ec, const std::string& objectPath) { if (ec) { @@ -1150,7 +1150,7 @@ inline void handleTrustStoreCertificateCollectionPost( std::shared_ptr certFile = std::make_shared(certFileBody); crow::connections::systemBus->async_method_call( - [asyncResp, certFile](const boost::system::error_code ec, + [asyncResp, certFile](const boost::system::error_code& ec, const std::string& objectPath) { if (ec) { diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp index 4db6719173..4701af4232 100644 --- a/redfish-core/lib/chassis.hpp +++ b/redfish-core/lib/chassis.hpp @@ -49,7 +49,7 @@ inline void getChassisState(std::shared_ptr aResp) *crow::connections::systemBus, "xyz.openbmc_project.State.Chassis", "/xyz/openbmc_project/state/chassis0", "xyz.openbmc_project.State.Chassis", "CurrentPowerState", - [aResp{std::move(aResp)}](const boost::system::error_code ec, + [aResp{std::move(aResp)}](const boost::system::error_code& ec, const std::string& chassisState) { if (ec) { @@ -90,7 +90,7 @@ inline void getIntrusionByService(std::shared_ptr aResp, sdbusplus::asio::getProperty( *crow::connections::systemBus, service, objPath, "xyz.openbmc_project.Chassis.Intrusion", "Status", - [aResp{std::move(aResp)}](const boost::system::error_code ec, + [aResp{std::move(aResp)}](const boost::system::error_code& ec, const std::string& value) { if (ec) { @@ -176,7 +176,7 @@ inline void sdbusplus::asio::getProperty( *crow::connections::systemBus, connectionName, path, "xyz.openbmc_project.Inventory.Decorator.LocationCode", "LocationCode", - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const std::string& property) { if (ec) { @@ -197,7 +197,7 @@ inline void getChassisUUID(const std::shared_ptr& asyncResp, sdbusplus::asio::getProperty( *crow::connections::systemBus, connectionName, path, "xyz.openbmc_project.Common.UUID", "UUID", - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const std::string& chassisUUID) { if (ec) { @@ -254,7 +254,7 @@ inline void *crow::connections::systemBus, "xyz.openbmc_project.ObjectMapper", path + "/all_sensors", "xyz.openbmc_project.Association", "endpoints", - [health](const boost::system::error_code ec2, + [health](const boost::system::error_code& ec2, const std::vector& resp) { if (ec2) { @@ -294,7 +294,7 @@ inline void *crow::connections::systemBus, "xyz.openbmc_project.ObjectMapper", path + "/drive", "xyz.openbmc_project.Association", "endpoints", - [asyncResp, chassisId](const boost::system::error_code ec3, + [asyncResp, chassisId](const boost::system::error_code& ec3, const std::vector& resp) { if (ec3 || resp.empty()) { @@ -324,7 +324,7 @@ inline void *crow::connections::systemBus, connectionName, path, assetTagInterface, "AssetTag", [asyncResp, chassisId(std::string(chassisId))]( - const boost::system::error_code ec2, + const boost::system::error_code& ec2, const std::string& property) { if (ec2) { @@ -351,7 +351,7 @@ inline void *crow::connections::systemBus, connectionName, path, "xyz.openbmc_project.Inventory.Decorator.Asset", [asyncResp, chassisId(std::string(chassisId))]( - const boost::system::error_code /*ec2*/, + const boost::system::error_code& /*ec2*/, const dbus::utility::DBusPropertiesMap& propertiesList) { const std::string* partNumber = nullptr; const std::string* serialNumber = nullptr; @@ -512,7 +512,7 @@ inline void dbus::utility::getSubTree( "/xyz/openbmc_project/inventory", 0, interfaces, [asyncResp, chassisId, locationIndicatorActive, - indicatorLed](const boost::system::error_code ec, + indicatorLed](const boost::system::error_code& ec, const dbus::utility::MapperGetSubTreeResponse& subtree) { if (ec) { @@ -643,7 +643,7 @@ inline void } crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec2) { + [asyncResp](const boost::system::error_code& ec2) { // Use "Set" method to set the property value. if (ec2) { diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp index 8cdb7e0260..64dc204225 100644 --- a/redfish-core/lib/ethernet.hpp +++ b/redfish-core/lib/ethernet.hpp @@ -638,7 +638,7 @@ inline void deleteIPv4(const std::string& ifaceId, const std::string& ipHash, const std::shared_ptr& asyncResp) { crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -654,7 +654,7 @@ inline void updateIPv4DefaultGateway( const std::shared_ptr& asyncResp) { crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -684,7 +684,7 @@ inline void createIPv4(const std::string& ifaceId, uint8_t prefixLength, const std::shared_ptr& asyncResp) { auto createIpHandler = - [asyncResp, ifaceId, gateway](const boost::system::error_code ec) { + [asyncResp, ifaceId, gateway](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -722,7 +722,7 @@ inline void { crow::connections::systemBus->async_method_call( [asyncResp, ifaceId, address, prefixLength, - gateway](const boost::system::error_code ec) { + gateway](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -730,7 +730,8 @@ inline void } crow::connections::systemBus->async_method_call( - [asyncResp, ifaceId, gateway](const boost::system::error_code ec2) { + [asyncResp, ifaceId, + gateway](const boost::system::error_code& ec2) { if (ec2) { messages::internalError(asyncResp->res); @@ -762,7 +763,7 @@ inline void deleteIPv6(const std::string& ifaceId, const std::string& ipHash, const std::shared_ptr& asyncResp) { crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -792,13 +793,13 @@ inline void { crow::connections::systemBus->async_method_call( [asyncResp, ifaceId, address, - prefixLength](const boost::system::error_code ec) { + prefixLength](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); } crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec2) { + [asyncResp](const boost::system::error_code& ec2) { if (ec2) { messages::internalError(asyncResp->res); @@ -829,7 +830,7 @@ inline void createIPv6(const std::string& ifaceId, uint8_t prefixLength, const std::string& address, const std::shared_ptr& asyncResp) { - auto createIpHandler = [asyncResp](const boost::system::error_code ec) { + auto createIpHandler = [asyncResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -860,7 +861,7 @@ void getEthernetIfaceData(const std::string& ethifaceId, crow::connections::systemBus->async_method_call( [ethifaceId{std::string{ethifaceId}}, callback{std::forward(callback)}]( - const boost::system::error_code errorCode, + const boost::system::error_code& errorCode, const dbus::utility::ManagedObjectType& resp) { EthernetInterfaceData ethData{}; boost::container::flat_set ipv4Data; @@ -910,7 +911,7 @@ void getEthernetIfaceList(CallbackFunc&& callback) { crow::connections::systemBus->async_method_call( [callback{std::forward(callback)}]( - const boost::system::error_code errorCode, + const boost::system::error_code& errorCode, dbus::utility::ManagedObjectType& resp) { // Callback requires vector to retrieve all available // ethernet interfaces @@ -963,7 +964,7 @@ inline void return; } crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -982,7 +983,7 @@ inline void sdbusplus::message::object_path objPath = "/xyz/openbmc_project/network/" + ifaceId; crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -1001,7 +1002,7 @@ inline void { std::vector vectorDomainname = {domainname}; crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -1082,7 +1083,7 @@ inline void "xyz.openbmc_project.Common.Error.NotAllowed"; crow::connections::systemBus->async_method_call( - [asyncResp, macAddress](const boost::system::error_code ec, + [asyncResp, macAddress](const boost::system::error_code& ec, const sdbusplus::message_t& msg) { if (ec) { @@ -1115,7 +1116,7 @@ inline void setDHCPEnabled(const std::string& ifaceId, { const std::string dhcp = getDhcpEnabledEnumeration(v4Value, v6Value); crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec; @@ -1136,7 +1137,7 @@ inline void setEthernetInterfaceBoolProperty( const bool& value, const std::shared_ptr& asyncResp) { crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec; @@ -1156,7 +1157,7 @@ inline void setDHCPv4Config(const std::string& propertyName, const bool& value, { BMCWEB_LOG_DEBUG << propertyName << " = " << value; crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec; @@ -1490,7 +1491,7 @@ inline void handleStaticNameServersPatch( const std::shared_ptr& asyncResp) { crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -2109,7 +2110,7 @@ inline void requestEthernetInterfacesRoutes(App& app) if (vlanEnable) { crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -2165,7 +2166,7 @@ inline void requestEthernetInterfacesRoutes(App& app) if (success && ethData.vlanId) { auto callback = - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -2281,7 +2282,7 @@ inline void requestEthernetInterfacesRoutes(App& app) return; } - auto callback = [asyncResp](const boost::system::error_code ec) { + auto callback = [asyncResp](const boost::system::error_code& ec) { if (ec) { // TODO(ed) make more consistent error messages diff --git a/redfish-core/lib/health.hpp b/redfish-core/lib/health.hpp index 143b0fcd44..643ce7ff60 100644 --- a/redfish-core/lib/health.hpp +++ b/redfish-core/lib/health.hpp @@ -214,7 +214,7 @@ struct HealthPopulate : std::enable_shared_from_this { std::shared_ptr self = shared_from_this(); crow::connections::systemBus->async_method_call( - [self](const boost::system::error_code ec, + [self](const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& resp) { if (ec) { diff --git a/redfish-core/lib/hypervisor_system.hpp b/redfish-core/lib/hypervisor_system.hpp index 0fd603f66f..41d661a541 100644 --- a/redfish-core/lib/hypervisor_system.hpp +++ b/redfish-core/lib/hypervisor_system.hpp @@ -43,7 +43,7 @@ inline void getHypervisorState(const std::shared_ptr& aResp) *crow::connections::systemBus, "xyz.openbmc_project.State.Hypervisor", "/xyz/openbmc_project/state/hypervisor0", "xyz.openbmc_project.State.Host", "CurrentHostState", - [aResp](const boost::system::error_code ec, + [aResp](const boost::system::error_code& ec, const std::string& hostState) { if (ec) { @@ -322,7 +322,7 @@ void getHypervisorIfaceData(const std::string& ethIfaceId, crow::connections::systemBus->async_method_call( [ethIfaceId{std::string{ethIfaceId}}, callback{std::forward(callback)}]( - const boost::system::error_code error, + const boost::system::error_code& error, const dbus::utility::ManagedObjectType& resp) { EthernetInterfaceData ethData{}; boost::container::flat_set ipv4Data; @@ -361,7 +361,7 @@ inline void BMCWEB_LOG_DEBUG << "Setting the Hypervisor IPaddress : " << ipv4Address << " on Iface: " << ethIfaceId; crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec) { + [aResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "DBUS response error " << ec; @@ -393,7 +393,7 @@ inline void << " on Iface: " << ethIfaceId; crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec) { + [aResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "DBUS response error " << ec; @@ -425,7 +425,7 @@ inline void << "Setting the DefaultGateway to the last configured gateway"; crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec) { + [aResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "DBUS response error " << ec; @@ -526,7 +526,7 @@ inline void setDHCPEnabled(const std::string& ifaceId, { const std::string dhcp = getDhcpEnabledEnumeration(ipv4DHCPEnabled, false); crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec; @@ -555,7 +555,7 @@ inline void setDHCPEnabled(const std::string& ifaceId, origin = "xyz.openbmc_project.Network.IP.AddressOrigin.DHCP"; } crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "DBUS response error " << ec; @@ -690,7 +690,7 @@ inline void asyncResp->res.jsonValue["HostName"] = hostName; crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(asyncResp->res); @@ -708,7 +708,7 @@ inline void const std::shared_ptr& asyncResp) { crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec; @@ -742,7 +742,7 @@ inline void requestRoutesHypervisorSystems(App& app) *crow::connections::systemBus, "xyz.openbmc_project.Settings", "/xyz/openbmc_project/network/hypervisor", "xyz.openbmc_project.Network.SystemConfiguration", "HostName", - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const std::string& /*hostName*/) { if (ec) { @@ -1082,7 +1082,7 @@ inline void requestRoutesHypervisorSystems(App& app) std::string command = "xyz.openbmc_project.State.Host.Transition.On"; crow::connections::systemBus->async_method_call( - [asyncResp, resetType](const boost::system::error_code ec) { + [asyncResp, resetType](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec; diff --git a/redfish-core/lib/led.hpp b/redfish-core/lib/led.hpp index 4c4c513a81..a5725f1e9e 100644 --- a/redfish-core/lib/led.hpp +++ b/redfish-core/lib/led.hpp @@ -40,7 +40,7 @@ inline void *crow::connections::systemBus, "xyz.openbmc_project.LED.GroupManager", "/xyz/openbmc_project/led/groups/enclosure_identify_blink", "xyz.openbmc_project.Led.Group", "Asserted", - [aResp](const boost::system::error_code ec, const bool blinking) { + [aResp](const boost::system::error_code& ec, const bool blinking) { // Some systems may not have enclosure_identify_blink object so // proceed to get enclosure_identify state. if (ec == boost::system::errc::invalid_argument) @@ -63,7 +63,7 @@ inline void "xyz.openbmc_project.LED.GroupManager", "/xyz/openbmc_project/led/groups/enclosure_identify", "xyz.openbmc_project.Led.Group", "Asserted", - [aResp](const boost::system::error_code ec2, const bool ledOn) { + [aResp](const boost::system::error_code& ec2, const bool ledOn) { if (ec2 == boost::system::errc::invalid_argument) { BMCWEB_LOG_DEBUG @@ -121,7 +121,8 @@ inline void } crow::connections::systemBus->async_method_call( - [aResp, ledOn, ledBlinkng](const boost::system::error_code ec) mutable { + [aResp, ledOn, + ledBlinkng](const boost::system::error_code& ec) mutable { if (ec) { // Some systems may not have enclosure_identify_blink object so @@ -133,7 +134,7 @@ inline void } } crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec2) { + [aResp](const boost::system::error_code& ec2) { if (ec2) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec2; @@ -170,7 +171,7 @@ inline void *crow::connections::systemBus, "xyz.openbmc_project.LED.GroupManager", "/xyz/openbmc_project/led/groups/enclosure_identify_blink", "xyz.openbmc_project.Led.Group", "Asserted", - [aResp](const boost::system::error_code ec, const bool blinking) { + [aResp](const boost::system::error_code& ec, const bool blinking) { // Some systems may not have enclosure_identify_blink object so // proceed to get enclosure_identify state. if (ec == boost::system::errc::invalid_argument) @@ -193,7 +194,7 @@ inline void "xyz.openbmc_project.LED.GroupManager", "/xyz/openbmc_project/led/groups/enclosure_identify", "xyz.openbmc_project.Led.Group", "Asserted", - [aResp](const boost::system::error_code ec2, const bool ledOn) { + [aResp](const boost::system::error_code& ec2, const bool ledOn) { if (ec2 == boost::system::errc::invalid_argument) { BMCWEB_LOG_DEBUG @@ -227,14 +228,14 @@ inline void BMCWEB_LOG_DEBUG << "Set LocationIndicatorActive"; crow::connections::systemBus->async_method_call( - [aResp, ledState](const boost::system::error_code ec) mutable { + [aResp, ledState](const boost::system::error_code& ec) mutable { if (ec) { // Some systems may not have enclosure_identify_blink object so // lets set enclosure_identify state also if // enclosure_identify_blink failed crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec2) { + [aResp](const boost::system::error_code& ec2) { if (ec2) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec2; diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp index ee57557064..24a065721c 100644 --- a/redfish-core/lib/log_services.hpp +++ b/redfish-core/lib/log_services.hpp @@ -455,7 +455,7 @@ inline void crow::connections::systemBus->async_method_call( [asyncResp, entriesPath, - dumpType](const boost::system::error_code ec, + dumpType](const boost::system::error_code& ec, dbus::utility::ManagedObjectType& resp) { if (ec) { @@ -561,7 +561,7 @@ inline void crow::connections::systemBus->async_method_call( [asyncResp, entryID, dumpType, - entriesPath](const boost::system::error_code ec, + entriesPath](const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& resp) { if (ec) { @@ -642,7 +642,7 @@ inline void deleteDumpEntry(const std::shared_ptr& asyncResp, const std::string& dumpType) { auto respHandler = - [asyncResp, entryID](const boost::system::error_code ec) { + [asyncResp, entryID](const boost::system::error_code& ec) { BMCWEB_LOG_DEBUG << "Dump Entry doDelete callback: Done"; if (ec) { @@ -734,7 +734,7 @@ inline void createDumpTaskCallback( crow::connections::systemBus->async_method_call( [asyncResp, payload, createdObjPath, dumpEntryPath{std::move(dumpEntryPath)}, - dumpId](const boost::system::error_code ec, + dumpId](const boost::system::error_code& ec, const std::string& introspectXml) { if (ec) { @@ -782,7 +782,7 @@ inline void createDumpTaskCallback( std::shared_ptr task = task::TaskData::createTask( [createdObjPath, dumpEntryPath, dumpId, isProgressIntfPresent]( - boost::system::error_code err, sdbusplus::message_t& msg, + const boost::system::error_code& err, sdbusplus::message_t& msg, const std::shared_ptr& taskData) { if (err) { @@ -913,9 +913,10 @@ inline void createDump(const std::shared_ptr& asyncResp, createDumpParamVec; crow::connections::systemBus->async_method_call( - [asyncResp, payload(task::Payload(req)), dumpPath]( - const boost::system::error_code ec, const sdbusplus::message_t& msg, - const sdbusplus::message::object_path& objPath) mutable { + [asyncResp, payload(task::Payload(req)), + dumpPath](const boost::system::error_code& ec, + const sdbusplus::message_t& msg, + const sdbusplus::message::object_path& objPath) mutable { if (ec) { BMCWEB_LOG_ERROR << "CreateDump resp_handler got error " << ec; @@ -1191,7 +1192,7 @@ inline void requestRoutesJournalEventLogClear(App& app) // Reload rsyslog so it knows to start new log files crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "Failed to reload rsyslog: " << ec; @@ -1515,7 +1516,7 @@ inline void requestRoutesDBusEventLogEntryCollection(App& app) // DBus implementation of EventLog/Entries // Make call to Logging Service to find all log entry objects crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& resp) { if (ec) { @@ -1702,7 +1703,7 @@ inline void requestRoutesDBusEventLogEntry(App& app) sdbusplus::asio::getAllProperties( *crow::connections::systemBus, "xyz.openbmc_project.Logging", "/xyz/openbmc_project/logging/entry/" + entryID, "", - [asyncResp, entryID](const boost::system::error_code ec, + [asyncResp, entryID](const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& resp) { if (ec.value() == EBADR) { @@ -1811,7 +1812,7 @@ inline void requestRoutesDBusEventLogEntry(App& app) BMCWEB_LOG_DEBUG << "Set Resolved"; crow::connections::systemBus->async_method_call( - [asyncResp, entryId](const boost::system::error_code ec) { + [asyncResp, entryId](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec; @@ -1852,7 +1853,7 @@ inline void requestRoutesDBusEventLogEntry(App& app) // Process response from Logging service. auto respHandler = - [asyncResp, entryID](const boost::system::error_code ec) { + [asyncResp, entryID](const boost::system::error_code& ec) { BMCWEB_LOG_DEBUG << "EventLogEntry (DBus) doDelete callback: Done"; if (ec) { @@ -1914,7 +1915,7 @@ inline void requestRoutesDBusEventLogEntryDownload(App& app) dbus::utility::escapePathForDbus(entryID); crow::connections::systemBus->async_method_call( - [asyncResp, entryID](const boost::system::error_code ec, + [asyncResp, entryID](const boost::system::error_code& ec, const sdbusplus::message::unix_fd& unixfd) { if (ec.value() == EBADR) { @@ -3053,7 +3054,7 @@ void inline requestRoutesCrashdumpClear(App& app) return; } crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const std::string&) { if (ec) { @@ -3072,7 +3073,7 @@ static void { auto getStoredLogCallback = [asyncResp, logID, - &logEntryJson](const boost::system::error_code ec, + &logEntryJson](const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& params) { if (ec) { @@ -3261,7 +3262,7 @@ inline void requestRoutesCrashdumpFile(App& app) auto getStoredLogCallback = [asyncResp, logID, fileName, url(boost::urls::url(req.urlView))]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const std::vector< std::pair>& resp) { @@ -3416,7 +3417,7 @@ inline void requestRoutesCrashdumpCollect(App& app) auto collectCrashdumpCallback = [asyncResp, payload(task::Payload(req)), - taskMatchStr](const boost::system::error_code ec, + taskMatchStr](const boost::system::error_code& ec, const std::string&) mutable { if (ec) { @@ -3437,7 +3438,7 @@ inline void requestRoutesCrashdumpCollect(App& app) return; } std::shared_ptr task = task::TaskData::createTask( - [](boost::system::error_code err, sdbusplus::message_t&, + [](const boost::system::error_code& err, sdbusplus::message_t&, const std::shared_ptr& taskData) { if (!err) { @@ -3492,7 +3493,7 @@ inline void requestRoutesDBusLogServiceActionsClear(App& app) BMCWEB_LOG_DEBUG << "Do delete all entries."; // Process response from Logging service. - auto respHandler = [asyncResp](const boost::system::error_code ec) { + auto respHandler = [asyncResp](const boost::system::error_code& ec) { BMCWEB_LOG_DEBUG << "doClearLog resp_handler callback: Done"; if (ec) { @@ -3585,7 +3586,7 @@ inline void requestRoutesPostCodesClear(App& app) // Make call to post-code service to request clear all crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { // TODO Handle for specific error code @@ -3799,7 +3800,7 @@ static void getPostCodeForEntry(const std::shared_ptr& aResp, crow::connections::systemBus->async_method_call( [aResp, entryId, bootIndex, - codeIndex](const boost::system::error_code ec, + codeIndex](const boost::system::error_code& ec, const boost::container::flat_map< uint64_t, std::tuple>>& postcode) { @@ -3836,7 +3837,7 @@ static void getPostCodeForBoot(const std::shared_ptr& aResp, { crow::connections::systemBus->async_method_call( [aResp, bootIndex, bootCount, entryCount, skip, - top](const boost::system::error_code ec, + top](const boost::system::error_code& ec, const boost::container::flat_map< uint64_t, std::tuple>>& postcode) { @@ -3895,7 +3896,7 @@ static void "xyz.openbmc_project.State.Boot.PostCode0", "/xyz/openbmc_project/State/Boot/PostCode0", "xyz.openbmc_project.State.Boot.PostCode", "CurrentBootCycleCount", - [aResp, entryCount, skip, top](const boost::system::error_code ec, + [aResp, entryCount, skip, top](const boost::system::error_code& ec, const uint16_t bootCount) { if (ec) { @@ -3987,7 +3988,7 @@ inline void requestRoutesPostCodesEntryAdditionalData(App& app) crow::connections::systemBus->async_method_call( [asyncResp, postCodeID, currentValue]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const std::vector>>& postcodes) { if (ec.value() == EBADR) diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp index 9da1be07c8..01ec4e510d 100644 --- a/redfish-core/lib/managers.hpp +++ b/redfish-core/lib/managers.hpp @@ -61,7 +61,7 @@ inline void dbus::utility::DbusVariantType dbusPropertyValue(propertyValue); crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { // Use "Set" method to set the property value. if (ec) { @@ -90,7 +90,7 @@ inline void dbus::utility::DbusVariantType dbusPropertyValue(propertyValue); crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { // Use "Set" method to set the property value. if (ec) { @@ -211,7 +211,7 @@ inline void requestRoutesManagerResetToDefaultsAction(App& app) } crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG << "Failed to ResetToDefaults: " << ec; @@ -291,7 +291,7 @@ inline void crow::connections::systemBus->async_method_call( [asyncResp, currentProfile, supportedProfiles]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& managedObj) { if (ec) { @@ -809,7 +809,7 @@ inline CreatePIDRet createPidInterface( BMCWEB_LOG_DEBUG << "del " << path << " " << iface << "\n"; // delete interface crow::connections::systemBus->async_method_call( - [response, path](const boost::system::error_code ec) { + [response, path](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "Error patching " << path << ": " << ec; @@ -1236,7 +1236,7 @@ struct GetPIDValues : std::enable_shared_from_this sdbusplus::asio::getAllProperties( *crow::connections::systemBus, owner, path, thermalModeIface, [path, owner, - self](const boost::system::error_code ec2, + self](const boost::system::error_code& ec2, const dbus::utility::DBusPropertiesMap& resp) { if (ec2) { @@ -1396,7 +1396,7 @@ struct SetPIDValues : std::enable_shared_from_this // todo(james): might make sense to do a mapper call here if this // interface gets more traction crow::connections::systemBus->async_method_call( - [self](const boost::system::error_code ec, + [self](const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& mObj) { if (ec) { @@ -1449,7 +1449,7 @@ struct SetPIDValues : std::enable_shared_from_this const std::string& owner = subtree[0].second[0].first; sdbusplus::asio::getAllProperties( *crow::connections::systemBus, owner, path, thermalModeIface, - [self, path, owner](const boost::system::error_code ec2, + [self, path, owner](const boost::system::error_code& ec2, const dbus::utility::DBusPropertiesMap& r) { if (ec2) { @@ -1503,7 +1503,7 @@ struct SetPIDValues : std::enable_shared_from_this } currentProfile = *profile; crow::connections::systemBus->async_method_call( - [response](const boost::system::error_code ec) { + [response](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "Error patching profile" << ec; @@ -1637,7 +1637,7 @@ struct SetPIDValues : std::enable_shared_from_this crow::connections::systemBus->async_method_call( [response, propertyName{std::string(property.first)}]( - const boost::system::error_code ec) { + const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "Error patching " @@ -1682,7 +1682,7 @@ struct SetPIDValues : std::enable_shared_from_this } crow::connections::systemBus->async_method_call( - [response](const boost::system::error_code ec) { + [response](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "Error Adding Pid Object " @@ -1740,7 +1740,7 @@ inline void getLocation(const std::shared_ptr& aResp, sdbusplus::asio::getProperty( *crow::connections::systemBus, connectionName, path, "xyz.openbmc_project.Inventory.Decorator.LocationCode", "LocationCode", - [aResp](const boost::system::error_code ec, + [aResp](const boost::system::error_code& ec, const std::string& property) { if (ec) { @@ -1764,7 +1764,7 @@ inline void *crow::connections::systemBus, "xyz.openbmc_project.State.BMC", "/xyz/openbmc_project/state/bmc0", "xyz.openbmc_project.State.BMC", "LastRebootTime", - [aResp](const boost::system::error_code ec, + [aResp](const boost::system::error_code& ec, const uint64_t lastResetTime) { if (ec) { @@ -1816,7 +1816,7 @@ inline void // Make sure the image is valid before setting priority crow::connections::systemBus->async_method_call( [aResp, firmwareId, - runningFirmwareTarget](const boost::system::error_code ec, + runningFirmwareTarget](const boost::system::error_code& ec, dbus::utility::ManagedObjectType& subtree) { if (ec) { @@ -1872,7 +1872,7 @@ inline void // An addition could be a Redfish Setting like // ActiveSoftwareImageApplyTime and support OnReset crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec2) { + [aResp](const boost::system::error_code& ec2) { if (ec2) { BMCWEB_LOG_DEBUG << "D-Bus response error setting."; @@ -1907,7 +1907,7 @@ inline void setDateTime(std::shared_ptr aResp, } crow::connections::systemBus->async_method_call( [aResp{std::move(aResp)}, - datetime{std::move(datetime)}](const boost::system::error_code ec) { + datetime{std::move(datetime)}](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG << "Failed to set elapsed time. " @@ -2074,7 +2074,7 @@ inline void requestRoutesManager(App& app) *crow::connections::systemBus, "org.freedesktop.systemd1", "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "Progress", - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const double& val) { if (ec) { @@ -2135,7 +2135,7 @@ inline void requestRoutesManager(App& app) sdbusplus::asio::getAllProperties( *crow::connections::systemBus, connectionName, path, "xyz.openbmc_project.Inventory.Decorator.Asset", - [asyncResp](const boost::system::error_code ec2, + [asyncResp](const boost::system::error_code& ec2, const dbus::utility::DBusPropertiesMap& propertiesList) { if (ec2) diff --git a/redfish-core/lib/memory.hpp b/redfish-core/lib/memory.hpp index 6e7781651d..44784726ef 100644 --- a/redfish-core/lib/memory.hpp +++ b/redfish-core/lib/memory.hpp @@ -614,7 +614,7 @@ inline void getDimmDataByService(std::shared_ptr aResp, sdbusplus::asio::getAllProperties( *crow::connections::systemBus, service, objPath, "", [dimmId, aResp{std::move(aResp)}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& properties) { if (ec) { @@ -687,7 +687,7 @@ inline void getDimmPartitionData(std::shared_ptr aResp, *crow::connections::systemBus, service, path, "xyz.openbmc_project.Inventory.Item.PersistentMemory.Partition", [aResp{std::move(aResp)}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& properties) { if (ec) { diff --git a/redfish-core/lib/metric_report.hpp b/redfish-core/lib/metric_report.hpp index eb69ff0186..d12ba103f3 100644 --- a/redfish-core/lib/metric_report.hpp +++ b/redfish-core/lib/metric_report.hpp @@ -117,7 +117,7 @@ inline void requestRoutesMetricReport(App& app) sdbusplus::asio::getProperty( *crow::connections::systemBus, telemetry::service, reportPath, telemetry::reportInterface, "Readings", - [asyncResp, id](const boost::system::error_code ec2, + [asyncResp, id](const boost::system::error_code& ec2, const telemetry::TimestampReadings& ret) { if (ec2) { diff --git a/redfish-core/lib/metric_report_definition.hpp b/redfish-core/lib/metric_report_definition.hpp index ab03ea0b3c..2e97fa08ca 100644 --- a/redfish-core/lib/metric_report_definition.hpp +++ b/redfish-core/lib/metric_report_definition.hpp @@ -288,7 +288,7 @@ class AddReport const std::shared_ptr aResp = asyncResp; crow::connections::systemBus->async_method_call( [aResp, name = args.name, uriToDbus = std::move(uriToDbus)]( - const boost::system::error_code ec, const std::string&) { + const boost::system::error_code& ec, const std::string&) { if (ec == boost::system::errc::file_exists) { messages::resourceAlreadyExists( @@ -436,7 +436,7 @@ inline void requestRoutesMetricReportDefinition(App& app) *crow::connections::systemBus, telemetry::service, telemetry::getDbusReportPath(id), telemetry::reportInterface, [asyncResp, - id](const boost::system::error_code ec, + id](const boost::system::error_code& ec, const std::vector>& ret) { if (ec.value() == EBADR || @@ -473,7 +473,7 @@ inline void requestRoutesMetricReportDefinition(App& app) const std::string reportPath = telemetry::getDbusReportPath(id); crow::connections::systemBus->async_method_call( - [asyncResp, id](const boost::system::error_code ec) { + [asyncResp, id](const boost::system::error_code& ec) { /* * boost::system::errc and std::errc are missing value * for EBADR error that is defined in Linux. diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp index d3910b33a2..aab780b302 100644 --- a/redfish-core/lib/network_protocol.hpp +++ b/redfish-core/lib/network_protocol.hpp @@ -94,7 +94,7 @@ void getEthernetIfaceData(CallbackFunc&& callback) { crow::connections::systemBus->async_method_call( [callback{std::forward(callback)}]( - const boost::system::error_code errorCode, + const boost::system::error_code& errorCode, const dbus::utility::ManagedObjectType& dbusData) { std::vector ntpServers; std::vector domainNames; @@ -185,7 +185,7 @@ inline void getNetworkData(const std::shared_ptr& asyncResp, const std::string& serviceName = protocol.second; getPortStatusAndPath( serviceName, - [asyncResp, protocolName](const boost::system::error_code ec, + [asyncResp, protocolName](const boost::system::error_code& ec, const std::string& socketPath, bool isProtocolEnabled) { // If the service is not installed, that is not an error @@ -205,7 +205,7 @@ inline void getNetworkData(const std::shared_ptr& asyncResp, asyncResp->res.jsonValue[protocolName]["ProtocolEnabled"] = isProtocolEnabled; getPortNumber(socketPath, [asyncResp, protocolName]( - const boost::system::error_code ec2, + const boost::system::error_code& ec2, int portNumber) { if (ec2) { @@ -233,7 +233,7 @@ inline void handleNTPProtocolEnabled( } crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code errorCode) { + [asyncResp](const boost::system::error_code& errorCode) { if (errorCode) { messages::internalError(asyncResp->res); @@ -350,7 +350,7 @@ inline void } crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec2) { + [asyncResp](const boost::system::error_code& ec2) { if (ec2) { messages::internalError(asyncResp->res); @@ -389,7 +389,7 @@ inline void if (boost::algorithm::starts_with(entry.first, netBasePath)) { crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec2) { + [asyncResp](const boost::system::error_code& ec2) { if (ec2) { messages::internalError(asyncResp->res); @@ -402,7 +402,7 @@ inline void dbus::utility::DbusVariantType{protocolEnabled}); crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec2) { + [asyncResp](const boost::system::error_code& ec2) { if (ec2) { messages::internalError(asyncResp->res); @@ -437,7 +437,7 @@ inline void *crow::connections::systemBus, "xyz.openbmc_project.Settings", "/xyz/openbmc_project/time/sync_method", "xyz.openbmc_project.Time.Synchronization", "TimeSyncMethod", - [asyncResp](const boost::system::error_code errorCode, + [asyncResp](const boost::system::error_code& errorCode, const std::string& timeSyncMethod) { if (errorCode) { diff --git a/redfish-core/lib/pcie.hpp b/redfish-core/lib/pcie.hpp index 5332a391ef..c3b7546ef2 100644 --- a/redfish-core/lib/pcie.hpp +++ b/redfish-core/lib/pcie.hpp @@ -169,7 +169,7 @@ inline void requestRoutesSystemPCIeDevice(App& app) auto getPCIeDeviceCallback = [asyncResp, device]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& pcieDevProperties) { if (ec) { @@ -288,7 +288,7 @@ inline void requestRoutesSystemPCIeFunctionCollection(App& app) auto getPCIeDeviceCallback = [asyncResp, device]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& pcieDevProperties) { if (ec) { @@ -364,7 +364,7 @@ inline void requestRoutesSystemPCIeFunction(App& app) } auto getPCIeDeviceCallback = [asyncResp, device, function]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& pcieDevProperties) { if (ec) { diff --git a/redfish-core/lib/pcie_slots.hpp b/redfish-core/lib/pcie_slots.hpp index 70efa13211..42c8bb1de0 100644 --- a/redfish-core/lib/pcie_slots.hpp +++ b/redfish-core/lib/pcie_slots.hpp @@ -71,7 +71,7 @@ inline pcie_slots::SlotTypes dbusSlotTypeToRf(const std::string& slotType) inline void onPcieSlotGetAllDone(const std::shared_ptr& asyncResp, - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& propertiesList) { if (ec) @@ -150,7 +150,7 @@ inline void inline void onMapperAssociationDone( const std::shared_ptr& asyncResp, const std::string& chassisID, const std::string& pcieSlotPath, - const std::string& connectionName, const boost::system::error_code ec, + const std::string& connectionName, const boost::system::error_code& ec, const std::variant>& endpoints) { if (ec) @@ -193,7 +193,7 @@ inline void onMapperAssociationDone( sdbusplus::asio::getAllProperties( *crow::connections::systemBus, connectionName, pcieSlotPath, "xyz.openbmc_project.Inventory.Item.PCIeSlot", - [asyncResp](const boost::system::error_code ec2, + [asyncResp](const boost::system::error_code& ec2, const dbus::utility::DBusPropertiesMap& propertiesList) { onPcieSlotGetAllDone(asyncResp, ec2, propertiesList); }); @@ -202,7 +202,7 @@ inline void onMapperAssociationDone( inline void onMapperSubtreeDone(const std::shared_ptr& asyncResp, const std::string& chassisID, - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::MapperGetSubTreeResponse& subtree) { if (ec) diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp index 116ea256c7..7dbf6603bb 100644 --- a/redfish-core/lib/power.hpp +++ b/redfish-core/lib/power.hpp @@ -79,7 +79,7 @@ inline void setPowerCapOverride( *crow::connections::systemBus, "xyz.openbmc_project.Settings", "/xyz/openbmc_project/control/host0/power_cap", "xyz.openbmc_project.Control.Power.Cap", "PowerCapEnable", - [value, sensorsAsyncResp](const boost::system::error_code ec, + [value, sensorsAsyncResp](const boost::system::error_code& ec, bool powerCapEnable) { if (ec) { @@ -98,7 +98,7 @@ inline void setPowerCapOverride( } crow::connections::systemBus->async_method_call( - [sensorsAsyncResp](const boost::system::error_code ec2) { + [sensorsAsyncResp](const boost::system::error_code& ec2) { if (ec2) { BMCWEB_LOG_DEBUG << "Power Limit Set: Dbus error: " << ec2; @@ -196,7 +196,7 @@ inline void requestRoutesPower(App& app) auto valueHandler = [sensorAsyncResp]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& properties) { if (ec) { diff --git a/redfish-core/lib/processor.hpp b/redfish-core/lib/processor.hpp index 8b1bfa9f6d..51290b8d2a 100644 --- a/redfish-core/lib/processor.hpp +++ b/redfish-core/lib/processor.hpp @@ -60,7 +60,7 @@ inline void getProcessorUUID(std::shared_ptr aResp, sdbusplus::asio::getProperty( *crow::connections::systemBus, service, objPath, "xyz.openbmc_project.Common.UUID", "UUID", - [objPath, aResp{std::move(aResp)}](const boost::system::error_code ec, + [objPath, aResp{std::move(aResp)}](const boost::system::error_code& ec, const std::string& property) { if (ec) { @@ -224,7 +224,7 @@ inline void getCpuDataByService(std::shared_ptr aResp, crow::connections::systemBus->async_method_call( [cpuId, service, objPath, aResp{std::move(aResp)}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& dbusData) { if (ec) { @@ -299,7 +299,7 @@ inline void getCpuAssetData(std::shared_ptr aResp, *crow::connections::systemBus, service, objPath, "xyz.openbmc_project.Inventory.Decorator.Asset", [objPath, aResp{std::move(aResp)}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& properties) { if (ec) { @@ -373,7 +373,7 @@ inline void getCpuRevisionData(std::shared_ptr aResp, *crow::connections::systemBus, service, objPath, "xyz.openbmc_project.Inventory.Decorator.Revision", [objPath, aResp{std::move(aResp)}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& properties) { if (ec) { @@ -409,7 +409,7 @@ inline void getAcceleratorDataByService( sdbusplus::asio::getAllProperties( *crow::connections::systemBus, service, objPath, "", [acclrtrId, aResp{std::move(aResp)}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& properties) { if (ec) { @@ -523,7 +523,7 @@ inline void getCpuConfigData(const std::shared_ptr& aResp, *crow::connections::systemBus, service, objPath, "xyz.openbmc_project.Control.Processor.CurrentOperatingConfig", [aResp, cpuId, - service](const boost::system::error_code ec, + service](const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& properties) { if (ec) { @@ -584,7 +584,7 @@ inline void getCpuConfigData(const std::shared_ptr& aResp, "OperatingConfig", "BaseSpeedPrioritySettings", [aResp]( - const boost::system::error_code ec2, + const boost::system::error_code& ec2, const BaseSpeedPrioritySettingsProperty& baseSpeedList) { if (ec2) { @@ -621,7 +621,7 @@ inline void getCpuLocationCode(std::shared_ptr aResp, sdbusplus::asio::getProperty( *crow::connections::systemBus, service, objPath, "xyz.openbmc_project.Inventory.Decorator.LocationCode", "LocationCode", - [objPath, aResp{std::move(aResp)}](const boost::system::error_code ec, + [objPath, aResp{std::move(aResp)}](const boost::system::error_code& ec, const std::string& property) { if (ec) { @@ -652,7 +652,7 @@ inline void getCpuUniqueId(const std::shared_ptr& aResp, *crow::connections::systemBus, service, objectPath, "xyz.openbmc_project.Inventory.Decorator.UniqueIdentifier", "UniqueIdentifier", - [aResp](boost::system::error_code ec, const std::string& id) { + [aResp](const boost::system::error_code& ec, const std::string& id) { if (ec) { BMCWEB_LOG_ERROR << "Failed to read cpu unique id: " << ec; @@ -812,7 +812,7 @@ inline void sdbusplus::asio::getAllProperties( *crow::connections::systemBus, service, objPath, "xyz.openbmc_project.Inventory.Item.Cpu.OperatingConfig", - [aResp](const boost::system::error_code ec, + [aResp](const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& properties) { if (ec) { @@ -912,7 +912,7 @@ inline void inline void handleAppliedConfigResponse(const std::shared_ptr& resp, const std::string& setPropVal, - boost::system::error_code ec, + const boost::system::error_code& ec, const sdbusplus::message_t& msg) { if (!ec) @@ -1018,7 +1018,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, + [resp, appliedConfigUri](const boost::system::error_code& ec, const sdbusplus::message_t& msg) { handleAppliedConfigResponse(resp, appliedConfigUri, ec, msg); }, diff --git a/redfish-core/lib/redfish_util.hpp b/redfish-core/lib/redfish_util.hpp index d7a7f8cb90..9d358c02cf 100644 --- a/redfish-core/lib/redfish_util.hpp +++ b/redfish-core/lib/redfish_util.hpp @@ -102,7 +102,7 @@ void getPortStatusAndPath(const std::string& serviceName, { crow::connections::systemBus->async_method_call( [serviceName, callback{std::forward(callback)}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const std::vector& r) { if (ec) { @@ -180,7 +180,7 @@ void getPortNumber(const std::string& socketPath, CallbackFunc&& callback) *crow::connections::systemBus, "org.freedesktop.systemd1", socketPath, "org.freedesktop.systemd1.Socket", "Listen", [callback{std::forward(callback)}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const std::vector>& resp) { if (ec) { diff --git a/redfish-core/lib/roles.hpp b/redfish-core/lib/roles.hpp index fe9110c87b..c9823477ed 100644 --- a/redfish-core/lib/roles.hpp +++ b/redfish-core/lib/roles.hpp @@ -122,7 +122,7 @@ inline void requestRoutesRoleCollection(App& app) *crow::connections::systemBus, "xyz.openbmc_project.User.Manager", "/xyz/openbmc_project/user", "xyz.openbmc_project.User.Manager", "AllPrivileges", - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const std::vector& privList) { if (ec) { diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp index 3ff4842886..1af3032327 100644 --- a/redfish-core/lib/sensors.hpp +++ b/redfish-core/lib/sensors.hpp @@ -1003,7 +1003,7 @@ inline void populateFanRedundancy( "xyz.openbmc_project.ObjectMapper", path + "/chassis", "xyz.openbmc_project.Association", "endpoints", [path, owner, - sensorsAsyncResp](const boost::system::error_code e, + sensorsAsyncResp](const boost::system::error_code& e, const std::vector& endpoints) { if (e) { @@ -1445,7 +1445,7 @@ static void getInventoryItemsData( auto respHandler = [sensorsAsyncResp, inventoryItems, invConnections, callback{std::forward(callback)}, invConnectionsIndex]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& resp) { BMCWEB_LOG_DEBUG << "getInventoryItemsData respHandler enter"; if (ec) @@ -1601,7 +1601,7 @@ static void getInventoryItemAssociations( // Response handler for GetManagedObjects auto respHandler = [callback{std::forward(callback)}, sensorsAsyncResp, - sensorNames](const boost::system::error_code ec, + sensorNames](const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& resp) { BMCWEB_LOG_DEBUG << "getInventoryItemAssociations respHandler enter"; if (ec) @@ -1775,7 +1775,7 @@ void getInventoryLedData( auto respHandler = [sensorsAsyncResp, inventoryItems, ledConnections, ledPath, callback{std::forward(callback)}, ledConnectionsIndex]( - const boost::system::error_code ec, const std::string& state) { + const boost::system::error_code& ec, const std::string& state) { BMCWEB_LOG_DEBUG << "getInventoryLedData respHandler enter"; if (ec) { @@ -1959,7 +1959,7 @@ void getPowerSupplyAttributesData( auto respHandler = [sensorsAsyncResp, inventoryItems, callback{std::forward(callback)}]( - const boost::system::error_code ec, const uint32_t value) { + const boost::system::error_code& ec, const uint32_t value) { BMCWEB_LOG_DEBUG << "getPowerSupplyAttributesData respHandler enter"; if (ec) { @@ -2264,7 +2264,7 @@ inline void getSensorData( // Response handler to process managed objects auto getManagedObjectsCb = [sensorsAsyncResp, sensorNames, - inventoryItems](const boost::system::error_code ec, + inventoryItems](const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& resp) { BMCWEB_LOG_DEBUG << "getManagedObjectsCb enter"; if (ec) @@ -2696,7 +2696,7 @@ inline void setSensorsOverride( return; } crow::connections::systemBus->async_method_call( - [sensorAsyncResp](const boost::system::error_code ec) { + [sensorAsyncResp](const boost::system::error_code& ec) { if (ec) { if (ec.value() == @@ -2865,7 +2865,7 @@ inline void sdbusplus::asio::getAllProperties( *crow::connections::systemBus, connectionName, sensorPath, "", [asyncResp, - sensorPath](const boost::system::error_code ec, + sensorPath](const boost::system::error_code& ec, const ::dbus::utility::DBusPropertiesMap& valuesDict) { if (ec) { diff --git a/redfish-core/lib/storage.hpp b/redfish-core/lib/storage.hpp index 88ced6229b..5f3ccd3825 100644 --- a/redfish-core/lib/storage.hpp +++ b/redfish-core/lib/storage.hpp @@ -169,7 +169,7 @@ inline void sdbusplus::asio::getProperty( *crow::connections::systemBus, connectionName, path, "xyz.openbmc_project.Inventory.Item", "Present", - [asyncResp, index](const boost::system::error_code ec2, + [asyncResp, index](const boost::system::error_code& ec2, bool isPresent) { // this interface isn't necessary, only check it // if we get a good return @@ -188,7 +188,7 @@ inline void *crow::connections::systemBus, connectionName, path, "xyz.openbmc_project.Inventory.Decorator.Asset", [asyncResp, index]( - const boost::system::error_code ec2, + const boost::system::error_code& ec2, const std::vector< std::pair>& propertiesList) { @@ -291,7 +291,7 @@ inline void getDriveAsset(const std::shared_ptr& asyncResp, sdbusplus::asio::getAllProperties( *crow::connections::systemBus, connectionName, path, "xyz.openbmc_project.Inventory.Decorator.Asset", - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const std::vector< std::pair>& propertiesList) { @@ -346,7 +346,7 @@ inline void getDrivePresent(const std::shared_ptr& asyncResp, sdbusplus::asio::getProperty( *crow::connections::systemBus, connectionName, path, "xyz.openbmc_project.Inventory.Item", "Present", - [asyncResp, path](const boost::system::error_code ec, + [asyncResp, path](const boost::system::error_code& ec, const bool isPresent) { // this interface isn't necessary, only check it if // we get a good return @@ -369,7 +369,7 @@ inline void getDriveState(const std::shared_ptr& asyncResp, sdbusplus::asio::getProperty( *crow::connections::systemBus, connectionName, path, "xyz.openbmc_project.State.Drive", "Rebuilding", - [asyncResp](const boost::system::error_code ec, const bool updating) { + [asyncResp](const boost::system::error_code& ec, const bool updating) { // this interface isn't necessary, only check it // if we get a good return if (ec) @@ -432,7 +432,7 @@ inline void sdbusplus::asio::getAllProperties( *crow::connections::systemBus, connectionName, path, "xyz.openbmc_project.Inventory.Item.Drive", - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const std::vector< std::pair>& propertiesList) { @@ -706,7 +706,7 @@ inline void chassisDriveCollectionGet( *crow::connections::systemBus, "xyz.openbmc_project.ObjectMapper", path + "/drive", "xyz.openbmc_project.Association", "endpoints", - [asyncResp, chassisId](const boost::system::error_code ec3, + [asyncResp, chassisId](const boost::system::error_code& ec3, const std::vector& resp) { if (ec3) { @@ -753,7 +753,7 @@ inline void requestRoutesChassisDrive(App& app) inline void buildDrive(const std::shared_ptr& asyncResp, const std::string& chassisId, const std::string& driveName, - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::MapperGetSubTreeResponse& subtree) { @@ -872,7 +872,7 @@ inline void "xyz.openbmc_project.ObjectMapper", path + "/drive", "xyz.openbmc_project.Association", "endpoints", [asyncResp, chassisId, - driveName](const boost::system::error_code ec3, + driveName](const boost::system::error_code& ec3, const std::vector& resp) { if (ec3) { diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp index 06729fdb34..59abd4f026 100644 --- a/redfish-core/lib/systems.hpp +++ b/redfish-core/lib/systems.hpp @@ -181,7 +181,7 @@ inline void getProcessorSummary(const std::shared_ptr& aResp, const std::string& path) { - auto getCpuPresenceState = [aResp](const boost::system::error_code ec3, + auto getCpuPresenceState = [aResp](const boost::system::error_code& ec3, const bool cpuPresenceCheck) { if (ec3) { @@ -191,7 +191,7 @@ inline void getProcessorSummary(const std::shared_ptr& aResp, modifyCpuPresenceState(aResp, cpuPresenceCheck); }; - auto getCpuFunctionalState = [aResp](const boost::system::error_code ec3, + auto getCpuFunctionalState = [aResp](const boost::system::error_code& ec3, const bool cpuFunctionalCheck) { if (ec3) { @@ -217,7 +217,7 @@ inline void getProcessorSummary(const std::shared_ptr& aResp, *crow::connections::systemBus, service, path, "xyz.openbmc_project.Inventory.Item.Cpu", [aResp, service, - path](const boost::system::error_code ec2, + path](const boost::system::error_code& ec2, const dbus::utility::DBusPropertiesMap& properties) { if (ec2) { @@ -300,7 +300,7 @@ inline void *crow::connections::systemBus, connection.first, path, "xyz.openbmc_project.Inventory.Item.Dimm", [aResp, service{connection.first}, - path](const boost::system::error_code ec2, + path](const boost::system::error_code& ec2, const dbus::utility::DBusPropertiesMap& properties) { if (ec2) @@ -321,8 +321,9 @@ inline void "xyz.openbmc_project.State." "Decorator.OperationalStatus", "Functional", - [aResp](const boost::system::error_code ec3, - bool dimmState) { + [aResp]( + const boost::system::error_code& ec3, + bool dimmState) { if (ec3) { BMCWEB_LOG_ERROR @@ -396,7 +397,7 @@ inline void sdbusplus::asio::getAllProperties( *crow::connections::systemBus, connection.first, path, "xyz.openbmc_project.Common.UUID", - [aResp](const boost::system::error_code ec3, + [aResp](const boost::system::error_code& ec3, const dbus::utility::DBusPropertiesMap& properties) { if (ec3) @@ -444,7 +445,7 @@ inline void *crow::connections::systemBus, connection.first, path, "xyz.openbmc_project.Inventory.Decorator.Asset", - [aResp](const boost::system::error_code ec2, + [aResp](const boost::system::error_code& ec2, const dbus::utility::DBusPropertiesMap& propertiesList) { if (ec2) @@ -516,7 +517,7 @@ inline void "xyz.openbmc_project.Inventory.Decorator." "AssetTag", "AssetTag", - [aResp](const boost::system::error_code ec2, + [aResp](const boost::system::error_code& ec2, const std::string& value) { if (ec2) { @@ -549,7 +550,7 @@ inline void getHostState(const std::shared_ptr& aResp) *crow::connections::systemBus, "xyz.openbmc_project.State.Host", "/xyz/openbmc_project/state/host0", "xyz.openbmc_project.State.Host", "CurrentHostState", - [aResp](const boost::system::error_code ec, + [aResp](const boost::system::error_code& ec, const std::string& hostState) { if (ec) { @@ -838,7 +839,7 @@ inline void getBootProgress(const std::shared_ptr& aResp) *crow::connections::systemBus, "xyz.openbmc_project.State.Host", "/xyz/openbmc_project/state/host0", "xyz.openbmc_project.State.Boot.Progress", "BootProgress", - [aResp](const boost::system::error_code ec, + [aResp](const boost::system::error_code& ec, const std::string& bootProgressStr) { if (ec) { @@ -868,7 +869,7 @@ inline void getBootProgressLastStateTime( *crow::connections::systemBus, "xyz.openbmc_project.State.Host", "/xyz/openbmc_project/state/host0", "xyz.openbmc_project.State.Boot.Progress", "BootProgressLastUpdate", - [aResp](const boost::system::error_code ec, + [aResp](const boost::system::error_code& ec, const uint64_t lastStateTime) { if (ec) { @@ -902,7 +903,7 @@ inline void getBootOverrideType(const std::shared_ptr& aResp) *crow::connections::systemBus, "xyz.openbmc_project.Settings", "/xyz/openbmc_project/control/host0/boot", "xyz.openbmc_project.Control.Boot.Type", "BootType", - [aResp](const boost::system::error_code ec, + [aResp](const boost::system::error_code& ec, const std::string& bootType) { if (ec) { @@ -941,7 +942,7 @@ inline void getBootOverrideMode(const std::shared_ptr& aResp) *crow::connections::systemBus, "xyz.openbmc_project.Settings", "/xyz/openbmc_project/control/host0/boot", "xyz.openbmc_project.Control.Boot.Mode", "BootMode", - [aResp](const boost::system::error_code ec, + [aResp](const boost::system::error_code& ec, const std::string& bootModeStr) { if (ec) { @@ -985,7 +986,7 @@ inline void *crow::connections::systemBus, "xyz.openbmc_project.Settings", "/xyz/openbmc_project/control/host0/boot", "xyz.openbmc_project.Control.Boot.Source", "BootSource", - [aResp](const boost::system::error_code ec, + [aResp](const boost::system::error_code& ec, const std::string& bootSourceStr) { if (ec) { @@ -1038,7 +1039,7 @@ inline void *crow::connections::systemBus, "xyz.openbmc_project.Settings", "/xyz/openbmc_project/control/host0/boot/one_time", "xyz.openbmc_project.Object.Enable", "Enabled", - [aResp](const boost::system::error_code ec, bool oneTimeSetting) { + [aResp](const boost::system::error_code& ec, bool oneTimeSetting) { if (ec) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec; @@ -1073,7 +1074,7 @@ inline void *crow::connections::systemBus, "xyz.openbmc_project.Settings", "/xyz/openbmc_project/control/host0/boot", "xyz.openbmc_project.Object.Enable", "Enabled", - [aResp](const boost::system::error_code ec, + [aResp](const boost::system::error_code& ec, const bool bootOverrideEnable) { if (ec) { @@ -1126,7 +1127,7 @@ inline void getLastResetTime(const std::shared_ptr& aResp) *crow::connections::systemBus, "xyz.openbmc_project.State.Chassis", "/xyz/openbmc_project/state/chassis0", "xyz.openbmc_project.State.Chassis", "LastStateChangeTime", - [aResp](const boost::system::error_code ec, uint64_t lastResetTime) { + [aResp](const boost::system::error_code& ec, uint64_t lastResetTime) { if (ec) { BMCWEB_LOG_DEBUG << "D-BUS response error " << ec; @@ -1158,7 +1159,7 @@ inline void getAutomaticRetry(const std::shared_ptr& aResp) *crow::connections::systemBus, "xyz.openbmc_project.Settings", "/xyz/openbmc_project/control/host0/auto_reboot", "xyz.openbmc_project.Control.Boot.RebootPolicy", "AutoReboot", - [aResp](const boost::system::error_code ec, bool autoRebootEnabled) { + [aResp](const boost::system::error_code& ec, bool autoRebootEnabled) { if (ec) { BMCWEB_LOG_DEBUG << "D-BUS response error " << ec; @@ -1177,7 +1178,7 @@ inline void getAutomaticRetry(const std::shared_ptr& aResp) "/xyz/openbmc_project/state/host0", "xyz.openbmc_project.Control.Boot.RebootAttempts", "AttemptsLeft", - [aResp](const boost::system::error_code ec2, + [aResp](const boost::system::error_code& ec2, const uint32_t autoRebootAttemptsLeft) { if (ec2) { @@ -1227,7 +1228,8 @@ inline void *crow::connections::systemBus, "xyz.openbmc_project.Settings", "/xyz/openbmc_project/control/host0/power_restore_policy", "xyz.openbmc_project.Control.Power.RestorePolicy", "PowerRestorePolicy", - [aResp](const boost::system::error_code ec, const std::string& policy) { + [aResp](const boost::system::error_code& ec, + const std::string& policy) { if (ec) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec; @@ -1316,7 +1318,7 @@ inline void getTrustedModuleRequiredToBoot( sdbusplus::asio::getProperty( *crow::connections::systemBus, serv, path, "xyz.openbmc_project.Control.TPM.Policy", "TPMEnable", - [aResp](const boost::system::error_code ec2, bool tpmRequired) { + [aResp](const boost::system::error_code& ec2, bool tpmRequired) { if (ec2) { BMCWEB_LOG_DEBUG << "D-BUS response error on TPM.Policy Get" @@ -1405,7 +1407,7 @@ inline void setTrustedModuleRequiredToBoot( // Valid TPM Enable object found, now setting the value crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec2) { + [aResp](const boost::system::error_code& ec2) { if (ec2) { BMCWEB_LOG_DEBUG @@ -1464,7 +1466,7 @@ inline void setBootType(const std::shared_ptr& aResp, BMCWEB_LOG_DEBUG << "DBUS boot type: " << bootTypeStr; crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec) { + [aResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec; @@ -1533,7 +1535,7 @@ inline void setBootEnable(const std::shared_ptr& aResp, BMCWEB_LOG_DEBUG << "DBUS boot override enable: " << bootOverrideEnable; crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec2) { + [aResp](const boost::system::error_code& ec2) { if (ec2) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec2; @@ -1559,7 +1561,7 @@ inline void setBootEnable(const std::shared_ptr& aResp, << bootOverridePersistent; crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec) { + [aResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec; @@ -1613,7 +1615,7 @@ inline void setBootModeOrSource(const std::shared_ptr& aResp, BMCWEB_LOG_DEBUG << "DBUS boot mode: " << bootModeStr; crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec) { + [aResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec; @@ -1629,7 +1631,7 @@ inline void setBootModeOrSource(const std::shared_ptr& aResp, dbus::utility::DbusVariantType(bootSourceStr)); crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec) { + [aResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec; @@ -1724,7 +1726,7 @@ inline void setAssetTag(const std::shared_ptr& aResp, } crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec2) { + [aResp](const boost::system::error_code& ec2) { if (ec2) { BMCWEB_LOG_DEBUG << "D-Bus response error on AssetTag Set " @@ -1773,7 +1775,7 @@ inline void setAutomaticRetry(const std::shared_ptr& aResp, } crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec) { + [aResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(aResp->res); @@ -1822,7 +1824,7 @@ inline void powerRestorPolicy = policyMapsIt->second; crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec) { + [aResp](const boost::system::error_code& ec) { if (ec) { messages::internalError(aResp->res); @@ -1850,7 +1852,7 @@ inline void getProvisioningStatus(std::shared_ptr aResp) sdbusplus::asio::getAllProperties( *crow::connections::systemBus, "xyz.openbmc_project.PFR.Manager", "/xyz/openbmc_project/pfr", "xyz.openbmc_project.PFR.Attributes", - [aResp](const boost::system::error_code ec, + [aResp](const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& propertiesList) { nlohmann::json& oemPFR = aResp->res.jsonValue["Oem"]["OpenBmc"]["FirmwareProvisioning"]; @@ -2004,7 +2006,7 @@ inline void getPowerMode(const std::shared_ptr& aResp) sdbusplus::asio::getProperty( *crow::connections::systemBus, service, path, "xyz.openbmc_project.Control.Power.Mode", "PowerMode", - [aResp](const boost::system::error_code ec2, + [aResp](const boost::system::error_code& ec2, const std::string& pmode) { if (ec2) { @@ -2130,7 +2132,7 @@ inline void setPowerMode(const std::shared_ptr& aResp, // Set the Power Mode property crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec2) { + [aResp](const boost::system::error_code& ec2) { if (ec2) { messages::internalError(aResp->res); @@ -2219,7 +2221,7 @@ inline void *crow::connections::systemBus, "xyz.openbmc_project.Watchdog", "/xyz/openbmc_project/watchdog/host0", "xyz.openbmc_project.State.Watchdog", - [aResp](const boost::system::error_code ec, + [aResp](const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& properties) { if (ec) { @@ -2297,7 +2299,7 @@ inline void setWDTProperties(const std::shared_ptr& aResp, } crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec) { + [aResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec; @@ -2315,7 +2317,7 @@ inline void setWDTProperties(const std::shared_ptr& aResp, if (wdtEnable) { crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec) { + [aResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec; @@ -2458,7 +2460,7 @@ inline void getIdlePowerSaver(const std::shared_ptr& aResp) sdbusplus::asio::getAllProperties( *crow::connections::systemBus, service, path, "xyz.openbmc_project.Control.Power.IdlePowerSaver", - [aResp](const boost::system::error_code ec2, + [aResp](const boost::system::error_code& ec2, const dbus::utility::DBusPropertiesMap& properties) { if (ec2) { @@ -2557,7 +2559,7 @@ inline void setIdlePowerSaver(const std::shared_ptr& aResp, if (ipsEnable) { crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec2) { + [aResp](const boost::system::error_code& ec2) { if (ec2) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec2; @@ -2572,7 +2574,7 @@ inline void setIdlePowerSaver(const std::shared_ptr& aResp, if (ipsEnterUtil) { crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec2) { + [aResp](const boost::system::error_code& ec2) { if (ec2) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec2; @@ -2590,7 +2592,7 @@ inline void setIdlePowerSaver(const std::shared_ptr& aResp, // Convert from seconds into milliseconds for DBus const uint64_t timeMilliseconds = *ipsEnterTime * 1000; crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec2) { + [aResp](const boost::system::error_code& ec2) { if (ec2) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec2; @@ -2606,7 +2608,7 @@ inline void setIdlePowerSaver(const std::shared_ptr& aResp, if (ipsExitUtil) { crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec2) { + [aResp](const boost::system::error_code& ec2) { if (ec2) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec2; @@ -2624,7 +2626,7 @@ inline void setIdlePowerSaver(const std::shared_ptr& aResp, // Convert from seconds into milliseconds for DBus const uint64_t timeMilliseconds = *ipsExitTime * 1000; crow::connections::systemBus->async_method_call( - [aResp](const boost::system::error_code ec2) { + [aResp](const boost::system::error_code& ec2) { if (ec2) { BMCWEB_LOG_DEBUG << "DBUS response error " << ec2; @@ -2688,7 +2690,7 @@ inline void requestRoutesSystemsCollection(App& app) *crow::connections::systemBus, "xyz.openbmc_project.Settings", "/xyz/openbmc_project/network/hypervisor", "xyz.openbmc_project.Network.SystemConfiguration", "HostName", - [asyncResp](const boost::system::error_code ec2, + [asyncResp](const boost::system::error_code& ec2, const std::string& /*hostName*/) { nlohmann::json& ifaceArray = asyncResp->res.jsonValue["Members"]; ifaceArray = nlohmann::json::array(); @@ -2722,7 +2724,7 @@ inline void doNMI(const std::shared_ptr& asyncResp) constexpr char const* method = "NMI"; crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << " Bad D-Bus request error: " << ec; @@ -2811,7 +2813,7 @@ inline void requestRoutesSystemActionsReset(App& app) if (hostCommand) { crow::connections::systemBus->async_method_call( - [asyncResp, resetType](const boost::system::error_code ec) { + [asyncResp, resetType](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec; @@ -2837,7 +2839,7 @@ inline void requestRoutesSystemActionsReset(App& app) else { crow::connections::systemBus->async_method_call( - [asyncResp, resetType](const boost::system::error_code ec) { + [asyncResp, resetType](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec; diff --git a/redfish-core/lib/telemetry_service.hpp b/redfish-core/lib/telemetry_service.hpp index 02d7f38f23..f9df850ace 100644 --- a/redfish-core/lib/telemetry_service.hpp +++ b/redfish-core/lib/telemetry_service.hpp @@ -39,7 +39,7 @@ inline void handleTelemetryServiceGet( *crow::connections::systemBus, telemetry::service, "/xyz/openbmc_project/Telemetry/Reports", "xyz.openbmc_project.Telemetry.ReportManager", - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const dbus::utility::DBusPropertiesMap& ret) { if (ec == boost::system::errc::host_unreachable) { diff --git a/redfish-core/lib/trigger.hpp b/redfish-core/lib/trigger.hpp index 33630cd9d4..cb2707543a 100644 --- a/redfish-core/lib/trigger.hpp +++ b/redfish-core/lib/trigger.hpp @@ -333,7 +333,7 @@ inline void requestRoutesTrigger(App& app) *crow::connections::systemBus, telemetry::service, telemetry::getDbusTriggerPath(id), telemetry::triggerInterface, [asyncResp, - id](const boost::system::error_code ec, + id](const boost::system::error_code& ec, const std::vector>& ret) { if (ec.value() == EBADR || @@ -369,7 +369,7 @@ inline void requestRoutesTrigger(App& app) const std::string triggerPath = telemetry::getDbusTriggerPath(id); crow::connections::systemBus->async_method_call( - [asyncResp, id](const boost::system::error_code ec) { + [asyncResp, id](const boost::system::error_code& ec) { if (ec.value() == EBADR) { messages::resourceNotFound(asyncResp->res, "Triggers", id); diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp index c7b1593f31..d7dfbc4988 100644 --- a/redfish-core/lib/update_service.hpp +++ b/redfish-core/lib/update_service.hpp @@ -60,7 +60,7 @@ inline static void activateImage(const std::string& objPath, { BMCWEB_LOG_DEBUG << "Activate image for " << objPath << " " << service; crow::connections::systemBus->async_method_call( - [](const boost::system::error_code errorCode) { + [](const boost::system::error_code& errorCode) { if (errorCode) { BMCWEB_LOG_DEBUG << "error_code = " << errorCode; @@ -135,7 +135,7 @@ static void { std::shared_ptr task = task::TaskData::createTask( - [](boost::system::error_code ec, + [](const boost::system::error_code& ec, sdbusplus::message_t& msg, const std::shared_ptr& taskData) { @@ -506,7 +506,7 @@ inline void requestRoutesUpdateServiceActionsSimpleUpdate(App& app) // Call TFTP service crow::connections::systemBus->async_method_call( - [](const boost::system::error_code ec) { + [](const boost::system::error_code& ec) { if (ec) { // messages::internalError(asyncResp->res); @@ -603,7 +603,7 @@ inline void requestRoutesUpdateService(App& app) *crow::connections::systemBus, "xyz.openbmc_project.Settings", "/xyz/openbmc_project/software/apply_time", "xyz.openbmc_project.Software.ApplyTime", "RequestedApplyTime", - [asyncResp](const boost::system::error_code ec, + [asyncResp](const boost::system::error_code& ec, const std::string& applyTime) { if (ec) { @@ -689,7 +689,7 @@ inline void requestRoutesUpdateService(App& app) // Set the requested image apply time value crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "D-Bus responses error: " << ec; @@ -832,7 +832,7 @@ inline void *crow::connections::systemBus, service, path, "xyz.openbmc_project.Software.Version", [asyncResp, - swId](const boost::system::error_code errorCode, + swId](const boost::system::error_code& errorCode, const dbus::utility::DBusPropertiesMap& propertiesList) { if (errorCode) { diff --git a/redfish-core/lib/virtual_media.hpp b/redfish-core/lib/virtual_media.hpp index 45f384be34..00b4223fdf 100644 --- a/redfish-core/lib/virtual_media.hpp +++ b/redfish-core/lib/virtual_media.hpp @@ -178,7 +178,7 @@ inline void getVmResourceList(std::shared_ptr aResp, BMCWEB_LOG_DEBUG << "Get available Virtual Media resources."; crow::connections::systemBus->async_method_call( [name, aResp{std::move(aResp)}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& subtree) { if (ec) { @@ -218,7 +218,7 @@ inline void getVmData(const std::shared_ptr& aResp, crow::connections::systemBus->async_method_call( [resName, name, - aResp](const boost::system::error_code ec, + aResp](const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& subtree) { if (ec) { @@ -702,7 +702,7 @@ inline void doMountVmLegacy(const std::shared_ptr& asyncResp, } crow::connections::systemBus->async_method_call( - [asyncResp, secretPipe](const boost::system::error_code ec, + [asyncResp, secretPipe](const boost::system::error_code& ec, bool success) { if (ec) { @@ -734,7 +734,7 @@ inline void doVmAction(const std::shared_ptr& asyncResp, if (legacy) { crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "Bad D-Bus request error: " << ec; @@ -749,7 +749,7 @@ inline void doVmAction(const std::shared_ptr& asyncResp, else // proxy { crow::connections::systemBus->async_method_call( - [asyncResp](const boost::system::error_code ec) { + [asyncResp](const boost::system::error_code& ec) { if (ec) { BMCWEB_LOG_ERROR << "Bad D-Bus request error: " << ec; @@ -818,7 +818,7 @@ inline void handleManagersVirtualMediaActionInsertPost( crow::connections::systemBus->async_method_call( [service, resName, actionParams, - asyncResp](const boost::system::error_code ec2, + asyncResp](const boost::system::error_code& ec2, dbus::utility::ManagedObjectType& subtree) mutable { if (ec2) { @@ -915,7 +915,7 @@ inline void handleManagersVirtualMediaActionEject( crow::connections::systemBus->async_method_call( [resName, service, asyncResp{asyncResp}]( - const boost::system::error_code ec, + const boost::system::error_code& ec, const dbus::utility::ManagedObjectType& subtree) { if (ec) { -- cgit v1.2.3