Commit 3822c079 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Cyrill Gorcunov

restore: Ignore ENOENT when preparing shared resources

The absent image file on shared resources preparation now means -- no resources
for this pid (zombies will not have these files).

This is not the most elegant solution, but I don't have anything better in mind.
Need to think over, all the more so we're most likely about to reimplement the
way image is stored some day in the future.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 61444311
...@@ -285,8 +285,12 @@ static int prepare_shmem_pid(int pid) ...@@ -285,8 +285,12 @@ static int prepare_shmem_pid(int pid)
int sh_fd; int sh_fd;
sh_fd = open_image_ro(CR_FD_SHMEM, pid); sh_fd = open_image_ro(CR_FD_SHMEM, pid);
if (sh_fd < 0) if (sh_fd < 0) {
if (errno == ENOENT)
return 0;
else
return -1; return -1;
}
while (1) { while (1) {
struct shmem_entry e; struct shmem_entry e;
...@@ -314,8 +318,12 @@ static int prepare_pipes_pid(int pid) ...@@ -314,8 +318,12 @@ static int prepare_pipes_pid(int pid)
int p_fd; int p_fd;
p_fd = open_image_ro(CR_FD_PIPES, pid); p_fd = open_image_ro(CR_FD_PIPES, pid);
if (p_fd < 0) if (p_fd < 0) {
if (errno == ENOENT)
return 0;
else
return -1; return -1;
}
while (1) { while (1) {
struct pipe_entry e; struct pipe_entry e;
......
...@@ -163,7 +163,9 @@ int prepare_fd_pid(int pid) ...@@ -163,7 +163,9 @@ int prepare_fd_pid(int pid)
fdinfo_fd = open_image_ro(CR_FD_FDINFO, pid); fdinfo_fd = open_image_ro(CR_FD_FDINFO, pid);
if (fdinfo_fd < 0) { if (fdinfo_fd < 0) {
pr_perror("%d: Can't open fdinfo image\n", pid); if (errno == ENOENT)
return 0;
else
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment