Implement org.genivi.BootManager1.Start/Stop
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>
Thu, 14 Jun 2012 09:28:00 +0000 (10:28 +0100)
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>
Fri, 15 Jun 2012 11:13:06 +0000 (12:13 +0100)
commit4502332dfc7f0687ff932340b1af22ce8fc1cbf8
treecde805eea80141fd559680a11fc5449674b9e9c8
parent3871ebfdd38874fc32e70ee6923ff6a13669d7ce
Implement org.genivi.BootManager1.Start/Stop

This commit introduces a fully functional implementation of the
org.genivi.BootManager.Start() and org.genivi.BootManager.Stop()
methods.

It drops the BootManagerJob class and the BootManagerJobType enum type
in favor of a more simple BootManagerServiceJob struct typedef used
internally in BootManagerService.

BootManagerService now has two public methods called
boot_manager_service_start() and boot_manager_service_stop() that
call systemd to start/stop a unit. Both methods create
BootManagerServiceJobs and link them to the name of the corresponding
job created by systemd. Both methods also take callback and user data to
allow the result to be reported back to the caller.

The implementations of "handle-start" and "handle-stop" use the above
methods and report the results back to the GDBusMethodInvocation in
a callback.

Most other methods (e.g. Kill() or Isolate()) can be implemented in
pretty much the same way.

NOTE: systemd-manager-dbus.xml was changed to support an older signature
for the JobRemoved() signal. We will have to change this once we develop
using systemd 183 (where JobRemoved() has an additional unit name
argument).
boot-manager/boot-manager-service.c
boot-manager/boot-manager-service.h
boot-manager/main.c
boot-manager/systemd-manager-dbus.xml