kernel-image: minor refactoring to inspect_kernel()
Let's add make three arguments optional, by splitting inspect_kernel() from inspect_kernel_full(). Let's also downgrade logging to debug, so that this becomes more library-like. Let's log on the call-site instead.
This commit is contained in:
committed by
Lennart Poettering
parent
025762516f
commit
d90d0a1f63
@@ -750,12 +750,21 @@ static int context_from_cmdline(Context *c, Action action) {
|
||||
}
|
||||
|
||||
static int context_inspect_kernel(Context *c) {
|
||||
int r;
|
||||
|
||||
assert(c);
|
||||
|
||||
if (!c->kernel)
|
||||
return 0;
|
||||
|
||||
return inspect_kernel(c->rfd, c->kernel, &c->kernel_image_type, NULL, NULL, NULL);
|
||||
r = inspect_kernel(
|
||||
c->rfd,
|
||||
c->kernel,
|
||||
&c->kernel_image_type);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to inspect kernel image '%s': %m", c->kernel);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int context_ensure_layout(Context *c) {
|
||||
|
||||
Reference in New Issue
Block a user