summaryrefslogtreecommitdiffstats
path: root/job.c
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito2022-09-26 11:31:56 +0200
committerKevin Wolf2022-10-07 12:11:41 +0200
commit544f4d5258d4e4dd6652d28607b605e7801ed7dd (patch)
tree0cdae0f4667f7b4ec4de2bb7619c7b7471e93fba /job.c
parentjob.h: categorize fields in struct Job (diff)
downloadqemu-544f4d5258d4e4dd6652d28607b605e7801ed7dd.tar.gz
qemu-544f4d5258d4e4dd6652d28607b605e7801ed7dd.tar.xz
qemu-544f4d5258d4e4dd6652d28607b605e7801ed7dd.zip
job.c: API functions not used outside should be static
job_event_* functions can all be static, as they are not used outside job.c. Same applies for job_txn_add_job(). Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20220926093214.506243-4-eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'job.c')
-rw-r--r--job.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/job.c b/job.c
index 7365db827a..9500b5b36e 100644
--- a/job.c
+++ b/job.c
@@ -125,7 +125,17 @@ void job_txn_unref(JobTxn *txn)
}
}
-void job_txn_add_job(JobTxn *txn, Job *job)
+/**
+ * @txn: The transaction (may be NULL)
+ * @job: Job to add to the transaction
+ *
+ * Add @job to the transaction. The @job must not already be in a transaction.
+ * The caller must call either job_txn_unref() or job_completed() to release
+ * the reference that is automatically grabbed here.
+ *
+ * If @txn is NULL, the function does nothing.
+ */
+static void job_txn_add_job(JobTxn *txn, Job *job)
{
if (!txn) {
return;
@@ -427,12 +437,18 @@ void job_progress_increase_remaining(Job *job, uint64_t delta)
progress_increase_remaining(&job->progress, delta);
}
-void job_event_cancelled(Job *job)
+/**
+ * To be called when a cancelled job is finalised.
+ */
+static void job_event_cancelled(Job *job)
{
notifier_list_notify(&job->on_finalize_cancelled, job);
}
-void job_event_completed(Job *job)
+/**
+ * To be called when a successfully completed job is finalised.
+ */
+static void job_event_completed(Job *job)
{
notifier_list_notify(&job->on_finalize_completed, job);
}