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

13 Commits

Author SHA1 Message Date
Kinsbursky Stanislav
290003e964 protobuf: add payload print support in generic show function
This patch also updates pipe data and sockets queues payload handlers to
output data in "-c" option was passed to crtools.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-28 09:02:38 +04:00
Kinsbursky Stanislav
d0a5f0aea9 protobuf: add show support for images payload
Payload handler can be passed into generic protobuf show function.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:32:41 +04:00
Kinsbursky Stanislav
5bb1b8428b protobuf: replace rectangular bracket by curly one for nested messages show
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:28:17 +04:00
Kinsbursky Stanislav
b56bc8c5f9 protobuf: added support for optional fields
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:28:15 +04:00
Kinsbursky Stanislav
01228a195a protobuf: added nested messages outup shift for vertical output
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:28:15 +04:00
Kinsbursky Stanislav
705411f4bc protobuf: vertical output support introduced
Will be used for single-entry images.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:28:14 +04:00
Kinsbursky Stanislav
5809e7d0b3 protobuf: control block for generic show introduced
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-25 18:28:12 +04:00
Stanislav Kinsbursky
92e6a30904 protobuf: simplify plain show logic
__pb_show_msg() is redundant.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 14:54:27 +04:00
Pavel Emelyanov
dffd0aa65f protobuf: Introduce enum showing function
Try hard to find the symbolic (declared in .proto file) name
for the given value.

Will use enums in fdinfo, thus prepare.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 10:17:40 +04:00
Pavel Emelyanov
d6514dae45 pb: Introduce show_plain routine
This one walks the 'plain' image file, i.e. the one with straignt <magi>[<size><entry>]*
format, and prints each message. Saves lots of lines of code.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-18 19:09:51 +04:00
Pavel Emelyanov
a710f61717 pb: Clean pb callback pointers typedefs
Use more classical version with asterisk in type definition

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-18 18:42:35 +04:00
Kinsbursky Stanislav
0456049579 protobuf: generic show function introduced
This function can be used for any protobuf message which contains required,
repeated and even nested messages fields.

The functions doesn't support yet:
1) Optional fields (skipped)
2) Fields types: PROTOBUF_C_TYPE_FLOAT, PROTOBUF_C_TYPE_DOUBLE,
PROTOBUF_C_TYPE_BOOL, PROTOBUF_C_TYPE_ENUM, PROTOBUF_C_TYPE_BYTES.
These are show as unknown objects.

IOW, it supports only existent proto files.

Inspired-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 08:25:03 +04:00
Cyrill Gorcunov
c75b4b70fc protbuf: Add protobuf (PB) image entries read/write helpers v4
To not bloat util.h or image.h the protobuf.h introduced to handle all PB needs.

We represent our PB objects as pairs of records

  | 4 bytes for object packed size
  +---
  | X bytes -- object itself

v3:
 - Use plain read/write calls
 - Use local buffers for small objects

v4:
 - Add pb_pksize helper to calculate object
   size with header

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