2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-25 03:18:36 +00:00

16 Commits

Author SHA1 Message Date
Pavel Emelyanov
51133437c9 fd: Remove per-filetype make_gen_id abstraction
It doesn't makemuch sense in pulling this further. The generic genid generation seems to
be enough for eny file type.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-11 22:41:29 +04:00
Pavel Emelyanov
b91445701b img: Introduce generic routine for collecting image entries
On restore we typically read an image and put the entries into
some hash/list/whatever to work on them later. It's handy to have
a generic routine for doing so.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-09 13:16:46 +04:00
Pavel Emelyanov
b1b0a39a58 pb: Rewrite object reading to use pb-descs
The pb_read thing is no longer a macros. This will allow to
factor out objects collecting on restore.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-07 19:22:00 +04:00
Pavel Emelyanov
2398c55e41 pb: Rewrite object writing to use pb-descs
The pb_write thing is no longer a macros.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-07 19:21:59 +04:00
Pavel Emelyanov
9fc1d6bbeb fdinfo: Make fdinfo.type be an enum
This types specifies a strict set of what is hidden behind
the fd. Thus these numbers should be in the description of
the fdinfo message.

Plus protobuf makes shure nothing else will be there.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 10:18:37 +04:00
Cyrill Gorcunov
dbf29ef92a protobuf: Use FifoEntry instead of struct fifo_entry
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-17 07:18:40 +04:00
Cyrill Gorcunov
8041eac0e5 protobuf: Use RegFileEntry instead of reg_file_entry structure v3
This patch switches reg_file_entry structure with RegFileEntry
protobuf entry. Note that there a few nits remains

 - old fown_t structure doesn't scale well with FownEntry from
   RegFileEntry, so to not mess with rest of crtools code
   I've added a couple of opencoded copy operands, will clean
   this aspect up once rest of code is converted

 - the "show" procedure doesn't print fown for same reason

v2:
 - rename fown_t to fown_entry in .proto
v3:
 - don't print nil symbol on show

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-17 07:17:02 +04:00
Pavel Emelyanov
d271850694 pipe: Add helper for getting pipe_id from fdparms
Just to explicitly state that a pipe ID is its inode number.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-11 11:57:28 +04:00
Pavel Emelyanov
7ea40df4db pipe/fifo: Remove unused members from rst structures
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 08:56:20 +04:00
Pavel Emelyanov
d448a75ec7 pipe/fifo: Fix and cleanup data restore
Make it in two stages.

First -- collect pipe data into hash without checking for pipe/fifo existance.
Next -- when pipe/fifo gets restored walk the hash and search where the pipe data
is.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 08:55:16 +04:00
Pavel Emelyanov
3aa01f649f pipe: Don't intermix pipe and fifo data when dumping
The existing code checks for ID to be already dumped. But pipe and fifo may have the same ID
since they reside on different filesystems.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 08:21:54 +04:00
Pavel Emelyanov
499cc6789b pipe: Remove ID arg from pipe data dump fn
This routine checks for pipe data being dumped based on pipe ID, but the arg in questoin
is the pipe's end ID which makes code reading confusing.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 07:50:39 +04:00
Pavel Emelyanov
218f0a9b5c fifo: Fix false failure on fifo image reading
The ret var is set to -1 at the beginning and the very first loop
will break and report it to the caller thus stopping the restore :(

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 06:25:29 +04:00
Cyrill Gorcunov
c553627ddd fifo: Use fifo_entry in fifo_info as a reference
We will need it for protobuf transition.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-09 15:08:36 +04:00
Pavel Emelyanov
3b8fef5227 fifo: Sanitize fifo restore
Don't push open cb onto reg_file_into, pass it into regfiles engine
as an argument.

Note: I haven't merged the fifo zdtms yet, thus this patch is untested.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Tested-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-07-01 21:47:24 +04:00
Cyrill Gorcunov
ea1ce8e472 fifo: Add checkpoint restore for fifos v4
Checkpoint and restore of fifo is similar to
pipes c/r except the pipe end-points are named
file.

Because the fifo has a name we use regular files
facility for fifo path c/r.

Still there is a trick used to "open" fifo:
the opening procedure migh sleep if a fifo's peer
is not yet opened, so before doing a real open
we yield a fake open procedure (with O_RDWR flag)
which prevents us from sleeping even if peer
is not yet ready. Also we need writable fifo
end to restore data queued.

v2:
 - add open/priv members to reg_file_info
 - make open_fifo_fd to use open_fe_fd
 - comment on pipe_id
 - make sure the fifo data is not restored twice

v3:
 - drop useless fixme comment and add sane one
v4:
 - Use restore_data flag to escape data restore duplication
 - Use S_ISREG for file contents copying

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-01 17:15:48 +04:00