I made the necessary modification in order for the hypervisor to save and restore the state of the guest using two files (.ckp for RAM and .meta for the state of each device) instead of three files (.ckp for RAM, .kern for the data of each device, .meta for the necessary information to extract the data from the .kern file). The feature is useful in order to make the interpretation of the data that represents a state easier for a human, the binary data is hard to understand and debug when it is needed.
In order to store the data I used base64 encoding for the array types and I kept the actual type if it can be easy to understand(ex: int type). I used the encoding in order to keep the file type "text" and not write pure binary data(the data from the frame buffer for example).
The usual types, that are human friendly, such as int, long, etc, I just used the corresponding format(%d, %ld, etc.) in order to avoid doing more computations and make the file harder to read.
Here is an example of the file.ckp.meta file generated with the implementation:
"device_params": [ { "vcpus": [ { "vcpus@0": [ { "x2apic_state$uint32": 0, "exitintinfo$uint64": "0", "exc_vector$int32": 0, "exc_errcode_valid$int32": 0, "exc_errcode$uint32": 0, "guest_xcr0$uint64": "7", "exitinfo$b64": "FQAAAAAAAACWXQiB/////wCwHDsBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPYSsBAAAAAAAAAAAAwAAAAMAAAAAAAAAiYGAAwAAMcBdw2YuDx+EDwZIAAgBAAQAAAAAAAIAAAAtAAAALQAAAIADAAAAAAAAAAAAAAAAAAABAIkBAAAAAA==", "nextrip$uint64": "ffffffff81085d96", "tsc_offset$uint64": "15063e03a9f0" } ],