summaryrefslogtreecommitdiff
path: root/src/core/job.h
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-04-20 12:28:31 +0200
committerMichal Schmidt <mschmidt@redhat.com>2012-04-20 17:12:29 +0200
commit97e6a11996855800f68dc41c13537784198c8b61 (patch)
treedf381f8225930b5adf0526d8a0a7987039b72c43 /src/core/job.h
parentd6a093d098054b6fe866441251ad9485c9e31584 (diff)
dbus-job: allow multiple bus clients
Merging of jobs can result in more than one client being interested in a job.
Diffstat (limited to 'src/core/job.h')
-rw-r--r--src/core/job.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/core/job.h b/src/core/job.h
index 3acf7a25a7..e869856d37 100644
--- a/src/core/job.h
+++ b/src/core/job.h
@@ -28,6 +28,7 @@
typedef struct Job Job;
typedef struct JobDependency JobDependency;
+typedef struct JobBusClient JobBusClient;
typedef enum JobType JobType;
typedef enum JobState JobState;
typedef enum JobMode JobMode;
@@ -99,6 +100,13 @@ struct JobDependency {
bool conflicts;
};
+struct JobBusClient {
+ LIST_FIELDS(JobBusClient, client);
+ /* Note that this bus object is not ref counted here. */
+ DBusConnection *bus;
+ char name[0];
+};
+
struct Job {
Manager *manager;
Unit *unit;
@@ -121,9 +129,8 @@ struct Job {
Watch timer_watch;
- /* Note that this bus object is not ref counted here. */
- DBusConnection *bus;
- char *bus_client;
+ /* There can be more than one client, because of job merging. */
+ LIST_HEAD(JobBusClient, bus_client_list);
JobResult result;
@@ -136,6 +143,8 @@ struct Job {
bool ignore_order:1;
};
+JobBusClient* job_bus_client_new(DBusConnection *connection, const char *name);
+
Job* job_new(Unit *unit, JobType type);
void job_free(Job *job);
Job* job_install(Job *j);