Commit 46c24c00 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

tty: Fix deprecation detection logic

When collecting tty records the @id may come in
as external tty entry which has no regular file
record (because it gonna be inherited on the
restore from the command line option).

Thus, make sure that deprecated_ok() is never
called on external ttys.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 0daef3d1
...@@ -1538,10 +1538,17 @@ static int collect_one_tty(void *obj, ProtobufCMessage *msg, struct cr_img *i) ...@@ -1538,10 +1538,17 @@ static int collect_one_tty(void *obj, ProtobufCMessage *msg, struct cr_img *i)
* The image might have no reg file record in old CRIU, so * The image might have no reg file record in old CRIU, so
* lets don't fail for a while. After a couple of releases * lets don't fail for a while. After a couple of releases
* simply require the record to present. * simply require the record to present.
*
* Note for external ttys it's fine to not have any
* reg file rectord because they are inherited from
* command line on restore.
*/ */
info->reg_d = try_collect_special_file(info->tfe->id, 1); info->reg_d = try_collect_special_file(info->tfe->id, 1);
if (!info->reg_d) { if (!info->reg_d) {
if (!deprecated_ok("TTY w/o regfile")) if (info->driver->type != TTY_TYPE__EXT_TTY) {
pr_err("No reg_d descriptor for id %#x\n", info->tfe->id);
return -1;
} else if (!deprecated_ok("TTY w/o regfile"))
return -1; return -1;
if (is_pty(info->driver)) { if (is_pty(info->driver)) {
...@@ -1551,9 +1558,6 @@ static int collect_one_tty(void *obj, ProtobufCMessage *msg, struct cr_img *i) ...@@ -1551,9 +1558,6 @@ static int collect_one_tty(void *obj, ProtobufCMessage *msg, struct cr_img *i)
info->tfe->id); info->tfe->id);
return -1; return -1;
} }
} else if (info->driver->type != TTY_TYPE__EXT_TTY) {
pr_err("No reg_d descriptor for id %#x\n", info->tfe->id);
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