1a3b2c68 | 17-Oct-2018 |
William A. Kennington III <wak@google.com> |
mapbox/variant: Implement std::get_if interface
Some of the code in the openbmc project uses their own ad-hoc get_if style interface. We need to provide one on the mapbox side to ease the transition
mapbox/variant: Implement std::get_if interface
Some of the code in the openbmc project uses their own ad-hoc get_if style interface. We need to provide one on the mapbox side to ease the transition.
Tested: Built code against the get_if implementation to make sure it conforms to the same behavior as std::get_if.
Change-Id: I8560a2d13110ab7fd82a21835a5e233682003fa8 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
ad7e686b | 27-Sep-2018 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Avoid build failure when sdbus++ tool is disabled
Few examples provided as a part of the repository are dependent on the sdbus++ code generation tool, and the compilation will fail trying to build t
Avoid build failure when sdbus++ tool is disabled
Few examples provided as a part of the repository are dependent on the sdbus++ code generation tool, and the compilation will fail trying to build the examples even in cases where the user disables sdbusapp during configuration using --disable-sdbuspp option.
- Made a change in example/Makefile.am to build the examples which are dependent on sdbus++ tool(which is dependent on few python packages) only when the sdbuspp is enabled during configuration.
Resolves openbmc/sdbusplus#19
Change-Id: I1453536fd4c7df35e66f2ccfe7a890cced0d155d Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
b20866d3 | 12-Oct-2018 |
William A. Kennington III <wak@google.com> |
mapbox/variant: Add std::visit compatible function
mapbox used to require that we use the apply_visitor interface. The new std::variant std::visit() interface is more generic and a superset of the f
mapbox/variant: Add std::visit compatible function
mapbox used to require that we use the apply_visitor interface. The new std::variant std::visit() interface is more generic and a superset of the functionality provided by apply_visitor. We just need to provide an alias.
Tested: Used this in phosphor-host-ipmid with a work in progress commit to make sure the compat layer is working fully.
Change-Id: I6ca9747e4f0825220e47bb9b2965a249466b3593 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
47b31887 | 12-Oct-2018 |
William A. Kennington III <wak@google.com> |
gitignore: Add missing /test/timer binary
This was never added when the test was made
Change-Id: I15655cdf131d8baef02c3856c53c79e014b9cf24 Signed-off-by: William A. Kennington III <wak@google.com> |
13de2532 | 15-Oct-2018 |
William A. Kennington III <wak@google.com> |
server/transaction: Fix message hash
Our message hashes used to generate transaction id's for dbus services have been relying on an invalid cookie when messages don't have cookies present. This was
server/transaction: Fix message hash
Our message hashes used to generate transaction id's for dbus services have been relying on an invalid cookie when messages don't have cookies present. This was exposed by 20adbc2d459123772ecd2d17009e1db0dd6314f2 which enabled error handling for message.get_cookie().
In order to generate a hash of the message, we need to consider the type of message we have. In the context of an sdbusplus server, METHOD_CALL type messages will always be incoming and sealed. They will always provide a valid .get_cookie(). Messages of METHOD_RETURN or METHOD_ERROR will not be sealed, but will always be generated from an incoming METHOD_CALL. Therefore they will always have a valid .get_reply_cookie(). SIGNAL type messages will always be outgoing so they will not have a cookie yet. We will just use a monotonic source for generating a transaction id for those.
Tested: Run through the unit test suite and booted in a romulus virtual machine. Ensured that none of the daemons were ABRTing like they were with just 20adbc2d459123772ecd2d17009e1db0dd6314f2 applied.
Change-Id: Ic54ae3b3cfa75d2f419579e1cb02f57eacb87c57 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
209dfc64 | 15-Oct-2018 |
William A. Kennington III <wak@google.com> |
message: Implment get_reply_cookie()
sd-bus messages of a reply type (return,error) contain the cookie associated with the incoming request. Lets expose the reply cookie of the message on the public
message: Implment get_reply_cookie()
sd-bus messages of a reply type (return,error) contain the cookie associated with the incoming request. Lets expose the reply cookie of the message on the public interface.
Tested: Builds and unit tests still pass
Change-Id: I7dddae1d2c4b961987e6526ce2dcb16107f40bed Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
8e8d1a66 | 15-Oct-2018 |
William A. Kennington III <wak@google.com> |
message: Implment get_type()
sd-bus messages are typed and we are going to need this information to support a future commit. Lets expose the type of the message on the public interface.
Tested:
message: Implment get_type()
sd-bus messages are typed and we are going to need this information to support a future commit. Lets expose the type of the message on the public interface.
Tested: Builds and unit tests still pass
Change-Id: I9c259af09b367d580dc14762d28cf77c129e2906 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
079fb85a | 12-Oct-2018 |
William A. Kennington III <wak@google.com> |
bus/call: Clarify error sources
There is some confusion, likely created by me, that call() might not throw an exception in the case of a method call returning a METHOD_ERROR.
This commit clarifies
bus/call: Clarify error sources
There is some confusion, likely created by me, that call() might not throw an exception in the case of a method call returning a METHOD_ERROR.
This commit clarifies that all errors are thrown, and that we do not need redundant is_method_error() checks on the reesulting message.
Change-Id: Ic2b962961cf671bd562bce7ba47135ad89bf9371 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
261e72b6 | 25-Sep-2018 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
Add coroutine support for sdbusplus::asio method calls
Using a coroutine to asynchronously execute method calls gives the best of both worlds: 1) better readability because the code reads like synch
Add coroutine support for sdbusplus::asio method calls
Using a coroutine to asynchronously execute method calls gives the best of both worlds: 1) better readability because the code reads like synchronous code 2) better throughput because it is actually asynchronous
When passed in a boost::asio::yield_context, the sdbusplus::asio dbus connection members async_send and async_method_call will execute asynchronously using coroutines.
This also adds an example of how this works in the example/asio-example.cpp file.
Change-Id: Ifb71b2c757ecbfd16b3be95bdefc45a701ca0d51 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|
fba332ba | 11-Oct-2018 |
William A. Kennington III <wak@google.com> |
Use return value from sd_bus_error_set*
The return value from sd_bus_error_set is always a negative error value mapping to the provided name. We should use this value instead of always returning -EI
Use return value from sd_bus_error_set*
The return value from sd_bus_error_set is always a negative error value mapping to the provided name. We should use this value instead of always returning -EINVAL.
Change-Id: I102c7a0b306db873d44e9c1b7cbd9cc146ffe29c Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
7a2ff91c | 11-Oct-2018 |
William A. Kennington III <wak@google.com> |
Fix invalid uses of sd_bus_error_set_const
sd_bus_error_set_const takes pointers to c-style strings as arguments which populate its name and message. This function does not take any ownership of the
Fix invalid uses of sd_bus_error_set_const
sd_bus_error_set_const takes pointers to c-style strings as arguments which populate its name and message. This function does not take any ownership of the name or message, requiring the to live beyond the lifetime of the error. Since we are destroying the error object as soon as we leave the catch blocks, we are destroying the strings passed to the sd_bus_error. This violates the lifetime guarantee.
Instead, use the sd_bus_error_set method which copies the strings. We know that the callers of these callbacks free the errors by inspecting the libsystemd code.
Tested: Run through unit tests which still pass
Change-Id: Ifa1533fc4c41db070f5bf2901581e9f5680cabfc Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
65654541 | 11-Oct-2018 |
William A. Kennington III <wak@google.com> |
sdbus: Add sd_bus_error_set method
This is not used by anyone yet with this patch, but will be used by a future fix.
Tested: Tests still build and pass
Change-Id: Ia90e4eee6cb1bf3e5c5e7ac6daa8
sdbus: Add sd_bus_error_set method
This is not used by anyone yet with this patch, but will be used by a future fix.
Tested: Tests still build and pass
Change-Id: Ia90e4eee6cb1bf3e5c5e7ac6daa86e0f22b1d929 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
81fa02ee | 04-Oct-2018 |
William A. Kennington III <wak@google.com> |
message: Fix variant api usage
This makes our use of the mapbox variant consistent with std::variant. We need this cleanup for the conversion to std::variant.
Tested: Ran unit tests to make sur
message: Fix variant api usage
This makes our use of the mapbox variant consistent with std::variant. We need this cleanup for the conversion to std::variant.
Tested: Ran unit tests to make sure they still pass.
Change-Id: I990013eaaa2ec27f2fda71bfadd9a5369d50c187 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
b2cb9339 | 04-Oct-2018 |
William A. Kennington III <wak@google.com> |
mapbox/variant: Align API with std::variant
Tested: Builds and unit tests still pass. Manually tested that has_alternative works as expected.
Change-Id: Iae8309c09a6aac6b9b12164d5fe7ae4e484
mapbox/variant: Align API with std::variant
Tested: Builds and unit tests still pass. Manually tested that has_alternative works as expected.
Change-Id: Iae8309c09a6aac6b9b12164d5fe7ae4e484cb905 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
20adbc2d | 03-Oct-2018 |
William A. Kennington III <wak@google.com> |
message: Add error handling
Some of the methods that can return errors are not being checked for errors. Check all of the return values where necessary.
Tested: Ran through a build and unit tes
message: Add error handling
Some of the methods that can return errors are not being checked for errors. Check all of the return values where necessary.
Tested: Ran through a build and unit test run
Change-Id: I3f8469cbe80a0c58032407f2ba184d913df6e2f1 Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
2b74e528 | 02-Oct-2018 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
Add new_method_errno interface to message and low-level interface
In order to properly return an sdbus error in an async execution path, the low-level interface and message classes need to expose th
Add new_method_errno interface to message and low-level interface
In order to properly return an sdbus error in an async execution path, the low-level interface and message classes need to expose the underlying sdbus set errno api.
Change-Id: I893ef587ecf8ae3936198375931e6747d71ad451 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|
ca46b9d2 | 02-Oct-2018 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
Set sdbusplus to use c++17
C++17 is available with the current compiler. Changing to this standard will allow sdbusplus to use some more advanced language features that can reduce code size and impr
Set sdbusplus to use c++17
C++17 is available with the current compiler. Changing to this standard will allow sdbusplus to use some more advanced language features that can reduce code size and improve readability.
Change-Id: Ia9a1af615bd5b3bc0868677308a8dd269a4bf5db Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|
17052240 | 25-Sep-2018 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
Allow copy constructor/assignment operator for message::message
This change enables copies and assignments of messages, specifically, copy constructors and copy assignment operators and the default
Allow copy constructor/assignment operator for message::message
This change enables copies and assignments of messages, specifically, copy constructors and copy assignment operators and the default empty constructor. A boost::asio::yield_context needs to be able to store the result of the async operation (a message::message) in a helper struct, which results in a default construction (with a null msg_t) and later an assignment to replace it when the result is ready. But adding the appropriate sd_bus_message_ref/unref calls makes this possible.
While the default-constructed object does not sit around for long, this change also adds in some asserts to catch any invalid accesses of the object in that state.
Change-Id: I2059cb677fc5a30a3c7e3c2b81ed4199e5460dde Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|
18fe1745 | 21-Sep-2018 |
Brad Bishop <bradleyb@fuzziesquirrel.com> |
maintainers: Add William Kennington as maintainer
William has been hacking on sdbusplus a lot recently. Enough so that he is now the top contribtor in both commit count and LOC count (not counting
maintainers: Add William Kennington as maintainer
William has been hacking on sdbusplus a lot recently. Enough so that he is now the top contribtor in both commit count and LOC count (not counting the original sdbusplus author).
William has demonstrated solid code and design principles, maintains a presence in #openbmc and is very responsive to questions and feedback.
All of these make William the most qualified for sdbusplus maintainership.
Change-Id: I3bab20dbefa1bed5e076f1b021605a2f998690c0 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
show more ...
|
703892e2 | 20-Sep-2018 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Installation of sdbusplus on custom distributions
The installation of sdbusplus bindings on custom distributions requires few basic packages which are not clearly mentioned in the current documentat
Installation of sdbusplus on custom distributions
The installation of sdbusplus bindings on custom distributions requires few basic packages which are not clearly mentioned in the current documentation.
This commit is used to improve the documentation of the sdbusplus to include the necessary packages that are required to install it on Ubuntu and Fedora. This will help beginners in the Ubuntu/Fedora community to leverage the sdbusplus bindings for their applications outside OpenBMC space.
Change-Id: I62ee774e8cf2cf9b03751496cfbb1d40858eaed9 Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
6693995a | 21-Sep-2018 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
Fix memory leak in async_send_handler error path
If the handler throws in its error path, then this would cause a memory leak (assuming that the executer is catching exceptions).
Change-Id: I44f0fe
Fix memory leak in async_send_handler error path
If the handler throws in its error path, then this would cause a memory leak (assuming that the executer is catching exceptions).
Change-Id: I44f0feaa7d317a7d8a23bc65a3d9cf6078539f44 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|
33335b35 | 21-Sep-2018 |
Adriana Kobylak <anoo@us.ibm.com> |
exception: Add .get_errno() method
Add the .get_errno() method to provide the errno value from SdBusError.
Closes openbmc/sdbusplus#22
Tested: Added check for the new method to the exception unit
exception: Add .get_errno() method
Add the .get_errno() method to provide the errno value from SdBusError.
Closes openbmc/sdbusplus#22
Tested: Added check for the new method to the exception unit test suite. Also verified external callers get the right errno value with: catch (const SdBusError& e) { int errno = e.get_errno()); }
Change-Id: Idddfa7f1bd9cfabfaf89e4d6c83146b4b9af211f Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
show more ...
|
5b701c66 | 11-Sep-2018 |
William A. Kennington III <wak@google.com> |
bus: Add sd_bus_call() helper that ignores errors
This helper wraps the noreply case to make it trivial for callers to ignore all errors associated with a call.
Change-Id: I9ddd639633694b315384f71e
bus: Add sd_bus_call() helper that ignores errors
This helper wraps the noreply case to make it trivial for callers to ignore all errors associated with a call.
Change-Id: I9ddd639633694b315384f71e49f0760ada6de6ce Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
035c73b2 | 05-Sep-2018 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
sdbus::asio: service sd_event loop upon request
If requested, add in an asynchronous sd_event servicing mechanism so sd_events can be used in conjunction with boost::asio events. Code throughout the
sdbus::asio: service sd_event loop upon request
If requested, add in an asynchronous sd_event servicing mechanism so sd_events can be used in conjunction with boost::asio events. Code throughout the openbmc repositories use sd_events, especially for timers. In some cases, we may want to add boost::asio event handling for superior asynchronous eventing, but not want to rewrite all the existing sd_event code. This gives us the best of both worlds, with a low-overhead mechanism to handle the sd_events.
Change-Id: I3f8e2aafa3f733439e1494253698d17c2f3a2321 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|
7efcdaeb | 06-Sep-2018 |
Vernon Mauery <vernon.mauery@linux.intel.com> |
add common timer.hpp unit tests
Add unit tests for timer.hpp class. These are the unit tests copied from the phosphor-host-ipmid/softoff/test directory.
Change-Id: I9d74c6eb528f652965f43a3a4b973368
add common timer.hpp unit tests
Add unit tests for timer.hpp class. These are the unit tests copied from the phosphor-host-ipmid/softoff/test directory.
Change-Id: I9d74c6eb528f652965f43a3a4b973368ed782bf0 Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
show more ...
|