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:
Philip Withnall
2026-06-26 10:54:10 +01:00
parent 7f3c27128b
commit 49cf024c0b
2 changed files with 77 additions and 108 deletions
+3
View File
@@ -7,6 +7,9 @@
typedef struct Context {
char *component;
LoopDevice *loop_device;
char *mounted_dir;
Transfer **transfers;
size_t n_transfers;