[CRIU] [PATCH 1/6] protbuf: Add Protocol Buffers (PB) helpers v4

Cyrill Gorcunov gorcunov at openvz.org
Thu Jul 12 05:06:55 EDT 2012


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 at openvz.org>
---
 Makefile           |    1 +
 include/protobuf.h |   55 ++++++++++++++++++++++
 protobuf.c         |  132 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 188 insertions(+), 0 deletions(-)
 create mode 100644 include/protobuf.h
 create mode 100644 protobuf.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-protbuf-Add-Protocol-Buffers-PB-helpers-v4.patch
Type: text/x-patch
Size: 5000 bytes
Desc: not available
Url : http://openvz.org/pipermail/criu/attachments/20120712/5ab21a9e/0001-protbuf-Add-Protocol-Buffers-PB-helpers-v4-0001.bin


More information about the CRIU mailing list