2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 13:28:27 +00:00

107 Commits

Author SHA1 Message Date
Cyrill Gorcunov
18145c50c1 files-reg: Create fifo ghost node if needed v2
Allow file path remap engine to create fifo nodes.
Note for fifos the copy_file is not called since
we will restore fifo data via pipe-data engine.

v2
 - no need for dev in mknod
 - don't reopen local copy on fifo files

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 17:14:32 +04:00
Pavel Emelyanov
57095eb946 util: Helper for reading a string from image
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 20:57:35 +04:00
Cyrill Gorcunov
d53a820b37 files-reg: Eliminate memory leak in open_remap_ghost on errors
xmalloc'ed gf and gf->path are not freed if something failed.
Not a big deal since we're ususally interrupt program execution
on error and do exit, but anyway.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-21 12:13:05 +04:00
Cyrill Gorcunov
9478974680 files-reg: Align and reorder structure members
This eliminates holes in structures. No func changes.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-21 12:12:04 +04:00
Cyrill Gorcunov
47506e8d2d files-reg: Add missing new line before open_reg_by_id helper
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-21 12:11:32 +04:00
Cyrill Gorcunov
4a85120cbf files-reg: Use stack variable in dump_one_reg_file
No need to carry static per-file variable, we need
it in one non-recursive function only so make it
stack based instead.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-21 12:11:15 +04:00
Cyrill Gorcunov
4140c9e4ec files: Move regular files handling code to files-reg
Instead of spreading regular files handling code over
files.c and cr-dump.c move it to files-reg.c.

This allows to extend regular file handling code in
future without disturbing other source files and
make code logically coupled, where files.c is mostly
a place for general file handling code unrelated to
file type specifics.

While mostly it was code tossing there is some change
I have to notice -- the structure ghost_file was previously
declared in two paces cr-dump.c and files.c, in cr-dump.c
it was used for dumping while in files.c it was used
for restore. The structure had different members.

So to resolve this conflict the ghost_file structure
was renamed to ghost_file_dumpee.

Nothing else is changed.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-21 12:10:13 +04:00