`systemctl show UNIT -p ActiveState -p UnitFileState` currently calls:

`org.freedesktop.DBus.Properties.GetAll("")`



PID 1 therefore generates and serializes properties from every interface, while 
systemctl discards everything except the requested properties.

The standard D-Bus Properties interface supports either one property with 
`Get()` or all properties of an interface with `GetAll()`. It has no operation 
for retrieving several selected properties in one call.



I want to add a new D-Bus method to request  only specific properties, like:

`GetUnitProperties(unit, ["ActiveState", "UnitFileState"]) -> {"ActiveState": 
..., "UnitFileState": ...}`



Another possible location would be a method on the unit object itself:



`GetProperties(["ActiveState", "UnitFileState"]) → a{sv}`



This would allow `systemctl show -p ...` to avoid generating unrelated 
properties while preserving a single D-Bus round trip.

Would such an API be appropriate? I understand that the longer-term direction 
may be Varlink, but this question concerns optimizing the existing D-Bus 
interface and clients that continue to use it.



Thank you,

Roman Perehonchuk

Reply via email to