criurpc.proto 4.8 KB

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