Comments (4)
Sorry, not sure I follow:
As the properties are being listed a method belonging to the Pool interface is invoked.
Exactly how is that method invoked? Calling GetManagedObjects should just list properties, not invoke (other) methods.
from dbus-rs.
The property is implemented by means of a method:
let uuid_property = f.property::<&str, _>("Uuid", ())
.access(Access::Read)
.emits_changed(EmitsChangedSignal::Const)
.on_get(get_pool_uuid);
and
let object_path = f.object_path(object_name, dbus_context.clone())
.introspectable()
.add(f.interface(interface_name, ())
.add_m(create_filesystems_method)
.add_m(destroy_filesystems_method)
.add_m(add_cache_devs_method)
.add_m(remove_cache_devs_method)
.add_m(add_devs_method)
.add_m(remove_devs_method)
.add_m(rename_method)
.add_p(name_property)
.add_p(uuid_property));
and
fn get_pool_uuid(i: &mut IterAppend, p: &PropInfo<MTFn<TData>, TData>) -> Result<(), MethodErr> {
let dbus_context = p.path.get_data();
let object_path = p.path.get_name();
let pools = dbus_context.pools.borrow();
let name = try!(pools.get_by_first(object_path as &str)
.ok_or(MethodErr::failed(&format!("no name for pool with object path {}", object_path))));
...
Currently the MethodError above is emitted when GetManagedObjects()
is called, but not when the property is obtained directly from the pool.
The sequence below is:
- Call GetManagedObjects() with success.
- Create a Pool object.
- Call GetManagedObjects() with failure.
- Get the property directly from the pool with success.
[mulhern@dhcp-25-209 stratisd]$ busctl --user call org.storage.stratis1 /org/storage/stratis1 org.freedesktop.DBus.ObjectManager GetManagedObjects
a{oa{sa{sv}}} 1 "/org/storage/stratis1" 4 "org.freedesktop.DBus.Introspectable" 0 "org.freedesktop.DBus.ObjectManager" 0 "org.freedesktop.DBus.Properties" 0 "org.storage.stratis1.Manager" 3 "ErrorValues" a(sq) 17 "OK" 0 "ERROR" 1 "ALREADY_EXISTS" 2 "BAD_PARAM" 3 "BUSY" 4 "CACHE_NOTFOUND" 5 "DEV_NOTFOUND" 6 "FILESYSTEM_NOTFOUND" 7 "IO_ERROR" 8 "LIST_FAILURE" 9 "INTERNAL_ERROR" 10 "NIX_ERROR" 11 "NO_POOLS" 12 "NOTFOUND" 13 "NULL" 14 "NULL_NAME" 15 "POOL_NOTFOUND" 16 "RedundancyValues" a(sq) 1 "NONE" 0 "Version" s "0.1.0"
[mulhern@dhcp-25-209 stratisd]$ busctl --user call org.storage.stratis1 /org/storage/stratis1 org.storage.stratis1.Manager CreatePool "s(bq)bas" "deadpool" false 0 false 1 /dev/sdl
(oas)qs "/org/storage/stratis1/1" 1 "/dev/sdl"0 "Ok"
[mulhern@dhcp-25-209 stratisd]$ busctl --user call org.storage.stratis1 /org/storage/stratis1 org.freedesktop.DBus.ObjectManager GetManagedObjects
no name for pool with object path /org/storage/stratis1
[mulhern@dhcp-25-209 stratisd]$ busctl --user get-property org.storage.stratis1 /org/storage/stratis1/1 org.storage.stratis1.pool Uuid
s "2c19bce95dbf4b40b10212e408629af0
from dbus-rs.
Thanks, now I get it. I just pushed a commit to master, could you see if it fixes the issue?
from dbus-rs.
Confirmed, thanks!
from dbus-rs.
Related Issues (20)
- Crossroad example not working HOT 1
- `vendored` feature's build script writes outside of `$OUT_DIR` HOT 5
- async monitor? HOT 4
- monitor system bus without root privileges HOT 4
- [Help] When variant is a struct? HOT 10
- dbus-codegen: When crossroads is enabled, no client-side code is generated HOT 3
- dbus-codegen: Add attribute to specify rust type for method arguments HOT 4
- Annotations on interfaces not shown in introspection
- Any way to set uid in dbus authentication? HOT 6
- How to ensure that libdbus-sys compiles with X11 for dbus-daemon autolaunch on build HOT 4
- register object of type X on dbus? HOT 3
- pkg config failed HOT 1
- Async signal match not working HOT 2
- `dbus-codegen-rust` produces `#[deprecated]` annotations on trait implementations HOT 1
- Yank rbus-rs package on crates.io HOT 1
- Generated code from an XML file that only contains properties does not compile with crossroads HOT 4
- Make new `dbus-codegen` release
- Recompilation of libdbus-sys triggered on every cargo build HOT 2
- "Path, Interface, or Method does not exist" on startup HOT 2
- Could `from_slice_unchecked` be made `const` for the string types?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbus-rs.