sysupdate: Factor process_image() into context_make_{offline,online}()
`process_image()` is always called immediately before (almost) every `context_make_online()` or `context_make_offline()`, and the structures it allocates have the same lifetime as `Context`, so we might as well factor them all together to reduce duplication. This will also simplify the following commit, which changes heap allocation of `Context`s, and simplify upcoming changes to factor out `arg_*` handling. The call in `verb_pending_or_reboot()` is safe because it already validates that `arg_image` is `NULL`, hence `process_image()` will bail out early. This introduces no functional changes.
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
typedef struct Context {
|
||||
char *component;
|
||||
|
||||
LoopDevice *loop_device;
|
||||
char *mounted_dir;
|
||||
|
||||
Transfer **transfers;
|
||||
size_t n_transfers;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user