mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
plugins/amdgpu: Add plugin to inventory even if process has no vmas
Currently the plugin is added to the inventory only if there were amdgpu mapped vmas in the target process. This makes restoring a simple process with only an open DRM fd and some buffer objects not work. Fix it by adding the plugin to the inventory when there were open DRM files as well. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Reviewed-By: David Francis <David.Francis@amd.com>
This commit is contained in:
parent
7041509a50
commit
05961714ef
1 changed files with 24 additions and 9 deletions
|
|
@ -443,6 +443,22 @@ struct thread_data {
|
|||
int id; /* File ID used by CRIU to identify KFD image for this process */
|
||||
};
|
||||
|
||||
static int amdgpu_add_to_inventory(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (plugin_added_to_inventory)
|
||||
return 0;
|
||||
|
||||
ret = add_inventory_plugin(CR_PLUGIN_DESC.name);
|
||||
if (ret)
|
||||
pr_err("Failed to add AMDGPU plugin to inventory image\n");
|
||||
else
|
||||
plugin_added_to_inventory = true;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int amdgpu_plugin_handle_device_vma(int fd, const struct stat *st_buf)
|
||||
{
|
||||
struct stat st_kfd;
|
||||
|
|
@ -465,13 +481,8 @@ int amdgpu_plugin_handle_device_vma(int fd, const struct stat *st_buf)
|
|||
if (ret)
|
||||
pr_perror("%s(), Can't handle VMAs of input device", __func__);
|
||||
|
||||
if (!ret && !plugin_added_to_inventory) {
|
||||
ret = add_inventory_plugin(CR_PLUGIN_DESC.name);
|
||||
if (ret)
|
||||
pr_err("Failed to add AMDGPU plugin to inventory image\n");
|
||||
else
|
||||
plugin_added_to_inventory = true;
|
||||
}
|
||||
if (!ret)
|
||||
ret = amdgpu_add_to_inventory();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -1472,8 +1483,12 @@ int amdgpu_plugin_dump_file(int fd, int id)
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Need to return success here so that criu can call plugins for renderD nodes */
|
||||
return try_dump_dmabuf_list();
|
||||
ret = try_dump_dmabuf_list();
|
||||
|
||||
if (!ret)
|
||||
ret = amdgpu_add_to_inventory();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
pr_info("%s() called for fd = %d\n", __func__, major(st.st_rdev));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue