[CRIU] [PATCH 2/4] tools: add criu2text

Pavel Emelyanov xemul at parallels.com
Tue Sep 30 02:14:10 PDT 2014


On 09/30/2014 01:08 PM, Ruslan Kuprieiev wrote:
> On 30.09.2014 11:12, Pavel Emelyanov wrote:
>> On 09/19/2014 05:53 PM, Ruslan Kuprieiev wrote:
>>> criu2text.py handles cmdline opts, opens files and reads\writes them
>>> properly. images.py has a dict with MAGIC:pb_entry_type to specify what
>>> type of pb entry we should read from image with magic MAGIC.
>>> magic-gen.py parses include/magic.h to get all MAGIC values except
>>> RAW and V1, because criu2text can't handle them for now.
>> OK, I like the code, but let's rework the way tool works a little bit.
>>
>> 1. Right now, AFAIK, the tool turns one .img file into a set of .txt
>> ones. Let's make tool convert _one_ file to _one_ file, e.g. core.img
>> into core.txt. And the syntax should look like this:
>>
>> criu2text -i|--in <filename> -o|--out <filename>
>>
>> If <filename> == "-", then stdin/stdout is used.
>>
>> The conversion from .img to .txt would work automatically, the conversion
>> back would have to know what kind of image we're working on. For this
>> the tool can write the magic value as the first line (in a form of a
>> comment if it makes sense).
> 
> In early criu2json it worked just as you described =).
> In json it was easy to create a new message, but in pbtext it is a bit less
> smooth. Well, we can separate msgs in txt file by special comments, e.g:
> #0x12345                  magic
> #0                              №
> MSG0                          pb entry
> #1                              №
> MSG1                          pb entry
> #2
> MSG2
> ........
> 
> Does it look good to you?
> Or maybe we should drop № and just leave # as a separator, e.g.:
> #0x12345
> MSG0
> #
> MSG1
> #
> MSG2
> 
> ?

Plz, show how the fdinfo-$pid.img would look like in this format.


More information about the CRIU mailing list