2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 09:58:09 +00:00
criu/plugins/amdgpu/dummy_plugin.c
Rajneesh Bhardwaj 7b6239b6dd criu/plugin: Implement dummy amdgpu plugin hooks
This is just a placeholder dummy plugin and will be replaced by a proper
plugin that implements support for AMD GPU devices. This just
facilitates the initial pull request and CI build test trigger for early
code review of CRIU specific changes. Future PRs will bring in more
support for amdgpu_plugin to enable CRIU with AMD ROCm.

Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
2022-04-28 17:53:52 -07:00

37 lines
1.2 KiB
C

#include <sys/stat.h>
#include "criu-log.h"
#include "criu-plugin.h"
int dummy_plugin_handle_device_vma(int fd, const struct stat *stat)
{
pr_info("dummy_plugin: Inside %s for fd = %d\n", __func__, fd);
/* let criu report failure for the unsupported mapping */
return -ENOTSUP;
}
CR_PLUGIN_REGISTER_HOOK(CR_PLUGIN_HOOK__HANDLE_DEVICE_VMA, dummy_plugin_handle_device_vma)
int dummy_plugin_resume_devices_late(int target_pid)
{
pr_info("dummy_plugin: Inside %s for target pid = %d\n", __func__, target_pid);
return -ENOTSUP;
}
CR_PLUGIN_REGISTER_HOOK(CR_PLUGIN_HOOK__RESUME_DEVICES_LATE, dummy_plugin_resume_devices_late)
/*
* return 0 if no match found
* return -1 for error or -ENOTSUP.
* return 1 if vmap map must be adjusted.
*/
int dummy_plugin_update_vmamap(const char *old_path, char *new_path, const uint64_t addr, const uint64_t old_offset,
uint64_t *new_offset)
{
uint64_t temp = 100;
*new_offset = temp;
pr_info("dummy_plugin: old_pgoff= 0x%lu new_pgoff = 0x%lx old_path = %s new_path = %s addr = 0x%lu\n",
old_offset, *new_offset, old_path, new_path, addr);
return -ENOTSUP;
}
CR_PLUGIN_REGISTER_HOOK(CR_PLUGIN_HOOK__UPDATE_VMA_MAP, dummy_plugin_update_vmamap)