[CRIU] post-dump / pre-restore scripts

Eliot Moss moss at cs.umass.edu
Sat Oct 12 23:57:10 MSK 2019


On 10/12/2019 3:40 PM, Andrei Vagin wrote:
> On Fri, Oct 11, 2019 at 09:24:17AM -0400, Eliot Moss wrote:

> I don't think that you need to use criu scripts for your problem.
> 
> You can get the current posion in the file from criu images. We have the
> crit tool which allows to convert images into the json format.
> 
> $ ./crit/crit show files.img | grep -B 14 -A 4 file_append.test
>          {
>              "type": "REG",
>              "id": 7,
>              "reg": {
>                  "id": 7,
>                  "flags": "O_RDWR | O_APPEND | O_LARGEFILE",
>                  "pos": 130,
>                  "fown": {
>                      "uid": 0,
>                      "euid": 0,
>                      "signum": 0,
>                      "pid_type": 0,
>                      "pid": 0
>                  },
>                  "name":
> "/root/git/main/criu/test/zdtm/static/file_append.test",
>                  "size": 130,
>                  "mode": 33188
>              }
>          },
> 
> So for your case, you can get a file size from files.img and truncate
> the file before calling "criu restore".

Cool!  Thanks, Andrei!    EM


More information about the CRIU mailing list