• Pavel Emelyanov's avatar
    kdat: Cache kdat object into /run/criu.kdat (v4) · 07a00662
    Pavel Emelyanov authored
    Doing kerndat checks on every criu start is way too slow. We
    need some way to speed this checks up on a particular box.
    
    As suggested by Andre, Dima and Mike let's try to keep the
    collected kdat bits into some tmpfs file. Keeping it on
    tmpfs would invaludate this cache on every machine reboot.
    
    There have been many suggestions how to generate this file,
    my proposal is to create it once the kdat object is filled
    by criu, w/o any explicit command. Optionally we can add
    'criu kdat --save|--drop' actions to manage this file.
    
    v2:
    * don't ignore return code of write() (some glibcs complain)
    * unlink tmp file in case rename failed
    
    v3:
    * add one more magic into kerndat_s which is the 'date +%s'
    * ignore any errors opening or saving cache. Only size/magic
      mismatch matters (and result in dropping the cache)
    * cache file path is Makefile-configurable (RUNDIR)
    * don't save cache if kerndat auto-detection failed
    
    v4:
    * Use ?= for RUNDIR definition.
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    07a00662
Makefile.install 1.31 KB