criurpc.proto 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. message criu_page_server_info {
  2. optional string address = 1;
  3. optional int32 port = 2;
  4. optional int32 pid = 3;
  5. optional int32 fd = 4;
  6. }
  7. message criu_veth_pair {
  8. required string if_in = 1;
  9. required string if_out = 2;
  10. };
  11. message ext_mount_map {
  12. required string key = 1;
  13. required string val = 2;
  14. };
  15. message inherit_fd {
  16. required string key = 1;
  17. required int32 fd = 2;
  18. };
  19. message cgroup_root {
  20. optional string ctrl = 1;
  21. required string path = 2;
  22. };
  23. message unix_sk {
  24. required uint32 inode = 1;
  25. };
  26. enum criu_cg_mode {
  27. IGNORE = 0;
  28. NONE = 1;
  29. PROPS = 2;
  30. SOFT = 3;
  31. FULL = 4;
  32. STRICT = 5;
  33. DEFAULT = 6;
  34. };
  35. message criu_opts {
  36. required int32 images_dir_fd = 1;
  37. optional int32 pid = 2; /* if not set on dump, will dump requesting process */
  38. optional bool leave_running = 3;
  39. optional bool ext_unix_sk = 4;
  40. optional bool tcp_established = 5;
  41. optional bool evasive_devices = 6;
  42. optional bool shell_job = 7;
  43. optional bool file_locks = 8;
  44. optional int32 log_level = 9 [default = 2];
  45. optional string log_file = 10; /* No subdirs are allowed. Consider using work-dir */
  46. optional criu_page_server_info ps = 11;
  47. optional bool notify_scripts = 12;
  48. optional string root = 13;
  49. optional string parent_img = 14;
  50. optional bool track_mem = 15;
  51. optional bool auto_dedup = 16;
  52. optional int32 work_dir_fd = 17;
  53. optional bool link_remap = 18;
  54. repeated criu_veth_pair veths = 19;
  55. optional uint32 cpu_cap = 20 [default = 0xffffffff];
  56. optional bool force_irmap = 21;
  57. repeated string exec_cmd = 22;
  58. repeated ext_mount_map ext_mnt = 23;
  59. optional bool manage_cgroups = 24; /* backward compatibility */
  60. repeated cgroup_root cg_root = 25;
  61. optional bool rst_sibling = 26; /* swrk only */
  62. repeated inherit_fd inherit_fd = 27; /* swrk only */
  63. optional bool auto_ext_mnt = 28;
  64. optional bool ext_sharing = 29;
  65. optional bool ext_masters = 30;
  66. repeated string skip_mnt = 31;
  67. repeated string enable_fs = 32;
  68. repeated unix_sk unix_sk_ino = 33;
  69. optional criu_cg_mode manage_cgroups_mode = 34;
  70. optional uint32 ghost_limit = 35 [default = 0x100000];
  71. repeated string irmap_scan_paths = 36;
  72. repeated string external = 37;
  73. optional uint32 empty_ns = 38;
  74. optional bool no_seccomp = 39;
  75. }
  76. message criu_dump_resp {
  77. optional bool restored = 1;
  78. }
  79. message criu_restore_resp {
  80. required int32 pid = 1;
  81. }
  82. message criu_notify {
  83. optional string script = 1;
  84. optional int32 pid = 2;
  85. }
  86. enum criu_req_type {
  87. EMPTY = 0;
  88. DUMP = 1;
  89. RESTORE = 2;
  90. CHECK = 3;
  91. PRE_DUMP = 4;
  92. PAGE_SERVER = 5;
  93. NOTIFY = 6;
  94. CPUINFO_DUMP = 7;
  95. CPUINFO_CHECK = 8;
  96. FEATURE_CHECK = 9;
  97. }
  98. /*
  99. * List of features which can queried via
  100. * CRIU_REQ_TYPE__FEATURE_CHECK
  101. */
  102. message criu_features {
  103. optional bool mem_track = 1;
  104. }
  105. /*
  106. * Request -- each type corresponds to must-be-there
  107. * request arguments of respective type
  108. */
  109. message criu_req {
  110. required criu_req_type type = 1;
  111. optional criu_opts opts = 2;
  112. optional bool notify_success = 3;
  113. /*
  114. * When set service won't close the connection but
  115. * will wait for more req-s to appear. Works not
  116. * for all request types.
  117. */
  118. optional bool keep_open = 4;
  119. /*
  120. * 'features' can be used to query which features
  121. * are supported by the installed criu/kernel
  122. * via RPC.
  123. */
  124. optional criu_features features = 5;
  125. }
  126. /*
  127. * Response -- it states whether the request was served
  128. * and additional request-specific information
  129. */
  130. message criu_resp {
  131. required criu_req_type type = 1;
  132. required bool success = 2;
  133. optional criu_dump_resp dump = 3;
  134. optional criu_restore_resp restore = 4;
  135. optional criu_notify notify = 5;
  136. optional criu_page_server_info ps = 6;
  137. optional int32 cr_errno = 7;
  138. optional criu_features features = 8;
  139. }