b08d14dd | 05-Nov-2024 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: events: unpack an event from JSON
Generate code necessary to unpack a generated event from its JSON representation.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I7a28617f
sdbus++: events: unpack an event from JSON
Generate code necessary to unpack a generated event from its JSON representation.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I7a28617f3f0374968609328a44587b655a9141c1
show more ...
|
3b54a8e5 | 25-Oct-2024 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: simplify handling of empty parameter lists
Add a template specialization of the type-tuple generation for empty parameter lists in order to simplify the Mako templates. This eliminates a sp
sdbus++: simplify handling of empty parameter lists
Add a template specialization of the type-tuple generation for empty parameter lists in order to simplify the Mako templates. This eliminates a special case for empty parameter lists in multiple places.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I7ca8d962ab1c7a65e0ad6d80ece1cd7e3847f2c6
show more ...
|
fc0bb996 | 11-Oct-2024 |
Patrick Williams <patrick@stwcx.xyz> |
bus: un-inline functions
Due to additional upstream error results, the bus creation functions need better error handling. This will result in larger functions that are no longer a direct sd-bus cal
bus: un-inline functions
Due to additional upstream error results, the bus creation functions need better error handling. This will result in larger functions that are no longer a direct sd-bus call and probably shouldn't be inlined. Move the functions to the `bus.cpp` file.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: If141ef74a62fd04b3bbf58b0720da2a9410481a7
show more ...
|
4b3720f8 | 10-Oct-2024 |
Patrick Williams <patrick@stwcx.xyz> |
async: context: use new_bus by default
There are two primary methods for creating a generic bus: * new_default * new_bus
The "default" methods use TLS to get a shared bus for the thread. Thi
async: context: use new_bus by default
There are two primary methods for creating a generic bus: * new_default * new_bus
The "default" methods use TLS to get a shared bus for the thread. This is likely not the desired bus to use for async operations because:
1. Currently a separate thread is used for the message processing. 2. Some existing synchronous code throughout openbmc uses `new_default` instead of referencing an existing bus, which could interfere with the async context.
Switch to using `new_bus` by default to ensure we get a fresh, unused and unshared bus in the typical case.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I1fd27de7bce9a8737294a5ab8e63e0dbe1afc8c3
show more ...
|
c012fde4 | 07-Oct-2024 |
Patrick Williams <patrick@stwcx.xyz> |
events: add severity to class generation
Use the severity field to add to the class generation for use by phosphor-logging to commit entries.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Cha
events: add severity to class generation
Use the severity field to add to the class generation for use by phosphor-logging to commit entries.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I82bb8482c0f95435275fb3a1fcdcb37bd29fc7ec
show more ...
|
760adffd | 05-Oct-2024 |
Patrick Williams <patrick@stwcx.xyz> |
events: add non-template base class
In order to allow non-template implementations that interact with the `sdbusplus::excception::generated_event<T>` class, it is useful to have a non-template base
events: add non-template base class
In order to allow non-template implementations that interact with the `sdbusplus::excception::generated_event<T>` class, it is useful to have a non-template base class. Add the `to_json` there for use by phosphor-logging.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ibed2c7c4fc0e23f1c82c4c003e16a6f438f7e68f
show more ...
|
14c4797c | 24-Sep-2024 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: events: create json for events
Create JSON for the events containing their metadata and leverage that as the "message" portion of the `sd_bus_error`. This will allow unpacking the message
sdbus++: events: create json for events
Create JSON for the events containing their metadata and leverage that as the "message" portion of the `sd_bus_error`. This will allow unpacking the message on a client side back to the original exception.
Tested: ``` $ busctl --user call net.poettering.Calculator /net/poettering/calculator net.poettering.Calculator Divide xx 5 0 Call failed: {"net.poettering.Calculator.DivisionByZero":{"FOO":"unused"}} ```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I4edd76d983267f28e51c4aa41902d45f5d6da793
show more ...
|
a4bfefde | 24-Sep-2024 |
Patrick Williams <patrick@stwcx.xyz> |
exception: move sd_bus_error_set calls to exception
In the future, generated exceptions will need to fill the sd_error with something other than the "description" in order to pass more metadata. Mo
exception: move sd_bus_error_set calls to exception
In the future, generated exceptions will need to fill the sd_error with something other than the "description" in order to pass more metadata. Move the sd_bus_error_set calls to exception as a virtual function so this can be accomplished.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6e6947e4977701a8e7e27fef119bd35e837d866b
show more ...
|
ebe01794 | 24-Sep-2024 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: events: simplify constructor
Consolidate consteval_string usage to simplify the generated code.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6340eb369c117bb580a128e53381
sdbus++: events: simplify constructor
Consolidate consteval_string usage to simplify the generated code.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6340eb369c117bb580a128e5338113a4b38a0f80
show more ...
|
d925c0bc | 23-Sep-2024 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: events: generate exception constructors
Generate constructors for exceptions using the listed metadata.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I99dc912e4ad0746a14d3
sdbus++: events: generate exception constructors
Generate constructors for exceptions using the listed metadata.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I99dc912e4ad0746a14d3053a5653327ae12440dd
show more ...
|
d731d263 | 17-Sep-2024 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: events: create event classes
Generate an equivalent amount of exception class as the `errors.yaml` supported and convert the examples to use it.
Tested:
``` ‣ Type=error Endian=l Flags=
sdbus++: events: create event classes
Generate an equivalent amount of exception class as the `errors.yaml` supported and convert the examples to use it.
Tested:
``` ‣ Type=error Endian=l Flags=1 Version=1 Cookie=9 ReplyCookie=2 Timestamp="Tue 2024-09-17 18:21:35.649674 UTC" Sender=:1.2489 Destination=:1.2495 ErrorName=net.poettering.Calculator.DivisionByZero ErrorMessage="Attempted to divide by zero." UniqueName=:1.2489 MESSAGE "s" { STRING "Attempted to divide by zero."; }; ```
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I4b2671838639d1e8be1ccdf655b699a98b9c2116
show more ...
|
88c6a823 | 10-Sep-2024 |
Lei YU <yulei.sh@bytedance.com> |
message: Fix unpack void type
The template unpack<void> is deduced as one argument instead of 0, and results in below compile error: ``` error: variable or field ‘r’ declared void error: return-stat
message: Fix unpack void type
The template unpack<void> is deduced as one argument instead of 0, and results in below compile error: ``` error: variable or field ‘r’ declared void error: return-statement with a value, in function returning ‘void’ [-fpermissive] ```
Fix this by checking void if `sizeof...(Args) == 1` and return void. Also add a unit test case to make sure the code compiles.
Change-Id: I74cca180783645496863393be37215f1d6f4ca02 Signed-off-by: Lei YU <yulei.sh@bytedance.com>
show more ...
|
6ea10e04 | 02-Sep-2024 |
Lei YU <yulei.sh@bytedance.com> |
asio: Fix read into tuple response
Some DBus methods return multiple elements, e.g. `org.freedesktop.resolve1` has a method `ResolveHostname` that returns the result type `a(iiay)st`, which could no
asio: Fix read into tuple response
Some DBus methods return multiple elements, e.g. `org.freedesktop.resolve1` has a method `ResolveHostname` that returns the result type `a(iiay)st`, which could not be "read()" directly as a tuple.
The code was using a tuple to represent the multiple elements, and use `r.read(responseData)` that would result in "Invalid Argument" error.
Fix it by `message::unpack` API to correctly read the response and unpack the multiple elements into the tuple.
Change-Id: I83eb83abf0b079ebf94c1a51a40640533ab04a9f Signed-off-by: Lei YU <yulei.sh@bytedance.com>
show more ...
|
8d40adad | 22-Aug-2024 |
Igor Kononenko <i.kononenko.e@gmail.com> |
transaction: fix -Wconversion c++ warning
Building sdbusplus by meson subproject as a part of external project contains compile warning which can be interpreted as compile error (if external project
transaction: fix -Wconversion c++ warning
Building sdbusplus by meson subproject as a part of external project contains compile warning which can be interpreted as compile error (if external project defines both `-Werror` and `-Wconversion`)
Changing the `Transaction::time` property type to the appropriate `std::time_t` will solve the issue.
Change-Id: I9ab42472ff361aab9487c73d7804531151986e4c Signed-off-by: Igor Kononenko <i.kononenko.e@gmail.com>
show more ...
|
06f265f6 | 16-Aug-2024 |
Patrick Williams <patrick@stwcx.xyz> |
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda forma
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda formatting also changed, so we have made changes to the organization default style format to better handle lambda formatting.
See I5e08687e696dd240402a2780158664b7113def0e for updated style. See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement.
Change-Id: I4f63258febea27dae710c252033b9151e02be7e8 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
5cee9157 | 30-Jul-2024 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: update to latest commit
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I52e2ff4ea33617fb055981000ce3c2f40faab43e |
3d00e145 | 30-Jul-2024 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: ignore unused parameter warning
Upstream stdexec continues to add unused parameter warnings that are reported by GCC -Wall. Add pragmas to squelch them so that we don't need to keep chasin
stdexec: ignore unused parameter warning
Upstream stdexec continues to add unused parameter warnings that are reported by GCC -Wall. Add pragmas to squelch them so that we don't need to keep chasing these.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ia93113bb2136db365a112d69758b2d1fd61d3a24
show more ...
|
03b2c26c | 03-Jun-2024 |
Ed Tanous <etanous@nvidia.com> |
Use asio object_server without boost::coroutine
We already support this flag in asio::connection and other places, where it's used to avoid compatibility issues with boost coroutine v1, which is a p
Use asio object_server without boost::coroutine
We already support this flag in asio::connection and other places, where it's used to avoid compatibility issues with boost coroutine v1, which is a package that isn't widely used, and requires explicitly built libraries (coroutine and context).
This commit supports the same flag in ASIO object server, for things like dbus-sensors, which doesn't make use of asio coroutines.
Change-Id: I75deec77f4434e671fe5028cad14fd9998cf9b40 Signed-off-by: Ed Tanous <etanous@nvidia.com>
show more ...
|
3baa3045 | 17-Jun-2024 |
Manojkiran Eda <manojkiran.eda@gmail.com> |
Fix spelling mistakes using codespell
This commit corrects various spelling mistakes throughout the repository. The corrections were made automatically using `codespell`[1] tool.
[1]: https://githu
Fix spelling mistakes using codespell
This commit corrects various spelling mistakes throughout the repository. The corrections were made automatically using `codespell`[1] tool.
[1]: https://github.com/codespell-project/codespell
Change-Id: Iab32afe9e86f7f4c18984ad2c7717d7cbfd422bb Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
show more ...
|
1a39b64f | 12-Apr-2024 |
Patrick Williams <patrick@stwcx.xyz> |
message: handle vector<bool>
Attempting to create a vector of bools resulted in the following compile error: ``` usr/include/sdbusplus/message/append.hpp:272:9: error: cannot bind non-const lvalue r
message: handle vector<bool>
Attempting to create a vector of bools resulted in the following compile error: ``` usr/include/sdbusplus/message/append.hpp:272:9: error: cannot bind non-const lvalue reference of type 'std::_Bit_reference&' to an rvalue of type 'std::_Bit_iterator::reference' ```
Most range-for operations for containers operate on a reference to the value in the container, but `vector<bool>` has a "proxy" due to the bit-wise optimization required by the standard. Switching from `auto&` to `auto&&` allows the proxy to be used (an r-value reference) while also working for the non-proxy case (since `auto&&` will collapse to an l-value reference).
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ic96a156f29fb9429529080f4319548d91ac0ce41
show more ...
|
6e675883 | 05-Apr-2024 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: update to later commit
Later commits in stdexec have some compile issues. Update to the latest one without compile issues, in order to see if a linker issue reported by another developer i
stdexec: update to later commit
Later commits in stdexec have some compile issues. Update to the latest one without compile issues, in order to see if a linker issue reported by another developer is resolved.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I99bb6ee9c383c3cb66a35b23f02a6a0ced102b49
show more ...
|
e12a23cc | 22-Feb-2024 |
Ed Tanous <ed@tanous.net> |
Make code compile on clang-18
To do this requires fixing some minor warnings around templates.
stdexec uses variables of the form __foo to denote variables that aren't used. This throws some warni
Make code compile on clang-18
To do this requires fixing some minor warnings around templates.
stdexec uses variables of the form __foo to denote variables that aren't used. This throws some warnings when trying to compile with clang.
Update the meson file to ignore those warnings when we detect clang.
With this change, and clang-18, code now compiles.
Change-Id: I72bc0ab7a818b7913831749b6246f54e7b092e0b Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
8723a542 | 12-Feb-2024 |
Patrick Williams <patrick@stwcx.xyz> |
stdexec: update to latest commit
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I56cac3d5d7cc00d6efd7c9df62bc134e291a81a3 |
c53fe51c | 06-Feb-2024 |
Patrick Williams <patrick@stwcx.xyz> |
async: context: add request_name method
One area we did a poor job on in the older sync interfaces was signals. Signals should only be emitted when a name is requested, but we didn't have a way to t
async: context: add request_name method
One area we did a poor job on in the older sync interfaces was signals. Signals should only be emitted when a name is requested, but we didn't have a way to track that. Add a `request_name` method on the async context so we can track if a name has been requested in the context (for later use by signal enhancements).
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0abea30e3825d41dedd44de86b8b8bca4edbaf9c
show more ...
|
f2594aa5 | 30-Jan-2024 |
Andrew Jeffery <andrew@codeconstruct.com.au> |
match: Add interfaces{Added,Removed}AtPath()
The signature of the InterfacesAdded and InterfacesRemoved signals is as follows[1]:
``` org.freedesktop.DBus.ObjectManager.InterfacesAdded (OBJPATH obj
match: Add interfaces{Added,Removed}AtPath()
The signature of the InterfacesAdded and InterfacesRemoved signals is as follows[1]:
``` org.freedesktop.DBus.ObjectManager.InterfacesAdded (OBJPATH object_path, ARRAY of DICT_ENTRY<STRING,ARRAY of DICT_ENTRY<STRING,VARIANT>> interfaces_and_properties); org.freedesktop.DBus.ObjectManager.InterfacesRemoved (OBJPATH object_path, ARRAY<STRING> interfaces); ```
The object path of interest forms the first argument of the signal's message body, which is distinct the path specified in the signal's message header. However, the implementation of sdbusplus::bus::match::rules::interfaces{Added,Removed}() match on the header's object path. In the case of these signals, the header path is set to the path of the ObjectManager instance that emitted the signal. This generally results in a failure to deliver signals expected by the callers.
Add new functions `interfacesAddedAtPath()` and `interfacesRemovedAtPath()` that provide matches that are constrained with `argNpath(0, p)`. These align with the signal signature specified above. Use of `argNpath()`` allows the caller to specify whether they wish to match signals from a specific object or a subtree of objects.
Callers of interfacesAdded() providing a path will be migrated on a case-by-case basis.
[1] https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces
Change-Id: Ie2f5125d45eb2dfe500d181016ccc968dd856b77 Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
show more ...
|