From 82dbc15a05125a812c140a3c8cff81c366482229 Mon Sep 17 00:00:00 2001 From: "Jason M. Bills" Date: Mon, 7 Dec 2020 13:45:20 -0800 Subject: Update to internal 0.26 Signed-off-by: Jason M. Bills --- ...er-Check-return-code-for-sd_bus_add_objec.patch | 35 ++++++ ...ettable-timeout-value-for-async_method_ca.patch | 134 --------------------- ...ew_signal_and_extend_set_property_methods.patch | 78 ------------ .../sdbusplus/sdbusplus_%.bbappend | 3 +- 4 files changed, 36 insertions(+), 214 deletions(-) create mode 100644 meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0001-Revert-server-Check-return-code-for-sd_bus_add_objec.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0001-sdbusplus-settable-timeout-value-for-async_method_ca.patch delete mode 100644 meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0002-sdbusplus_Add_new_signal_and_extend_set_property_methods.patch (limited to 'meta-openbmc-mods/meta-common/recipes-extended/sdbusplus') diff --git a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0001-Revert-server-Check-return-code-for-sd_bus_add_objec.patch b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0001-Revert-server-Check-return-code-for-sd_bus_add_objec.patch new file mode 100644 index 000000000..7b483550c --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0001-Revert-server-Check-return-code-for-sd_bus_add_objec.patch @@ -0,0 +1,35 @@ +From d2a418f554ebe3438181c97f2800d36f17295c1f Mon Sep 17 00:00:00 2001 +From: Johnathan Mantey +Date: Mon, 13 Jul 2020 11:51:54 -0700 +Subject: [PATCH] Revert "server: Check return code for + sd_bus_add_object_vtable()" + +This reverts commit 017a19da5f67a74daedf4d63111569902d4764e6. + +%% original patch: 0001-Revert-server-Check-return-code-for-sd_bus_add_objec.patch +--- + include/sdbusplus/server/interface.hpp | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/include/sdbusplus/server/interface.hpp b/include/sdbusplus/server/interface.hpp +index acf4a09..36e89de 100644 +--- a/include/sdbusplus/server/interface.hpp ++++ b/include/sdbusplus/server/interface.hpp +@@ -64,12 +64,8 @@ struct interface final + _interface_added(false) + { + sd_bus_slot* slot = nullptr; +- int r = _intf->sd_bus_add_object_vtable( +- _bus.get(), &slot, _path.c_str(), _interf.c_str(), vtable, context); +- if (r < 0) +- { +- throw exception::SdBusError(-r, "sd_bus_add_object_vtable"); +- } ++ _intf->sd_bus_add_object_vtable(_bus.get(), &slot, _path.c_str(), ++ _interf.c_str(), vtable, context); + + _slot = decltype(_slot){slot}; + } +-- +2.26.2 + diff --git a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0001-sdbusplus-settable-timeout-value-for-async_method_ca.patch b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0001-sdbusplus-settable-timeout-value-for-async_method_ca.patch deleted file mode 100644 index 82d39cea5..000000000 --- a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0001-sdbusplus-settable-timeout-value-for-async_method_ca.patch +++ /dev/null @@ -1,134 +0,0 @@ -From 42040cbbc6c6691cef3bee4e42808c3921be9766 Mon Sep 17 00:00:00 2001 -From: Konrad Sztyber -Date: Fri, 27 Mar 2020 16:48:26 +0100 -Subject: [PATCH] sdbusplus: settable timeout value for async_method_call - -Added extra method, asio::connection::async_method_call_timed allowing -the user to specify the value of the timeout to be used for that call -(in microseconds). Using 0 as the timeout results in using the default -value, which is equivalent to calling asio::connection::async_method_call. - -Signed-off-by: Konrad Sztyber -Change-Id: Id79772e46a77f62af5b39ec341648e34af6aaf99 ---- - sdbusplus/asio/connection.hpp | 51 +++++++++++++++++--- - sdbusplus/asio/detail/async_send_handler.hpp | 7 ++- - 2 files changed, 46 insertions(+), 12 deletions(-) - -diff --git a/sdbusplus/asio/connection.hpp b/sdbusplus/asio/connection.hpp -index b3ff4fd..ec07e4e 100644 ---- a/sdbusplus/asio/connection.hpp -+++ b/sdbusplus/asio/connection.hpp -@@ -84,7 +84,8 @@ class connection : public sdbusplus::bus::bus - inline BOOST_ASIO_INITFN_RESULT_TYPE(MessageHandler, - void(boost::system::error_code, - message::message&)) -- async_send(message::message& m, MessageHandler&& handler) -+ async_send(message::message& m, MessageHandler&& handler, -+ uint64_t timeout = 0) - { - boost::asio::async_completion< - MessageHandler, void(boost::system::error_code, message::message)> -@@ -92,12 +93,12 @@ class connection : public sdbusplus::bus::bus - detail::async_send_handler::completion_handler_type>( -- std::move(init.completion_handler))(get(), m); -+ std::move(init.completion_handler))(get(), m, timeout); - return init.result.get(); - } - - /** @brief Perform an asynchronous method call, with input parameter packing -- * and return value unpacking -+ * and return value unpacking. - * - * @param[in] handler - A function object that is to be called as a - * continuation for the async dbus method call. The -@@ -108,6 +109,8 @@ class connection : public sdbusplus::bus::bus - * @param[in] objpath - The object's path for the call. - * @param[in] interf - The object's interface to call. - * @param[in] method - The object's method to call. -+ * @param[in] timeout - The timeout for the method call in usec (0 results -+ * in using the default value). - * @param[in] a... - Optional parameters for the method call. - * - * @return immediate return of the internal handler registration. The -@@ -116,10 +119,12 @@ class connection : public sdbusplus::bus::bus - * complete. - */ - template -- void async_method_call(MessageHandler&& handler, const std::string& service, -- const std::string& objpath, -- const std::string& interf, const std::string& method, -- const InputArgs&... a) -+ void async_method_call_timed(MessageHandler&& handler, -+ const std::string& service, -+ const std::string& objpath, -+ const std::string& interf, -+ const std::string& method, uint64_t timeout, -+ const InputArgs&... a) - { - using FunctionTuple = boost::callable_traits::args_t; - using FunctionTupleType = -@@ -184,7 +189,37 @@ class connection : public sdbusplus::bus::bus - applyHandler(ec, m); - return; - } -- async_send(m, std::forward(applyHandler)); -+ async_send(m, std::forward(applyHandler), -+ timeout); -+ } -+ -+ /** @brief Perform an asynchronous method call, with input parameter packing -+ * and return value unpacking. Uses the default timeout value. -+ * -+ * @param[in] handler - A function object that is to be called as a -+ * continuation for the async dbus method call. The -+ * arguments to parse on the return are deduced from -+ * the handler's signature and then passed in along -+ * with an error code and optional message::message -+ * @param[in] service - The service to call. -+ * @param[in] objpath - The object's path for the call. -+ * @param[in] interf - The object's interface to call. -+ * @param[in] method - The object's method to call. -+ * @param[in] a... - Optional parameters for the method call. -+ * -+ * @return immediate return of the internal handler registration. The -+ * result of the actual asynchronous call will get unpacked from -+ * the message and passed into the handler when the call is -+ * complete. -+ */ -+ template -+ void async_method_call(MessageHandler&& handler, const std::string& service, -+ const std::string& objpath, -+ const std::string& interf, const std::string& method, -+ const InputArgs&... a) -+ { -+ async_method_call_timed(std::forward(handler), service, -+ objpath, interf, method, 0, a...); - } - - /** @brief Perform a yielding asynchronous method call, with input -diff --git a/sdbusplus/asio/detail/async_send_handler.hpp b/sdbusplus/asio/detail/async_send_handler.hpp -index bb896ad..cb91f51 100644 ---- a/sdbusplus/asio/detail/async_send_handler.hpp -+++ b/sdbusplus/asio/detail/async_send_handler.hpp -@@ -35,12 +35,11 @@ struct async_send_handler - {} - async_send_handler(Handler& handler) : handler_(handler) - {} -- void operator()(sd_bus* conn, message::message& mesg) -+ void operator()(sd_bus* conn, message::message& mesg, uint64_t timeout) - { - async_send_handler* context = new async_send_handler(std::move(*this)); -- // 0 is the default timeout -- int ec = -- sd_bus_call_async(conn, NULL, mesg.get(), &callback, context, 0); -+ int ec = sd_bus_call_async(conn, NULL, mesg.get(), &callback, context, -+ timeout); - if (ec < 0) - { - // add a deleter to context because handler may throw --- -2.25.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0002-sdbusplus_Add_new_signal_and_extend_set_property_methods.patch b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0002-sdbusplus_Add_new_signal_and_extend_set_property_methods.patch deleted file mode 100644 index 21c5b3afa..000000000 --- a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus/0002-sdbusplus_Add_new_signal_and_extend_set_property_methods.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 9589a690577bdb4d2b79894d1c6a9c8396af5c2a Mon Sep 17 00:00:00 2001 -From: Zhikui Ren -Date: Fri, 26 Jun 2020 17:42:47 -0700 -Subject: [PATCH] Add new_signal and extend set_property methods to - dbus_interface - -new_signal exports the same member function of sdbusplus::server::interface - -extend set_property to be able to return true only when the property value -is changed. default behavior remains unchanged - returns true when property -is updated successfully, value may be same or changed. - -With these two functions, dbus_interface can broadcast new signal when -a property is changed. This allows a customized message to be sent -when a property changes. - -Tested: -Build test code to use the two new method to create and send new_signal when -a property is changed. - -Signed-off-by: Zhikui Ren -Change-Id: I1815885bc77aad2c526b402f1386d4914479e738 - -%% original patch: 0002-sdbusplus_Add_new_signal_and_extend_set_property_methods.patch ---- - sdbusplus/asio/object_server.hpp | 21 +++++++++++++++++++-- - 1 file changed, 19 insertions(+), 2 deletions(-) - -diff --git a/sdbusplus/asio/object_server.hpp b/sdbusplus/asio/object_server.hpp -index 7a3e8e7..35199bc 100644 ---- a/sdbusplus/asio/object_server.hpp -+++ b/sdbusplus/asio/object_server.hpp -@@ -494,7 +494,7 @@ class dbus_interface - - return true; - } -- template -+ template - bool set_property(const std::string& name, const PropertyType& value) - { - if (!initialized_) -@@ -511,8 +511,12 @@ class dbus_interface - if (status != SetPropertyReturnValue::sameValueUpdated) - { - signal_property(name); -+ return true; -+ } -+ if constexpr (!changesOnly) -+ { -+ return true; - } -- return true; - } - } - return false; -@@ -720,6 +724,19 @@ class dbus_interface - return sd_bus_error_set_const(error, SD_BUS_ERROR_INVALID_ARGS, NULL); - } - -+ /** @brief Create a new signal message. -+ * -+ * @param[in] member - The signal name to create. -+ */ -+ auto new_signal(const char* member) -+ { -+ if (!initialized_) -+ { -+ return message::message(nullptr); -+ } -+ return interface_->new_signal(member); -+ } -+ - bool initialize(const bool skipPropertyChangedSignal = false) - { - // can only register once --- -2.17.1 - diff --git a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend index c0b530840..6d16fe190 100644 --- a/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend +++ b/meta-openbmc-mods/meta-common/recipes-extended/sdbusplus/sdbusplus_%.bbappend @@ -1,6 +1,5 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += " \ - file://0001-sdbusplus-settable-timeout-value-for-async_method_ca.patch \ - file://0002-sdbusplus_Add_new_signal_and_extend_set_property_methods.patch \ + file://0001-Revert-server-Check-return-code-for-sd_bus_add_objec.patch \ " -- cgit v1.2.3