mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 22:35:33 +00:00
plugins: the UPDATE_VMA_MAP callback returns fd with the full control
It means CRIU has to close it when it is not needed. It looks more logically correct and matches the behaviour of the RESTORE_EXT_FILE callback. Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
@@ -1955,10 +1955,15 @@ int amdgpu_plugin_update_vmamap(const char *in_path, const uint64_t addr, const
|
||||
if (addr == vma_md->vma_entry && old_offset == vma_md->old_pgoff) {
|
||||
*new_offset = vma_md->new_pgoff;
|
||||
|
||||
if (is_renderD)
|
||||
*updated_fd = vma_md->fd;
|
||||
else
|
||||
*updated_fd = -1;
|
||||
*updated_fd = -1;
|
||||
if (is_renderD) {
|
||||
int fd = dup(vma_md->fd);
|
||||
if (fd == -1) {
|
||||
pr_perror("unable to duplicate the render fd");
|
||||
return -1;
|
||||
}
|
||||
*updated_fd = fd;
|
||||
}
|
||||
|
||||
plugin_log_msg("old_pgoff=0x%lx new_pgoff=0x%lx fd=%d\n", vma_md->old_pgoff, vma_md->new_pgoff,
|
||||
*updated_fd);
|
||||
|
Reference in New Issue
Block a user