-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
krun: create context after loading the library #1695
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
You may want to remove this variable as its not used:
|
This wonderful warning has actually detected a bug. I was always using the same ctx_id for both krun and krun-sev. This works because they happen to return the same integer, but was wrong. I've just fixed it, thanks! |
No problems! In the future, please keep an eye on the osh-diff-scan check in the CI. |
3586302
to
a80c2e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
LGTM
@eriksjolund PTAL, if you are fine with the new version, I'll merge it |
src/libcrun/handlers/krun.c
Outdated
|
||
krun_create_ctx = dlsym (handle, "krun_create_ctx"); | ||
if (krun_create_ctx == NULL) | ||
return crun_make_error (err, 0, "could not find symbol in `libkrun.so`"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libkrun.so
might sometimes be libkrun-sev.so
in the error message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be reasonable to remove the .so
to avoid inferring we're talking about that specific library, or do we need it to point to the right library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just change the error message in the krun library
, or something like that
Newer versions of libkrun no longer link against libkrunfw (the library bundling the kernel) and, instead, they load it dynamically when creating the context. This implies we need to call krun_create_ctx ealier, before switching namespaces, or libkrun won't be able to find libkrunfw. Signed-off-by: Sergio Lopez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
lgtm |
Newer versions of libkrun no longer link against libkrunfw (the library bundling the kernel) and, instead, they load it dynamically when creating the context.
This implies we need to call krun_create_ctx ealier, before switching namespaces, or libkrun won't be able to find libkrunfw.