Difference between revisions of "Postulates"

From CRIU
Jump to navigation Jump to search
(some reformatting / rephrasing, added see also)
 
Line 1: Line 1:
* All shared resources must be restored by the task with the least PID to avoid deadlocks.
+
Here are a few principles that must be taken into account while developing CRIU.
* No operations with file paths in restorer blob -- task has restored it's fs (cwd and root) and may see different tree.
+
 
* In "dump" code any fork()+exec() should be done using the cr_system() helper not to interfere with victim task tracing.
+
* All shared resources must be restored by the task with the lowest PID among the group to avoid deadlocks.
* To keep backward compatibility on protobuf image files, follow those rules (short notes from [https://developers.google.com/protocol-buffers/docs/proto#updating protobuf messages updating guide]):
+
* No operations with file paths in restorer blob task has restored its fs (cwd and root) and may see a different tree.
** Don't change the numeric tags for any existing fields.
+
* In dumping code, any fork()+exec() should be done using the cr_system() helper to avoid interfering with victim task tracing.
** Any new fields that you add should be optional or repeated.
+
 
** Non-required fields can be removed, as long as the tag number is not used again in your updated message type.
+
== Protobuf images compatibility ==
 +
 
 +
To retain backward compatibility of protobuf image files, follow these rules:
 +
 
 +
* Don't change the numeric tags for any existing fields.
 +
* Any new fields that you add should be optional or repeated.
 +
* Non-required fields can be removed, as long as the tag number is not used again in your updated message type.
 +
 
 +
For more info, see [https://developers.google.com/protocol-buffers/docs/proto#updating protobuf messages updating guide].
 +
 
 +
== External links ==
 +
* https://developers.google.com/protocol-buffers/docs/proto#updating
  
 
[[Category:Development]]
 
[[Category:Development]]

Latest revision as of 18:31, 2 September 2016

Here are a few principles that must be taken into account while developing CRIU.

  • All shared resources must be restored by the task with the lowest PID among the group to avoid deadlocks.
  • No operations with file paths in restorer blob — task has restored its fs (cwd and root) and may see a different tree.
  • In dumping code, any fork()+exec() should be done using the cr_system() helper to avoid interfering with victim task tracing.

Protobuf images compatibility[edit]

To retain backward compatibility of protobuf image files, follow these rules:

  • Don't change the numeric tags for any existing fields.
  • Any new fields that you add should be optional or repeated.
  • Non-required fields can be removed, as long as the tag number is not used again in your updated message type.

For more info, see protobuf messages updating guide.

External links[edit]