[CRIU] [RFC 0/5] Switch to protobuf, attempt 3

Cyrill Gorcunov gorcunov at openvz.org
Wed Jul 4 14:05:54 EDT 2012


Hi guys,

here is a series with patches which should bring the light on
how I imagine new format.

The most important part I think is the patch 2 where image
header and object headers introduced.

Unfotrunately I can't completely jump to "use new format"
without breaking existing code, so some bits may look like
a bit of mess. But overall idea is the following

 - every record on disk is Protocol Buffers (PB) entry
   (headers, objects, whatever)

 - There is 3 basic format for storing objects

   a) Objects with explicit headres, where every .img
      file is a sequence of records

        | image header
        +---
        | object header
        +---
        | object itself
        +---
                ...

        object header and object itself could be repeated
        in file whatever times you need. This is usefull
        if objects do vary in size and object header describes
        the type of object stored and its packed size.

        when a reader needs to read such object he should
        read object header first (which is exremelly fast since object
        header is fixed in size and we have own helpers for
        that) and then depending on object type call for unpack
        procedure provided by PB library

   b) Array of fixed size objects, where all objects are fixed in
      size and there is no need to store object header more than
      once

        | image header
        +---
        | object's array header
        +---
        | object itself
        +---
                ...

        thus reader only need to read object's array header and read
        objects until end of file

    c) Objects with explicit start/stop markers. May be useful in
       case if image is to be passed via network where receiver
       doesn't know when objects transfer is complete (or in case
       if restore comes in parallel with checkpoint).

        On binary lever this should look like a) or b) but with
        additional object header in top and at the end of image
        (see image.base.proto for details).

As I mentioned in one of change log -- the complete trasition to
the new format is not yet done and code might be a bit messy at
moment, this is done to not break current working code.

Anyway, take a look, thanks!



More information about the CRIU mailing list