[CRIU] [PATCH 0/6] crit: hex values
Ruslan Kuprieiev
kupruser at gmail.com
Fri Jan 16 12:55:51 PST 2015
Pavel reported that decimal values for some fields are hard to read,
because people used to see hex values in there. Unfortunatelly, json
doesn't support hex representation of integers, so we can only store
them as hex strings. Not all field need to be represented as hex
strings, so this set introduces a custom field option called "criu"
to use in our proto files. One should use [(criu).hex = true] to mark
which field should be represented as a hex string. pb2dict module
from pycriu package will look into field options and if he finds that
criu.hex is set to True, it will convert such field to/from hex string.
Though, such behaviour is optional and user can request it by specifying
--format hex when calling crit decode("crit encode" in its turn, detects
such fields automatically and doesn't require any special cmdline options
to be set).
This set also contains two patches to mark field that need to be treated
as hex numbers, but they don't cover all such fields, so feel free to mark
fields that you need.
Reported-by: Pavel Emelyanov <xemul at parallels.com>
Ruslan Kuprieiev (6):
protobuf: add opts.proto
protobuf: compile opts.proto
protobuf: core: use hex(custom field option) for blk_sigset field
crit: add --format hex option
test: crit: use --format hex
protobuf: add criu.hex = true options to int64 fields
.gitignore | 2 +
crit | 14 ++++---
protobuf/Makefile | 4 ++
protobuf/core-x86.proto | 64 ++++++++++++++++---------------
protobuf/core.proto | 4 +-
protobuf/google/protobuf/descriptor.proto | 1 +
protobuf/opts.proto | 10 +++++
pycriu/images/Makefile | 2 +-
pycriu/images/images.py | 24 ++++++------
pycriu/images/pb2dict.py | 29 ++++++++++----
test/crit/test.sh | 2 +-
11 files changed, 98 insertions(+), 58 deletions(-)
create mode 120000 protobuf/google/protobuf/descriptor.proto
create mode 100644 protobuf/opts.proto
--
2.1.0
More information about the CRIU
mailing list