mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 09:58:09 +00:00
support user set remote mmap vma address
1. os auto assignment vma addr maybe conflict with vma in gpu living migrate scene; 2. so, we should give choice to user; Signed-off-by: haozi007 <liuhao27@huawei.com>
This commit is contained in:
parent
551cd92447
commit
67fe44e981
@ -120,6 +120,7 @@ struct infect_ctx {
|
|||||||
open_proc_fn open_proc;
|
open_proc_fn open_proc;
|
||||||
|
|
||||||
int log_fd; /* fd for parasite code to send messages to */
|
int log_fd; /* fd for parasite code to send messages to */
|
||||||
|
unsigned long remote_map_addr; /* User-specified address where to mmap parasitic code, default not set */
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct infect_ctx *compel_infect_ctx(struct parasite_ctl *);
|
extern struct infect_ctx *compel_infect_ctx(struct parasite_ctl *);
|
||||||
|
@ -816,7 +816,7 @@ static int parasite_memfd_exchange(struct parasite_ctl *ctl, unsigned long size,
|
|||||||
uint8_t orig_code[MEMFD_FNAME_SZ] = MEMFD_FNAME;
|
uint8_t orig_code[MEMFD_FNAME_SZ] = MEMFD_FNAME;
|
||||||
pid_t pid = ctl->rpid;
|
pid_t pid = ctl->rpid;
|
||||||
long sret = -ENOSYS;
|
long sret = -ENOSYS;
|
||||||
int ret, fd, lfd;
|
int ret, fd, lfd, remote_flags;
|
||||||
|
|
||||||
if (ctl->ictx.flags & INFECT_NO_MEMFD)
|
if (ctl->ictx.flags & INFECT_NO_MEMFD)
|
||||||
return 1;
|
return 1;
|
||||||
@ -860,7 +860,11 @@ static int parasite_memfd_exchange(struct parasite_ctl *ctl, unsigned long size,
|
|||||||
goto err_cure;
|
goto err_cure;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctl->remote_map = remote_mmap(ctl, NULL, size, remote_prot, MAP_FILE | MAP_SHARED, fd, 0);
|
remote_flags = MAP_FILE | MAP_SHARED;
|
||||||
|
if (ctl->ictx.remote_map_addr){
|
||||||
|
remote_flags |= MAP_FIXED_NOREPLACE;
|
||||||
|
}
|
||||||
|
ctl->remote_map = remote_mmap(ctl, (void *)ctl->ictx.remote_map_addr, size, remote_prot, remote_flags, fd, 0);
|
||||||
if (!ctl->remote_map) {
|
if (!ctl->remote_map) {
|
||||||
pr_err("Can't rmap memfd for parasite blob\n");
|
pr_err("Can't rmap memfd for parasite blob\n");
|
||||||
goto err_curef;
|
goto err_curef;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user