[systemd-devel] systemd version debus call changed

Àlex Fiestas afiestas at kde.org
Mon Mar 3 05:28:07 PST 2014


On Friday 28 February 2014 02:28:20 Lennart Poettering wrote:
> On Fri, 28.02.14 02:21, Timothée Ravier (siosm99 at gmail.com) wrote:
> > On 26/02/2014 02:38, Lennart Poettering wrote:
> > > On Wed, 26.02.14 02:01, Jason A. Donenfeld (Jason at zx2c4.com) wrote:
> > >> Upstream KDE patch is here:
> > >> https://projects.kde.org/projects/kde/kde-workspace/repository/revision
> > >> s/7584a63924620bac3bd87277c11cdb8cdb5018b1/diff/powerdevil/daemon/backe
> > >> nds/upower/powerdevilupowerbackend.cpp?format=diff> > 
> > > Wow. Just wow. I am feeling tempted to just randomly change the version
> > > string exposed on the bus now, until they give that up. Whate else can I
> > > do than actually document that the string isn't stable?
> > > 
> > > It is totally non-sensical to check for software versions the way KDE
> > > does it. We supply them with a call to check whether a certain operation
> > > is available (CanSuspend(), CanHibernate(), ...). They should just call
> > > that. It will tell them precisely whether the operation is not
> > > implemented in the code, or whether it is available on the hardware, and
> > > so on. But no, they decided to involve version checks...
> > 
> > It looks like they check both systemd version and CanSuspend(),
> > CanHibernate() results:
> > https://projects.kde.org/projects/kde/kde-workspace/repository/revisions/m
> > aster/entry/powerdevil/daemon/backends/upower/powerdevilupowerbackend.cpp#
> > L229
> > 
> > Could it be for compatibility with older systemd releases?
> 
> They should just invoke the methods. If they get
> org.freedesktop.DBus.Error.UnknownMethod,
> org.freedesktop.DBus.Error.UnknownObject or
> org.freedesktop.DBus.Error.UnknownInterface back they should assume that
> logind is too old and doesn't support the call. (Actually, to make this
> really robust, they should just treat any error like that).
> 
> Check for features by trying to make use of them. Don't check for
> version numbers.
The problem was that long ago logind supported suspend (methods were in the 
bus) but they did not work, at least not for opensuse so that work around was 
added.

This code will certainly die in the near future.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140303/92a6281b/attachment.pgp>


More information about the systemd-devel mailing list