sysupdate: Factor context creation out of installdb_cleanup_component()
This makes it like all the other verbs and therefore easier to refactor. At the same time, remove the separate `component` argument and instead use the `component` set on the `Context`. This guards against bugs, as various parts of the `Context` state depend on the component (for example, `installdb_fd`) and overriding the component without also overriding its dependent variables will lead to bugs.
This commit is contained in:
@@ -28,13 +28,6 @@ typedef struct Context {
|
||||
Context* context_free(Context *c);
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(Context*, context_free);
|
||||
|
||||
typedef enum ReadDefinitionsFlags {
|
||||
READ_DEFINITIONS_REQUIRES_ENABLED_TRANSFERS = 1 << 0,
|
||||
READ_DEFINITIONS_REQUIRES_ANY_TRANSFERS = 1 << 1,
|
||||
} ReadDefinitionsFlags;
|
||||
|
||||
int context_make_offline(Context **ret, const char *node, const char *component, ReadDefinitionsFlags read_definitions_flags);
|
||||
|
||||
extern bool arg_sync;
|
||||
extern uint64_t arg_instances_max;
|
||||
extern char *arg_root;
|
||||
|
||||
Reference in New Issue
Block a user