Skip to content

Commit

Permalink
files: Remove support for per-pid fdinfo-s
Browse files Browse the repository at this point in the history
Since 0.3 fdinfo image is ID-s based, so old ones are not used at all.

Signed-off-by: Pavel Emelyanov <[email protected]>
  • Loading branch information
xemul committed Jun 28, 2016
1 parent c8e983c commit dbe8123
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
20 changes: 7 additions & 13 deletions criu/files.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,21 +695,15 @@ int prepare_fd_pid(struct pstree_item *item)
INIT_LIST_HEAD(&rst_info->tty_slaves);
INIT_LIST_HEAD(&rst_info->tty_ctty);

if (!fdinfo_per_id) {
img = open_image(CR_FD_FDINFO, O_RSTR, pid);
if (!img)
return -1;
} else {
if (item->ids == NULL) /* zombie */
return 0;
if (item->ids == NULL) /* zombie */
return 0;

if (rsti(item)->fdt && rsti(item)->fdt->pid != item->pid.virt)
return 0;
if (rsti(item)->fdt && rsti(item)->fdt->pid != item->pid.virt)
return 0;

img = open_image(CR_FD_FDINFO, O_RSTR, item->ids->files_id);
if (!img)
return -1;
}
img = open_image(CR_FD_FDINFO, O_RSTR, item->ids->files_id);
if (!img)
return -1;

while (1) {
FdinfoEntry *e;
Expand Down
7 changes: 5 additions & 2 deletions criu/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "images/inventory.pb-c.h"
#include "images/pagemap.pb-c.h"

bool fdinfo_per_id = false;
bool ns_per_id = false;
bool img_common_magic = true;
TaskKobjIdsEntry *root_ids;
Expand All @@ -34,7 +33,11 @@ int check_img_inventory(void)
if (pb_read_one(img, &he, PB_INVENTORY) < 0)
goto out_close;

fdinfo_per_id = he->has_fdinfo_per_id ? he->fdinfo_per_id : false;
if (!he->has_fdinfo_per_id || !he->fdinfo_per_id) {
pr_err("Too old image, no longer supported\n");
goto out_close;
}

ns_per_id = he->has_ns_per_id ? he->ns_per_id : false;

if (he->root_ids) {
Expand Down
1 change: 0 additions & 1 deletion criu/include/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@

#define CR_PARENT_LINK "parent"

extern bool fdinfo_per_id;
extern bool ns_per_id;
extern bool img_common_magic;

Expand Down

0 comments on commit dbe8123

Please sign in to comment.