1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
4 typedef struct Transaction Transaction
;
12 /* Jobs to be added */
13 Hashmap
*jobs
; /* Unit object => Job object list 1:1 */
14 Job
*anchor_job
; /* the job the user asked for */
18 Transaction
*transaction_new(bool irreversible
);
19 Transaction
*transaction_free(Transaction
*tr
);
20 Transaction
*transaction_abort_and_free(Transaction
*tr
);
21 DEFINE_TRIVIAL_CLEANUP_FUNC(Transaction
*, transaction_abort_and_free
);
23 typedef enum TransactionAddFlags
{
24 TRANSACTION_MATTERS
= 1 << 0,
25 TRANSACTION_CONFLICTS
= 1 << 1,
26 TRANSACTION_IGNORE_REQUIREMENTS
= 1 << 2,
27 TRANSACTION_IGNORE_ORDER
= 1 << 3,
29 /* Propagate a START job to other units like a RESTART */
30 TRANSACTION_PROPAGATE_START_AS_RESTART
= 1 << 4,
32 /* Indicate that we're in the recursion for processing UNIT_ATOM_PROPAGATE_STOP_GRACEFUL units */
33 TRANSACTION_PROCESS_PROPAGATE_STOP_GRACEFUL
= 1 << 5,
34 } TransactionAddFlags
;
36 void transaction_add_propagate_reload_jobs(
39 TransactionAddFlags flags
);
41 int transaction_add_job_and_dependencies(
46 TransactionAddFlags flags
,
49 int transaction_activate(Transaction
*tr
, Manager
*m
, JobMode mode
, Set
*affected
, sd_bus_error
*e
);
50 int transaction_add_isolate_jobs(Transaction
*tr
, Manager
*m
);
51 int transaction_add_triggering_jobs(Transaction
*tr
, Unit
*u
);