-
Notifications
You must be signed in to change notification settings - Fork 584
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
images/inventory: add field for enabled plugins #2489
base: criu-dev
Are you sure you want to change the base?
Conversation
ecd6f4e
to
e17069d
Compare
e17069d
to
669e8a1
Compare
0d79239
to
278c174
Compare
278c174
to
0caf28f
Compare
This patch extends the inventory image with a `plugins` field that contains an array of plugins which were used during checkpoint, for example, to save GPU state. In particular, the CUDA and AMDGPU plugins are added to this field only when the checkpoint contains GPU state. This allows to disable unnecessary plugins during restore, show appropriate error messages if required CRIU plugin are missing, and migrate a process that does not use GPU from a GPU-enabled system to CPU-only environment. We use the `optional plugins_entry` for backwards compatibility. This entry allows us to distinguish between *unset* and *missing* field: - When the field is missing, it indicates that the checkpoint was created with a previous version of CRIU, and all plugins should be *enabled* during restore. - When the field is empty, it indicates that no plugins were used during checkpointing. Thus, all plugins can be *disabled* during restore. Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
0caf28f
to
62238a4
Compare
if (!plugin_added_to_inventory) { | ||
status = add_inventory_plugin(CR_PLUGIN_DESC.name); | ||
if (status) | ||
pr_err("Failed to add CUDA plugin to inventory image\n"); |
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.
should we return a non-zero code in this case?
I think we should introduce a test for this change. |
return true; /* backwards compatibility */ | ||
|
||
if (n_inventory_plugins > 0) { | ||
struct inventory_plugin *p, *tmp; |
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.
nit: add an empty line between declarations and the code block.
This pull request extends the inventory image with a
plugins
field that contains an array of names indicating which plugins were used during checkpointing, for example, to save GPU state. In particular, the CUDA and AMDGPU plugins are added to this field only when the checkpoint contains GPU state. This allows to disable unnecessary plugins during restore, show appropriate error messages if required CRIU plugins are missing, and migrate a process that does not use GPU from a GPU-enabled system to CPU-only environment.