| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The object server currently either creats the objects and interfaces, or
defer the signal by not adding objects.
In practice, we have situations that the code would like to add
interfaces to an existing object, and it's not supported, or needs
tricky code to workaround.
Exmaples:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-bmc-code-mgmt/+/5820
https://gerrit.openbmc-project.xyz/c/openbmc/openpower-pnor-code-mgmt/+/5346
This commit adds the support by:
1. Adding emit_added() in interface.hpp and the generated server.hpp
2. Adding a enum class in object's constructor to indicate which action
to do, to create the object, or adding the interface, or defer signal
as before.
So the user of object<> could pass `action::emit_interface_added` to the
constructor to tell the object server *only* emit interface added to
DBus, without emitting object added.
The previous code stays the same behavior:
* If `true` is passed in object's constructor, it defers emitting object
added signal;
* If no extra parameter is passed in object's constructor, it emits
object added signal as before.
Tested: 1. Make sure the openbmc builds fine with
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-logging/+/25089
because phosphor-logging uses its own server.hpp for interface, the
above patch removes that.
2. Manually write a small service to verify the interfaces are
added and removed by using the `emit_interface_added` action.
3. Added the unit test cases for object.hpp to check the
ctor/dtor with different actions.
Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I178c5bed3c9ff39ee2ac8d143fbe9131b0753dfa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
cppcheck finds an issue:
[sdbusplus/asio/object_server.hpp:46] ->
[sdbusplus/asio/object_server.hpp:315]: (style) The function 'set'
overrides a function in a base class but is not marked with a
'override' specifier.
Fix it by adding the override keyword correctly.
Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: Ie032229874bb416f7c6ec142d9bf38f8ffcff877
|
|
|
|
|
|
|
|
| |
The convert<enum>FromString functions were indented incorrectly
relative to the rest of the class.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Iabe9d30c33c8707bf2bf4c6a697e3d27d0a3000b
|
|
|
|
|
|
|
|
|
| |
Large portions of the codebase were originally written by me
before maintainers existed. I am returning to the project and
plan to do significant enhancements and cleanups to sdbusplus.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I3ac6f6597c78041785ded272d1e6ce8974d5b49a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When running an async operation, it is not a good idea to throw because
the current running context is not the context that it was originally
registered from, it is the io run-loop context. So any methods that
*would* throw, must run in a try/catch and then set the error code
properly so that the handler will be notified of the error.
This was caught when a process (bmcweb) was used to invoke a call that
had a bad path. That was not caught and it caused bmcweb to abort
because of an unhandled exception.
Change-Id: Ie66a029066a3f463759089b44368b7518d0de8ce
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The interface string was private, and the users of sdbusplus have to
define their own strings for the D-Bus interfaces.
By making the interface string public, users do not have to define their
own and the generated string could be used instead.
E.g. one could directly use "Calculator::interface" instead of
"net.poettering.Calculator" in the example.
Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I0846d4e0609c8588d81e8a19bdd69fd79df83848
|
|
|
|
|
|
|
|
|
|
|
| |
Lei has been an active reviewer for sdbusplus, and fixed the CI issue
that has been there for quite a while.
He is willing to become one of the maintainers for sdbusplus, which is
good for speed up the review progress, and for redundancy.
Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I39ec5a1adc0d34c4ce2919a92bd7df463818b9d6
|
|
|
|
|
|
|
|
|
| |
The email address of Deepak is incorrect that does match the one in
gerrit.
Fix it to use the correct one.
Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I0f2cc9bd89f0c2cf232d41018071aeea237cc1fe
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On latest OpenBMC, sdbusplus CI fails due to valgrind check like below
on ppc64le systems:
==5290== Syscall param epoll_ctl(event) points to uninitialised byte(s)
==5290== at 0x4F2FB08: epoll_ctl (syscall-template.S:79)
==5290== by 0x493A8F7: UnknownInlinedFun (sd-event.c:961)
==5290== by 0x493A8F7: sd_event_add_time (sd-event.c:1019)
==5290== by 0x190BB3: phosphor::Timer::Timer(sd_event*, std::function<void ()>) (timer.hpp:62)
==5290== by 0x192B93: TimerTest::TimerTest() (timer.cpp:25)
==5290== by 0x193A13: TimerTest_timerExpiresAfter2seconds_Test::TimerTest_timerExpiresAfter2seconds_Test() (timer.cpp:85)
==5290== by 0x19E11F: testing::internal::TestFactoryImpl<TimerTest_timerExpiresAfter2seconds_Test>::CreateTest() (gtest-internal.h:472)
==5290== by 0x4A52D3B: HandleSehExceptionsInMethodIfSupported<testing::internal::TestFactoryBase, testing::Test*> (gtest.cc:2447)
==5290== by 0x4A52D3B: testing::Test* testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::TestFactoryBase, testing::Test*>(testing::internal::TestFactoryBase*, testing::Test
* (testing::internal::TestFactoryBase::*)(), char const*) (gtest.cc:2483)
==5290== by 0x4A40BCB: Run (gtest.cc:2693)
==5290== by 0x4A40BCB: testing::TestInfo::Run() (gtest.cc:2676)
==5290== by 0x4A40DC3: Run (gtest.cc:2825)
==5290== by 0x4A40DC3: testing::TestCase::Run() (gtest.cc:2810)
==5290== by 0x4A414AF: testing::internal::UnitTestImpl::RunAllTests() (gtest.cc:5216)
==5290== by 0x4A5329B: HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> (gtest.cc:2447)
==5290== by 0x4A5329B: bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::
*)(), char const*) (gtest.cc:2483)
==5290== by 0x4A416AF: testing::UnitTest::Run() (gtest.cc:4824)
==5290== by 0x4A90917: RUN_ALL_TESTS (gtest.h:2370)
==5290== by 0x4A90917: main (gmock_main.cc:69)
==5290== Address 0x1fff00eafc is on thread 1's stack
==5290== in frame #0, created by epoll_ctl (syscall-template.S:78)
==5290==
The root cause is:
1. GCC has a bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77992,
that the padding bytes are not initialized.
2. In systemd, the code in [libsystemd/sd-event/sd-event.c][1] using
epoll_event hit the above bug:
typedef union epoll_data
{
void *ptr;
int fd;
uint32_t u32;
uint64_t u64;
} epoll_data_t;
struct epoll_event
{
uint32_t events; /* Epoll events */
epoll_data_t data; /* User data variable */
} __EPOLL_PACKED;
In glibc, on x86, `__EPOLL_PACKED` is defined as `__attribute__
((__packed__))`[2], so it's packed and there are no internal padding
bytes;
On other architectures (e.g. ppc64le), __EPOLL_PACKED is not defined
and thus there are 4 internal padding bytes between `events` and
`data`, that are not initialized.
3. When epoll_ctl() is invoked, in [Linux kernel][3], it does a
copy_from_user() to copy the whole struct into kernel space. That's
why Valgrind reports "epoll_ctl(event) points to uninitialised
byte(s)", only for non-x86 platforms.
4. The timer test in this repo invokes sd_event_add_time() and
eventually hit the above code.
The GCC bug is not resolved from 2016.
The systemd code is actually correct. There is a [PR][4] sent to systemd
trying to workaround the issue, and it is being discussed.
Before GCC bug is resolved or systemd PR is accepted, suppress the
valgrind error to make it pass the CI.
[1]: https://github.com/systemd/systemd/blob/v242/src/libsystemd/sd-event/sd-event.c#L961
[2]: https://github.com/bminor/glibc/blob/f1a0eb5b6762b315517469da47735c51bde6f4ad/sysdeps/unix/sysv/linux/x86/bits/epoll.h#L29
[3]: https://github.com/torvalds/linux/blob/d1eef1c619749b2a57e514a3fa67d9a516ffa919/fs/eventpoll.c#L2095
[4]: https://github.com/systemd/systemd/pull/14353
Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I3a29fd0e28e5c7b69037a7ef2ef9571f93d80df7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The CI reports failure in VtableTest.SameContent, where the case is
comparing the binary of example vtables constructed from sdbusplus and
macros defined in systemd.
The root cause has two parts.
Part I:
When systemd is updated, the members in struct
sd_bus_vtable is updated, e.g.
* From v239 to v242, sd_bus_vtable.x.start is updated from
struct {
size_t element_size;
} start;
to:
struct {
size_t element_size;
uint64_t features;
} start;
and sd_bus_vtable.x.method is updated from
struct {
const char *member;
const char *signature;
const char *result;
sd_bus_message_handler_t handler;
size_t offset;
} method;
to:
struct {
const char *member;
const char *signature;
const char *result;
sd_bus_message_handler_t handler;
size_t offset;
const char *names;
} method;
* From v242 to v243, sd_bus_vtable.x.start is updated to
struct {
size_t element_size;
uint64_t features;
const unsigned *vtable_format_reference;
} start;
The code in vtable.hpp only assign the members in v239, the new
members are intialized with 0, so it differs from the vtable
constructed from macros defined by systemd.
The fix is to use macros from systemd in vtable.hpp as well,
which is suggested by systemd:
> Please do not initialize this structure directly, use the
> macros below instead
Part II:
The `const char *names` in struct method and signal introduced
between systemd v239 and v242 is a pointer to const strings.
By default they are "empty" strings, but there is no guarantee
that the compiler will use the same pointer for the same string.
So the test case can not assume the binaries are the same for
two vtables even they are constructed with the same parameters.
Update the test case to use real `const char*` and handler/get/set
functions and check each member of the struct instead of comparing the
binary data by memcmp.
Tested: Verify the CI passes.
Change-Id: I9e94ff16075dd3f12d73e96438c0d864203bdcf4
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Real D-Bus error message will not be known through
boost::system::error_code and hence requires message::message
to be forwarded to the caller, through which any D-Bus error
message can be read from the sd_bus_error of the message::message.
Tested:
Added the template for the same, and cross verified with
async_method_call, of which handler will accept both error_code
& message::message as argument
Change-Id: I7ecace1fb880a303dd487fa9de85c043db3413f8
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
| |
We should only coalesce to an r-value reference to our internal string if our
object is a move reference. This fixes ambiguous overloads with gcc9.
This also ensures that const references cannot be ambiguous with move
references by requiring a const volatile reference.
Change-Id: I31ed529c015cc311c9933acbc0f0a4aa50fed3a6
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Add message::get_error() to get sd_bus_error from a message.
Tested: Verify the function is added, the build passes, and the user of
sdbusplus is able to call message::get_error() to get the
const sd_bus_error* pointer.
Change-Id: If4c413316ff7654448e9da19adcd3dab2c33675e
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are many cases in which we want to have a mutable
capture so that the lambda takes over the parameter and
we can modify it after the async callback. By making the
top level lambda mutable, the users callback can be mutable.
Also remove a couple references to experimental and a copy
that I saw when I was fixing this issue.
Tested: Added test and made sure that refish which uses
many async_method_calls still worked fine
Change-Id: Ifb1f9d8b9217187799e2defe429e76a937297ca1
Signed-off-by: James Feist <james.feist@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Objects don't take kwargs for their constructors so don't call the
object constructor with kwargs
```
| Traceback (most recent call last):
| File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/bin/sdbus++", line 50, in <module>
| main()
| File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/bin/sdbus++", line 45, in main
| instance = valid_types[args.typeName].load(args.item, args.rootdir)
| File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/lib/python2.7/site-packages/sdbusplus/interface.py", line 21, in load
| return Interface(**y)
| File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/lib/python2.7/site-packages/sdbusplus/interface.py", line 25, in __init__
| [Property(**p) for p in kwargs.pop('properties', [])]
| File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/lib/python2.7/site-packages/sdbusplus/property.py", line 12, in __init__
| super(Property, self).__init__(**kwargs)
| File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/lib/python2.7/site-packages/sdbusplus/namedelement.py", line 8, in __init__
| super(NamedElement, self).__init__(**kwargs)
| File "/home/spirit/src/vesnin/openbmc-alternate/build/tmp/work/armv5e-openbmc-linux-gnueabi/phosphor-dbus-interfaces/1.0-r1/recipe-sysroot-native/usr/lib/python2.7/site-packages/sdbusplus/renderer.py", line 3, in __init__
| super(Renderer, self).__init__(**kwargs)
| TypeError: object.__init__() takes no parameters
```
Fixes openbmc/sdbusplus#30
Tested:
Ran with some locally modified properties marked as const. Verified
that the generated code marks those as const and removes their
setter
Change-Id: I94965add8588a8a3168662e00ef2502276440ee5
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
| |
This breaks unit testing if we try and mock out the creation of method
replies and errors since it will try and use the default implementation
instead of the one provided to the initial message or bus.
Change-Id: I700bef0bae9a8a371ec0121f8115acd30aee5220
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The async_method_call() would throw despite the inferred promise that it
would not, because the handler would be passed an error_code object. But
that would only protect from the dbus method call itself. When it came
time to unpack the response, the read_into_tuple(...) method call would
throw if the received types did not match the expected types. And
because this throw would happen in a separate boost::asio context, the
throw would always be fatal. Now, any exception during the D-Bus call or
unpacking of parameters will result in an error_code getting passed into
the handler so it can take appropriate action.
This also updates the example to remove try/catch statements around the
async_method_call and yield_method_call examples and shows what happens
if the method calls fail because of different types of errors
(api/function does not exist vs. incorrect unpack types).
Tested-by: run asio-example to see that it works as expected:
# /tmp/asio-example
voidBar() -> 42
fooYield(yield, 41)...
async_send callback
error with async_send
ipmiInterface:execute(61)
async_method_call callback
/org/openbmc/control/bmc0
/org/openbmc/control/flash/bmc
fooYield(yield, 41)...
ipmi call returns OK!
foo(41) -> 42
async_method_call callback
async_method_call expected failure: generic:foo(41) -> 42
yielding call to foo OK! (-> 42)
22
async call to Properties.Get serialized via yield OK!
TestYieldFunction return 42
yielding call to foo OK! (-> 42)
yielding call to TestYieldFunction serialized via yield OK!
fooYield(yield, 41)...
foo(41) -> 42
async call to Properties.Get serialized via yield OK!
yielding call to foo OK! (-> 42)
TestYieldFunction expected error: generic:22
TestYieldFunctionNotExits expected error: generic:53
*** tick ***
*** tock ***
*** tick ***
*** tick ***
*** tick ***
Change-Id: I53c91484ed496556342b3ed0a58b690872a2d676
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
stuff
Change-Id: I48da27be7ba8c63f44c12a8b79fffb8f3e085648
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
| |
I added the incorrect email address to the MAINTAINERS file which causes
script errors because that email is not part of any github groups. This
updates it to use the correct email.
Change-Id: I63393b0d96fdf9c73f0038c0776e0db691cb0fd8
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The yield_method_call() would throw despite the inferred promise that it
would not, because the caller could attach an error_code to the yield
object. But that would only protect from the dbus method call itself.
When it came time to unpack the response, the read(...) method call
would throw if the received types did not match the expected types. Now,
the method forces you to pass in an error_code and it will always return
the appropriate error instead of throw.
Tested-by: run asio-example to see that it works as expected:
# /tmp/asio-example
voidBar() -> 42
async_send callback
error with async_send
async_method_call callback
/org/openbmc/control/bmc0
/org/openbmc/control/flash/bmc
fooYield(yield, 41)...
ipmiInterface:execute(61)
ipmi call returns OK!
fooYield(yield, 41)...
foo(41) -> 42
async call to Properties.Get serialized via yield OK!
foo(41) -> 42
yielding call to foo OK! (-> 42)
TestYieldFunction return 42
yielding call to foo OK! (-> 42)
yielding call to TestYieldFunction serialized via yield OK!
async call to Properties.Get serialized via yield OK!
*** tick ***
*** tock ***
*** tick ***
*** tick ***
*** tick ***
*** tick ***
*** tick ***
Change-Id: Iea43acd432107b4149f8e549310cfce2518cbc1d
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
| |
Vernon has been an active reviewer gerrit for sdbusplus commits as well
as submitting a small pile of commits himself. Also, having more than
one maintainer for a project is good for redundancy. Vernon threw his
hat in the ring and William OK'd it.
Change-Id: I4ee8612493c394ad8cdec68e73e9a3d9bf9d4b45
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Now that we are using std::variant we should reference it directly
instead of using our own namespace alias.
Tested:
Built and ran through unit tests.
Change-Id: Ic3fd62ea74cf808b85ad7b7ffcce8c0a0bfb125d
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
| |
It is common for enums to be shared across different dbus definitions.
This change adds the functionality to automatically generate the correct
includes for the server.hpp files.
Change-Id: Ic5b8df55b58479d18dd4aee20ead9c05b867b968
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
| |
This allows for a future change that adds includes to the generated
server.hpp file that it needs for enum definitions.
Change-Id: Id8ecd03a8cc1155cc9032840f38bf5ccb28d40c0
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
| |
This allows the signal generator to emit include directives
Change-Id: I47a13102491116772c31b57ca58824fda3612938
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When compiled with clang (or possibly gcc with the right warnings
enabled) sdbusplus throws warnings on bus and slot, because the forward
declaration declares them as class, when they are in fact struct when
they're finally defined.
This commit resolves the declarations to match their actual definitions,
and resolves the warning.
Tested By:
Compiled bmcweb with clang, -Wall and -Werror, and compile succeeded
Change-Id: Id594669d21a296c65ee2b96f3502e692e451da4c
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
async_result is required to be able to support boost 1.70. This commit
moves us to it.
Tested:
Compiled. Changes are non-functional, and simply renamed in newer
versions of asio.
Change-Id: I46728dc146c4c49eff7907c6aa8bc1525eca5cc2
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
InterfacesAdded signal itself will send out all propety
details and it's values during start-up of a D-Bus daemon service.
Sending properties changed signal confuses the signal handler
as it can't differentiate between service restart or real
property change event. Exposing a way to skip sending
properties changed signal during initialize (to avoid
breaking any old one).
Tested-by:
1. Verified that when initialize(true) is called, properties
changed signal are not sent out from D-Bus daemon
2. Still old method works fine.
Change-Id: Ib436ea9313b08623d931c58b11a770081511ab72
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
|
|
|
|
|
|
|
|
|
| |
The code coverage macros from the archive changed in a backward
incompatible way. This adds a workaround to autodetect either version
and do the right thing.
Change-Id: Ibb95188264f3fece4a18dbcb98f3e90f8350ff21
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
| |
Tested:
Builds and runs unit tests as expected.
Additionally ran against all of the package in openbmc/* and
produced no fallout as expected.
Change-Id: Id9e9a33c789666869dd0a47c065d113acb2ceea5
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
| |
The underlying sd_event checks to see that the file descriptor is good
before calling close, so if the sd_event_wrapper closes the descriptor
first, sd_event calls assert(). The release() mechanism allows the
sd_event to close out the descriptor on its own.
Change-Id: Icb8ca5ba909478361a90253713a425256556d140
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
| |
This allows implicit conversions from int to unix_fd. This is for
instance useful in functions where one wants to return an unix_fd by
just supplying the actual int file descriptor.
Change-Id: I118b8ec6b5a3d1533f5b05177127c28ad2539f3d
Signed-off-by: Waqar Hameed <waqarh@axis.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Different capabilities are supported depending on if an interface
has been initialized (e.g. register_property is only available before
initialization and set_property is only available after).
This change adds a method to check if an interface has been initialized
to help determine which capabilities are currently supported.
Tested: Ran a module that uses register_property and set_property based
on this return value and confirmed that the properties are set
accordingly.
Change-Id: Iac39887f5d92981a316d1046f2f3d3ab71d15878
Signed-off-by: Jason M. Bills <jason.m.bills@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For properties of type string, allow a default value to be set for the
property on the interface. This provides the ability to have a default
value to an intended free-form string instead of using enumerated
values.
Tested:
Verified generated interface object initializes a string property
to a default value
Only properties of type string with a default defined are initialized
with the given default value as a string
Change-Id: I1e75dff1c26a4a872e9e3e7959106470c32c9be7
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For asio based registration, ObjectManager's are created
under "/" folder. This makes dynamic detection difficult based
on the service root object path. Updated library to skip
ObjectManager creation, which can be created separately
by the needed daemon under the root object base path
This is needed, as dynamic detection of service name
can be performed on org.freedeskop.DBus.ObjectManager interface
when the root object doesn't have any interfaces.
Unit-test:
1. Verified it is compiling, and compatibile with existing code
2. Verified that ObjectManager is under the needed base path
when argument passed from service daemon.
3. Able to find service name using GetObject under objectMapper,
when service daemon, doens't have any other interface in root
base path other than org.freedesktop.DBus.Manager
Change-Id: Ie1ddf62df0df3849fc761995813c97872d96eb33
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 8192be92b9bf50450eb309a8798b3895bfdae471.
The commit "Fix incorrect defaultValue in generated server.hpp" revealed
an issue in phosphor-dbus-interfaces that causes the build error, and it
was reverted temporarily.
The issue is fixed in phosphor-dbus-interface, so we could add it back.
Change-Id: I1700ff1ede5f0eedc11fc324f649ea4f2e76edf5
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we have multiple code segments in the same thread acquiring the
default bus, we end up with the potential for one of those handles to be
destroyed, calling sd_event_flush_close_unref(). This terminates the bus
for all users of the same reference. Any of the reference which still
exist after the first destroy will then return ENOTCONN for all bus
operations since it is now closed. This behavior is undesirable as we
expect to be able to have transient bus references.
However, we do want to make sure we clean up any buses created by
sd_bus_open().
See openbmc/phosphor-time-manager@4e84539349dac086ce2a58e5b9900ed4e40a2eaf
for a specific example of this behavior being unwanted.
Change-Id: I8aad7e282e9d66993b63e85532dce37c179ad5dc
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
| |
Change-Id: I8181dc8932353e8f37da9fab168f34f214d222c0
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The intent of this commit is to allow building asio based event loops in
applications with BOOST_ASIO_NO_DEPRECATED flag set. This change is
largely a sed replace of io_service with io_context.
This will allow us to move to the networking TS at such time that it is
mature. Details on depreated interfaces are available here for
reference:
https://www.boost.org/doc/libs/1_69_0/doc/html/boost_asio/net_ts.html
Change-Id: Ie3cc699effcf855a649dee5bfce2f6616109429b
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
|
|
|
|
|
| |
Change-Id: I2d1402c38b7b8b39cee42f959a0421b24a80e45d
Signed-off-by: Waqar Hameed <waqarh@axis.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 14269fbcc15fd0e764f672de144d44e8ee26dd78.
This caused the following compile failure in phosphor-dbus-interfaces:
16:52:02 make[1]: Entering directory '/phosphor-dbus-interfaces-99b5aaa499c2f1a71a031051136744ad1e7df869'
16:52:02 CXX libphosphor_dbus_la-libphosphor_dbus.lo
16:52:05 In file included from libphosphor_dbus.cpp:16151:0:
16:52:05 ./xyz/openbmc_project/User/Ldap/Config/server.hpp:195:53: error: expected unqualified-id before numeric constant
16:52:05 SearchScope _lDAPSearchScope = SearchScope::0;
16:52:05 ^
16:52:05 make[1]: *** [libphosphor_dbus_la-libphosphor_dbus.lo] Error 1
16:52:08 make: *** [all] Error 2
Change-Id: Ie4c2f99d08b96845da86634ad73b9c8af56b656c
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In property.py, the defaultValue is got from yaml and it could be
string, bool, or numeric.
In case of bool, the value becomes True/False, and when it is rendered
in C++ code, the code will not compile due to C++ expects true/false
instead.
And in server.hpp template, it checks "if p.defaultValue", and if the
default value is "false" or 0, p.defaultValue becomes False, so the
generated C++ code will not have default value.
For example, a var defined in yaml has below default value:
default: true
default: false
default: 0
will be rendered in C++ code as:
var = True;
var{};
var{};
This commit fixes the issue by converting defaultValue from True/False
to true/false string, and check if by "if p.defaultValue is not None".
Tested: Verify the above exmaple will generate valid C++ code as below:
var = true;
var = false;
var = 0;
Change-Id: I65c9f5222aa2d7b53299a53ff63d33bd6d073b95
Signed-off-by: Lei YU <mine260309@gmail.com>
|
|
|
|
|
|
|
|
|
| |
This change exposes explicit flush and close operations on the bus for
users who require bus termination at a specific checkpoint instead of
program termination.
Change-Id: I0e2edce8586956ab286d75d1eb13eeca4309e370
Signed-off-by: William A. Kennington III <wak@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Set property has to send out signal only when there is
change in the property and skipped when there is no change
but still must return true for the set method accordingly
Unit test:
Using busctl monitor match rule, monitored the properties changed
of sensors (which uses asio logic) and verified by updating
the value with same & different one, and observed both the return
(success) and the properties changed signal generated only when
there is changed in the property value as expected.
Change-Id: I79be5b29f496109c19e415cdcfff89af76693de5
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After the below change in sdbusplus,
the variant usage needs to be switched to std::variant
https://github.com/openbmc/sdbusplus/commit/90778b430290c9ec8c33fb77b03e2552d9dd6905
Tested:
./configure --enable-boost
make
Change-Id: Ic1d156ad379eb56822f75e8046f83fa45f4ad56d
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow the bus deleter to be routed to a real or mock implementation.
Also prevents link errors such as:
sysroots/i586-openbmc-linux/usr/include/sdbusplus/bus.hpp:68: undefined reference to `sd_bus_unref'
when libsystemd is not linked in.
Unit tests still pass and a Witherspoon system QEMU instance still
boots to a shell.
Change-Id: If498076ddc28acf166c9dab0502f7e209d6e1f2d
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
|
|
| |
There are currently direct calls to this - add an interface, impl and
mock - so calls can be routed accordingly.
Unit tests still pass with this patch applied.
Change-Id: I881fedf62d957f6a87b11ab1e35cacbb9402ffa4
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
| |
Change-Id: Iadd0601a9d621fcf27c12112af7d38f5e35e593b
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
|
|
|
|
|
|
|
|
| |
The documentation says that the default bus calls are the ones to use
instead of the open bus calls to reduce resources.
Change-Id: I719494adf2e97e94bb5a9925064cda6cfdd28047
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds new functions:
* new_default_user() -> return default user bus connection
* new_default_system() -> returns default system connection
And changes new_default() to return the default type of connection for
the user as per the man page:
https://www.freedesktop.org/software/systemd/man/sd_bus_default.html
Also, update the example and the README to use the default bus calls.
Change-Id: I13cd77dda847c4f6018da38e0019816da07710d1
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
|
|
|
|
|
|
|
|
|
|
| |
Signaling a property in an non-initialized interface
causes a segfault.
Testedy-by: Verified segfault went away.
Change-Id: Ib48510e761fb69667040351056853a470c5a9a9f
Signed-off-by: James Feist <james.feist@linux.intel.com>
|