rpc.proto 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. // SPDX-License-Identifier: MIT
  2. syntax = "proto2";
  3. message criu_page_server_info {
  4. optional string address = 1;
  5. optional int32 port = 2;
  6. optional int32 pid = 3;
  7. optional int32 fd = 4;
  8. }
  9. message criu_veth_pair {
  10. required string if_in = 1;
  11. required string if_out = 2;
  12. };
  13. message ext_mount_map {
  14. required string key = 1;
  15. required string val = 2;
  16. };
  17. message join_namespace {
  18. required string ns = 1;
  19. required string ns_file = 2;
  20. optional string extra_opt = 3;
  21. }
  22. message inherit_fd {
  23. required string key = 1;
  24. required int32 fd = 2;
  25. };
  26. message cgroup_root {
  27. optional string ctrl = 1;
  28. required string path = 2;
  29. };
  30. message unix_sk {
  31. required uint32 inode = 1;
  32. };
  33. enum criu_cg_mode {
  34. IGNORE = 0;
  35. CG_NONE = 1;
  36. PROPS = 2;
  37. SOFT = 3;
  38. FULL = 4;
  39. STRICT = 5;
  40. DEFAULT = 6;
  41. };
  42. enum criu_pre_dump_mode {
  43. SPLICE = 1;
  44. VM_READ = 2;
  45. };
  46. message criu_opts {
  47. required int32 images_dir_fd = 1;
  48. optional int32 pid = 2; /* if not set on dump, will dump requesting process */
  49. optional bool leave_running = 3;
  50. optional bool ext_unix_sk = 4;
  51. optional bool tcp_established = 5;
  52. optional bool evasive_devices = 6;
  53. optional bool shell_job = 7;
  54. optional bool file_locks = 8;
  55. optional int32 log_level = 9 [default = 2];
  56. optional string log_file = 10; /* No subdirs are allowed. Consider using work-dir */
  57. optional criu_page_server_info ps = 11;
  58. optional bool notify_scripts = 12;
  59. optional string root = 13;
  60. optional string parent_img = 14;
  61. optional bool track_mem = 15;
  62. optional bool auto_dedup = 16;
  63. optional int32 work_dir_fd = 17;
  64. optional bool link_remap = 18;
  65. repeated criu_veth_pair veths = 19; /* DEPRECATED, use external instead */
  66. optional uint32 cpu_cap = 20 [default = 0xffffffff];
  67. optional bool force_irmap = 21;
  68. repeated string exec_cmd = 22;
  69. repeated ext_mount_map ext_mnt = 23; /* DEPRECATED, use external instead */
  70. optional bool manage_cgroups = 24; /* backward compatibility */
  71. repeated cgroup_root cg_root = 25;
  72. optional bool rst_sibling = 26; /* swrk only */
  73. repeated inherit_fd inherit_fd = 27; /* swrk only */
  74. optional bool auto_ext_mnt = 28;
  75. optional bool ext_sharing = 29;
  76. optional bool ext_masters = 30;
  77. repeated string skip_mnt = 31;
  78. repeated string enable_fs = 32;
  79. repeated unix_sk unix_sk_ino = 33; /* DEPRECATED, use external instead */
  80. optional criu_cg_mode manage_cgroups_mode = 34;
  81. optional uint32 ghost_limit = 35 [default = 0x100000];
  82. repeated string irmap_scan_paths = 36;
  83. repeated string external = 37;
  84. optional uint32 empty_ns = 38;
  85. repeated join_namespace join_ns = 39;
  86. optional string cgroup_props = 41;
  87. optional string cgroup_props_file = 42;
  88. repeated string cgroup_dump_controller = 43;
  89. optional string freeze_cgroup = 44;
  90. optional uint32 timeout = 45;
  91. optional bool tcp_skip_in_flight = 46;
  92. optional bool weak_sysctls = 47;
  93. optional bool lazy_pages = 48;
  94. optional int32 status_fd = 49;
  95. optional bool orphan_pts_master = 50;
  96. optional string config_file = 51;
  97. optional bool tcp_close = 52;
  98. optional string lsm_profile = 53;
  99. optional string tls_cacert = 54;
  100. optional string tls_cacrl = 55;
  101. optional string tls_cert = 56;
  102. optional string tls_key = 57;
  103. optional bool tls = 58;
  104. optional bool tls_no_cn_verify = 59;
  105. optional string cgroup_yard = 60;
  106. optional criu_pre_dump_mode pre_dump_mode = 61 [default = SPLICE];
  107. optional int32 pidfd_store_sk = 62;
  108. optional string lsm_mount_context = 63;
  109. /* optional bool check_mounts = 128; */
  110. }
  111. message criu_dump_resp {
  112. optional bool restored = 1;
  113. }
  114. message criu_restore_resp {
  115. required int32 pid = 1;
  116. }
  117. message criu_notify {
  118. optional string script = 1;
  119. optional int32 pid = 2;
  120. }
  121. enum criu_req_type {
  122. EMPTY = 0;
  123. DUMP = 1;
  124. RESTORE = 2;
  125. CHECK = 3;
  126. PRE_DUMP = 4;
  127. PAGE_SERVER = 5;
  128. NOTIFY = 6;
  129. CPUINFO_DUMP = 7;
  130. CPUINFO_CHECK = 8;
  131. FEATURE_CHECK = 9;
  132. VERSION = 10;
  133. WAIT_PID = 11;
  134. PAGE_SERVER_CHLD = 12;
  135. }
  136. /*
  137. * List of features which can queried via
  138. * CRIU_REQ_TYPE__FEATURE_CHECK
  139. */
  140. message criu_features {
  141. optional bool mem_track = 1;
  142. optional bool lazy_pages = 2;
  143. optional bool pidfd_store = 3;
  144. }
  145. /*
  146. * Request -- each type corresponds to must-be-there
  147. * request arguments of respective type
  148. */
  149. message criu_req {
  150. required criu_req_type type = 1;
  151. optional criu_opts opts = 2;
  152. optional bool notify_success = 3;
  153. /*
  154. * When set service won't close the connection but
  155. * will wait for more req-s to appear. Works not
  156. * for all request types.
  157. */
  158. optional bool keep_open = 4;
  159. /*
  160. * 'features' can be used to query which features
  161. * are supported by the installed criu/kernel
  162. * via RPC.
  163. */
  164. optional criu_features features = 5;
  165. /* 'pid' is used for WAIT_PID */
  166. optional uint32 pid = 6;
  167. }
  168. /*
  169. * Response -- it states whether the request was served
  170. * and additional request-specific information
  171. */
  172. message criu_resp {
  173. required criu_req_type type = 1;
  174. required bool success = 2;
  175. optional criu_dump_resp dump = 3;
  176. optional criu_restore_resp restore = 4;
  177. optional criu_notify notify = 5;
  178. optional criu_page_server_info ps = 6;
  179. optional int32 cr_errno = 7;
  180. optional criu_features features = 8;
  181. optional string cr_errmsg = 9;
  182. optional criu_version version = 10;
  183. optional int32 status = 11;
  184. }
  185. /* Answer for criu_req_type.VERSION requests */
  186. message criu_version {
  187. required int32 major_number = 1;
  188. required int32 minor_number = 2;
  189. optional string gitid = 3;
  190. optional int32 sublevel = 4;
  191. optional int32 extra = 5;
  192. optional string name = 6;
  193. }