mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 01:51:51 +00:00
Compare commits
3 Commits
7c4bcdb2d4
...
3a3a3f0f27
Author | SHA1 | Date | |
---|---|---|---|
|
3a3a3f0f27 | ||
|
0d15e2f4d9 | ||
|
2da6a6faff |
@ -58,7 +58,7 @@ proto-obj-y += ext-file.o
|
||||
proto-obj-y += cgroup.o
|
||||
proto-obj-y += userns.o
|
||||
proto-obj-y += pidns.o
|
||||
proto-obj-y += google/protobuf/descriptor.o # To make protoc-c happy and compile opts.proto
|
||||
proto-obj-y += google/protobuf/descriptor.o # To make protoc happy and compile opts.proto
|
||||
proto-obj-y += opts.o
|
||||
proto-obj-y += seccomp.o
|
||||
proto-obj-y += binfmt-misc.o
|
||||
@ -96,7 +96,7 @@ makefile-deps := Makefile $(obj)/Makefile
|
||||
define gen-proto-rules
|
||||
$(obj)/$(1).pb-c.c $(obj)/$(1).pb-c.h: $(obj)/$(1).proto $(addsuffix .pb-c.c,$(addprefix $(obj)/,$(2))) $(makefile-deps)
|
||||
$$(E) " PBCC " $$@
|
||||
$$(Q) protoc-c --proto_path=$(obj)/ --c_out=$(obj)/ $$<
|
||||
$$(Q) protoc --proto_path=$(obj)/ --c_out=$(obj)/ $$<
|
||||
ifeq ($(PROTOUFIX),y)
|
||||
$$(Q) sed -i -e 's/4294967295/0xFFFFFFFF/g' $$@
|
||||
$$(Q) sed -i -e 's/4294967295/0xFFFFFFFF/g' $$(patsubst %.c,%.h,$$@)
|
||||
|
@ -25,7 +25,7 @@ else
|
||||
endif
|
||||
|
||||
criu-amdgpu.pb-c.c: criu-amdgpu.proto
|
||||
protoc-c --proto_path=. --c_out=. criu-amdgpu.proto
|
||||
protoc --proto_path=. --c_out=. criu-amdgpu.proto
|
||||
|
||||
amdgpu_plugin.so: amdgpu_plugin.c amdgpu_plugin_drm.c amdgpu_plugin_topology.c amdgpu_plugin_util.c criu-amdgpu.pb-c.c amdgpu_socket_utils.c
|
||||
$(CC) $(PLUGIN_CFLAGS) $(shell $(COMPEL) includes) $^ -o $@ $(PLUGIN_INCLUDE) $(PLUGIN_LDFLAGS) $(LIBDRM_INC)
|
||||
|
@ -47,7 +47,7 @@ rpc_pb2.py: rpc.proto
|
||||
protoc --proto_path=. --python_out=. rpc.proto
|
||||
|
||||
rpc.pb-c.c: rpc.proto
|
||||
protoc-c --proto_path=. --c_out=. rpc.proto
|
||||
protoc --proto_path=. --c_out=. rpc.proto
|
||||
|
||||
clean:
|
||||
rm -rf build rpc.pb-c.o test-c.o test-c rpc.pb-c.c rpc.pb-c.h rpc_pb2.py rpc_pb2.pyc criu
|
||||
|
@ -4,7 +4,7 @@ run: all
|
||||
./run.sh
|
||||
|
||||
unix.pb-c.c: unix.proto
|
||||
protoc-c --proto_path=. --c_out=. unix.proto
|
||||
protoc --proto_path=. --c_out=. unix.proto
|
||||
|
||||
unix-lib.so: unix-lib.c unix.pb-c.c
|
||||
gcc -g -Werror -Wall -shared -nostartfiles unix-lib.c unix.pb-c.c -o unix-lib.so -iquote ../../../criu/include -fPIC
|
||||
|
29
test/zdtm.py
29
test/zdtm.py
@ -22,11 +22,11 @@ import sys
|
||||
import tempfile
|
||||
import time
|
||||
import uuid
|
||||
import site
|
||||
from builtins import input, int, open, range, str, zip
|
||||
|
||||
import yaml
|
||||
|
||||
import pycriu as crpc
|
||||
from zdtm.criu_config import criu_config
|
||||
|
||||
# File to store content of streamed images
|
||||
@ -1142,6 +1142,24 @@ class criu:
|
||||
self.__img_streamer_process = None
|
||||
self.__tls = self.__tls_options() if opts['tls'] else []
|
||||
self.__criu_bin = opts['criu_bin']
|
||||
|
||||
global crpc
|
||||
pycriu_search_path = opts.get('pycriu_search_path')
|
||||
if pycriu_search_path:
|
||||
sys.path.insert(0, pycriu_search_path)
|
||||
|
||||
try:
|
||||
import pycriu as crpc
|
||||
if pycriu_search_path:
|
||||
print(f"pycriu loaded from: {crpc.__file__}")
|
||||
except ImportError:
|
||||
if not pycriu_search_path:
|
||||
print("Consider building CRIU or using '--pycriu-search-path' option.")
|
||||
raise
|
||||
finally:
|
||||
if pycriu_search_path:
|
||||
sys.path.pop(0)
|
||||
|
||||
self.__crit_bin = opts['crit_bin']
|
||||
self.__pre_dump_mode = opts['pre_dump_mode']
|
||||
self.__preload_libfault = bool(opts['preload_libfault'])
|
||||
@ -1593,6 +1611,7 @@ class criu:
|
||||
def available():
|
||||
if not os.access(opts['criu_bin'], os.X_OK):
|
||||
print("CRIU binary not found at %s" % opts['criu_bin'])
|
||||
print("Consider building CRIU or using '--criu-bin' option.")
|
||||
sys.exit(1)
|
||||
|
||||
def kill(self):
|
||||
@ -2169,7 +2188,8 @@ class Launcher:
|
||||
'dedup', 'sbs', 'freezecg', 'user', 'dry_run', 'noauto_dedup',
|
||||
'remote_lazy_pages', 'show_stats', 'lazy_migrate', 'stream',
|
||||
'tls', 'criu_bin', 'crit_bin', 'pre_dump_mode', 'mntns_compat_mode',
|
||||
'rootless', 'preload_libfault', 'mocked_cuda_checkpoint')
|
||||
'rootless', 'preload_libfault', 'mocked_cuda_checkpoint',
|
||||
'pycriu_search_path')
|
||||
arg = repr((name, desc, flavor, {d: self.__opts[d] for d in nd}))
|
||||
|
||||
if self.__use_log:
|
||||
@ -2860,6 +2880,9 @@ def get_cli_args():
|
||||
rp.add_argument("--criu-bin",
|
||||
help="Path to criu binary",
|
||||
default='../criu/criu')
|
||||
rp.add_argument("--pycriu-search-path",
|
||||
help=f"Path to search for pycriu module first (e.g., {site.getsitepackages()[0]})",
|
||||
default=None)
|
||||
rp.add_argument("--crit-bin",
|
||||
help="Path to crit binary",
|
||||
default='../crit/crit')
|
||||
@ -2950,7 +2973,7 @@ if __name__ == '__main__':
|
||||
if opts['debug']:
|
||||
sys.settrace(traceit)
|
||||
|
||||
if opts['action'] == 'run':
|
||||
if opts['action'] == run_tests:
|
||||
criu.available()
|
||||
for tst in test_classes.values():
|
||||
tst.available()
|
||||
|
@ -734,7 +734,7 @@ criu-rtc.pb-c.c: criu-rtc.proto
|
||||
$(Q)echo $@ >> .gitignore
|
||||
$(Q)echo $(@:%.c=%.h) >> .gitignore
|
||||
$(E) " PBCC " $@
|
||||
$(Q)protoc-c --proto_path=. --c_out=. criu-rtc.proto
|
||||
$(Q)protoc --proto_path=. --c_out=. criu-rtc.proto
|
||||
|
||||
criu-rtc.so: criu-rtc.c criu-rtc.pb-c.c
|
||||
$(E) " LD " $@
|
||||
|
Loading…
x
Reference in New Issue
Block a user