Skip to content

Commit

Permalink
plugin/amdgpu: Also don't print 'plugin failed' in criu
Browse files Browse the repository at this point in the history
We already don't treat it as error in the plugin itself, but after
returning -1 from RESUME_DEVICES_LATE hook we print debug message in
criu about failed plugin, let's return 0 instead.

While on it let's replace ret to exit_code.

Fixes: a9cbdad ("plugin/amdgpu: Don't print error for "No such process" during resume")
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
  • Loading branch information
Snorch authored and avagin committed Feb 5, 2024
1 parent a9cbdad commit 639068e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions plugins/amdgpu/amdgpu_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,7 @@ CR_PLUGIN_REGISTER_HOOK(CR_PLUGIN_HOOK__UPDATE_VMA_MAP, amdgpu_plugin_update_vma
int amdgpu_plugin_resume_devices_late(int target_pid)
{
struct kfd_ioctl_criu_args args = { 0 };
int fd, ret = 0;
int fd, exit_code = 0;

pr_info("Inside %s for target pid = %d\n", __func__, target_pid);

Expand All @@ -1999,15 +1999,16 @@ int amdgpu_plugin_resume_devices_late(int target_pid)
args.op = KFD_CRIU_OP_RESUME;
pr_info("Calling IOCTL to start notifiers and queues\n");
if (kmtIoctl(fd, AMDKFD_IOC_CRIU_OP, &args) == -1) {
if (errno == ESRCH)
if (errno == ESRCH) {
pr_info("Pid %d has no kfd process info\n", target_pid);
else
} else {
pr_perror("restore late ioctl failed");
ret = -1;
exit_code = -1;
}
}

close(fd);
return ret;
return exit_code;
}

CR_PLUGIN_REGISTER_HOOK(CR_PLUGIN_HOOK__RESUME_DEVICES_LATE, amdgpu_plugin_resume_devices_late)

0 comments on commit 639068e

Please sign in to comment.