Skip to content

Commit 97fc364

Browse files
committed
krun: return dlerror string when library is not found
krun returns incomplete error without this patch which is difficult to debug ```console Error: OCI runtime error: /home/crun/krun: failed to open library `libkrun.so.1` and `libkrun-sev.so.1` for krun_config ``` after patch ```console Error: /home/ar/work/crun/krun: failed to open library `libkrun.so.1` and `libkrun-sev.so.1` for krun_config: libkrun-sev.so.1: cannot open shared object file: No such file or directory: OCI runtime attempted to invoke a command that was not found ``` Signed-off-by: flouthoc <flouthoc.git@gmail.com>
1 parent 9186684 commit 97fc364

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcrun/handlers/krun.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ libkrun_load (void **cookie, libcrun_error_t *err)
426426
if (kconf->handle == NULL && kconf->handle_sev == NULL)
427427
{
428428
free (kconf);
429-
return crun_make_error (err, 0, "failed to open `%s` and `%s` for krun_config", libkrun_so, libkrun_sev_so);
429+
return crun_make_error (err, 0, "failed to open `%s` and `%s` for krun_config: %s", libkrun_so, libkrun_sev_so, dlerror());
430430
}
431431

432432
kconf->sev = false;

0 commit comments

Comments
 (0)