<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://criu.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Efiop</id>
	<title>CRIU - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://criu.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Efiop"/>
	<link rel="alternate" type="text/html" href="https://criu.org/Special:Contributions/Efiop"/>
	<updated>2026-04-08T21:08:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.6</generator>
	<entry>
		<id>https://criu.org/index.php?title=Todo&amp;diff=5218</id>
		<title>Todo</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Todo&amp;diff=5218"/>
		<updated>2021-12-06T08:33:14Z</updated>

		<summary type="html">&lt;p&gt;Efiop: remove @efiop's asignees&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|This list is being transformed into the [https://github.com/checkpoint-restore/criu/issues github issues]}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! component&lt;br /&gt;
! task&lt;br /&gt;
! complexity&lt;br /&gt;
! potential/willing assignee&lt;br /&gt;
! comments&lt;br /&gt;
|-&lt;br /&gt;
| tests || automate process of measurement code coverage || easy || - || It is required to automate process of getting code coverage. We have code coverage results [http://criu.org/cov/ measured in 2012]. Would be nice to get up to date results on periodic basis and without manual actions.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Inherit resources, not restore || medium || - || Sigactions are restored for every task before it fork()-s. Then children check for the sa_action from their image matches to one it got from parent. Need to do the same for rlimits, maybe other resources too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Implement [[restorer v2]] || hard (v2) || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || New images format || medium (v2) || - || See [[what's bad with V1 images]] &lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Tune the start-time of tasks || medium || - || When we restore tasks their start-time goes forward (since we create the new task effectively). Need to address this somehow, most likely with the [[time namespace]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support chroot-ed mount namespace || medium || - || If the root task lives in another mount namespace ''and'' has its root moved (with chroot()) CRIU dump fails with errors about inability to resolve files' paths. This is because CRIU treats the mount namespace's root as the init task's root which should be &amp;quot;/&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Non-stop memory (first?) pre-dump || medium || - || When reading only the memory we can avoid freezing tasks and draining memory with parasite. There's a system call named &amp;quot;read_process_vm&amp;quot; which can help us accessing the other task's memory. The disadvantage of this approach is the need for additional memory. We may control this behaviour by reading memory in chunks and not allocating to much of additional buffers.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Speed up fetching info about tasks || medium || Andrey Vagin || Using proc to get info about tasks is nice but too slow. We have measured that having socket-based engine that would fetch info about tasks from the kernel speeds things up significantly. So Andrey is working on the [[Task-diag]] patchset that would implement that.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Make pipes swappable || hard || - || When [[Memory dumping and restoring|pre-dumping]] memory we pull all the task's memory into pipe with vmsplice and then send it via network splicing the pages into socket. During this period all the memory is effectively pinned as pages in pipe are not swappable.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Adjust per-task/-container timers offsets || medium || - || Absolute timers differ on different nodes. When live migrating a task/container this difference may (and will) screw the timers up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[time namespace|Shift timers' timeouts]] according to the actual C-to-R delay || medium || - || If we pause tasks between C and R we, probably, need to adjust timers respectively. &amp;quot;Medium&amp;quot; complexity is because it's unclear ''what'' to do, not ''how''.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Put call to mmap into VDSO || easy || Cyrill || To put the [[parasite code]] into target process we modify its code to call the &amp;lt;code&amp;gt;mmap()&amp;lt;/code&amp;gt; system call (and the unmodify it back) and put the parasite into new area. Oleg Nesterov suggests not to patch victim, but to always have one on VDSO.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Integration]] with other projects || hard || - || CRIU is not working great by itself. There's alway some specific about what user wants to dump. Integrating CRIU with other projects will make CRIU work at its best.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore tasks into fresh new pid namespace || easy || - || When we dumped processes, it can be hard to restore it back, if they didn't live in a pid namespace, due to PIDs conflict. It would be nice to have the ability to ask CRIU to create the pid namespace for those guys and restore them there. A thing to worry about is this new namespace's init task.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Rollback tree state || medium || - || When we checkpointed process tree with -R option (let them run after checkpoint) we might want to return the tasks into checkpointed state on the same machine. Currently this can only be done by killing the processes and restoring them from scratch. If we could ask CRIU to restore the images ''into'' the ready processes that could speed things up, especially if carefully caring about [[memory changes tracking]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary mountpoints tree || hard || - || Linux kernel can construct tricky knows with [[mount points]]. We don't support arbitrary configuration of such things, only those that are in active use by software. Need to fix them up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Lazy restore using [[userfaultfd]] || medium || xemul || It might make sense to restore tasks w/o putting all the memory into respective places. Instead, the VMAs in question can be marked as &amp;quot;lazy&amp;quot; and pages will get filled into them in the background and, upon demand, in the out-of-order manner. The functionality is related to lazy migration and seamless kernel update tasks.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Lazy migration]] using [[userfaultfd]] || medium || xemul || Lazy migration is when we move all the tasks on another node, but leave theirs memory on the source one. Not to allow tasks read garbage from empty address space we protect all of it as inaccessible. When tasks start reading/writing the mem they got page-fault-ed. With the userfaultfd technology it can be possible to intercept the #PF, pull the page from source node and map it into expected address.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Speed up [[logging]] || medium || Cyrill || Synchronous formatting and writes into log files slow things down. On the other hand turning logs off make it impossible to troubleshoot.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Sanitize [[logging]] messages || hard || - || Currently log messages are printed w/o any logic, it's hard to analize what has happened when CRIU fails. Need to improve that by, e.g. categorizing images and [[When C/R fails|explaining them]] in more details.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Page transfer filters || medium || - || The page-xfer engine just splices the pages from stealing pipes into socket. Packing or encrypting the data would be nice. Maybe it's purely for [[P.Haul]]?&lt;br /&gt;
|-&lt;br /&gt;
| crtools || TCP socket migration with changed IP || medium || - ||  It might make sense to migrate a tcp connection on a box with changed IP address _if_ both boxes are NAT-ed to the destination. We will then have to go to NAT box and fix the conntracks in that case and use CRIT images modifucation facilities.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Applying images]] || hard (v2) || xemul@ w/ students || Think about ability to take images and apply them to a living task(s). Like it was described in the &amp;quot;rollback&amp;quot; feature above. Another exampl -- repopulate fdtable according to data from image. Yet another use-case -- when doing partial migration (see below) we'll need to modify one part to switch from pipes to sockets. What else? With constant replication of tree state we can do incremental dumps on source node and apply those increments on pre-created replicas on the destination node.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Partial migration || hard || - || If tasks subtree has connections to the rest of the tree (e.g. with pipes of unix sockets) we try to detect this and refuse the dump. It should be possible to take part of the tree, migrating it somewhere and recreating the mentioned links with some other appropriate IPC channel. E.g. pipes with sockets, shared memory with distributed shared memory and so on.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shared objects (mm/fs) support || medium || - || Things created with CLONE_FOO flags are not supported now (exception -- full threads). Now we have the kcmp syscall and can do it. The shared fdtable (CLONE_FILES) is supported, the next candidate is mm sharing, as we do know, that MySQL does so sometimes.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Smart paths resolution || hard || - || Files can be overmounted. In this case CRIU will refuse the dump saying that file is [[invisible files|not alive]] but inaccessible by its name. Need a way to resolve paths to such. There are two ways: 1. Move mounts, that overlap the desired path temporarily, then open the file, then move the mountpoint back. 2. When creating a new mount pre-open an fd keeping the mountpoint. Later, do accurate path resolve and call openat() on proper mountpoint fd.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || [[TCP repair TODO|TCP repair fixes]] || hard || - || We can dump and restore live [[TCP connection]]. There are some issues with it, that should be fixed.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || [[Seamless kernel upgrade]] || hard || xemul || Briefly — dump tasks (into memory), change the kernel w/ kexec, then restore tasks back. From the tasks and remote client perspective tasks has just stopped and then resumed on the newer kernel. Can be a good complement to the classic live-patching technology.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary process tree || hard ||  - || Need to restore any process tree, which could be created with help PR_SET_CHILD_SUBREAPER and CLONE_PARENT. Processes can share other resources [http://man7.org/linux/man-pages/man2/clone2.2.html clone(2)]. Look at [https://github.com/checkpoint-restore/criu/blob/master/test/zdtm/static/session02.c session02]. The task of resolving the given images into operations we might need to perform seem to be NP (not proven though).&lt;br /&gt;
|-&lt;br /&gt;
| crtools || C/R [[X applications]] || hard || - || Dump/restore of graphical applications (see about [[integration]]). In case of X app part of its state is stored into the X-server. Need the way to fetch this state during dump and put this state back into the server on restore. Requires fixing the X-server software too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || More detailed RPC fail codes || easy || - || Currently only 3 typical errors are reported(see [https://github.com/checkpoint-restore/criu/blob/master/criu/include/cr-errno.h#L8 include/cr-errno.h]). Need to extend this set as currently it's hard to understand what has happened w/o analysing CRIU log files.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Make CRIU work on AArch32 with CONFIG_KUSER_HELPERS=n || medium || cov || CRIU currently fails on AArch32 kernels built with CONFIG_KUSER_HELPERS=n.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Run many/all tests in &amp;quot;container&amp;quot; || medium || - || Currently we run zdtm tests one-by-one. It would be nice to run the all in one pseudo-container and C/R them as one big subtree.&lt;br /&gt;
|-&lt;br /&gt;
| tests || [[Fuzz testing|Trinity-like (fuzz) testing]] || hard || - || The existing suite is 99% functionality testing. Need more sophisticated testing -- take a process that has done a random set of actions, C/R one, check that all is OK. The latter is the most complicated thing.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Set checkpoint tokens without recompiling || medium || - || Sometimes you need to call checkpoint in some particular point of the code. The way to do it now is to recompile app with criu_dump() call where needed. But it is quite a bummer to recompile, repackage and redistribute an app you want to c/r. It would be great if one could set a token in app source and then let criu find that point in running task and take a snapshot. The best way to do it might be in libcriu.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Large ghost files support || medium || - || If we have a large ghost (opened unlinked) file, it's inefficient to copy it to another node via CRIU dump. Need to migrate them independently, iteratively, using memory tracking.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Plans]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Criu-coredump&amp;diff=2972</id>
		<title>Criu-coredump</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Criu-coredump&amp;diff=2972"/>
		<updated>2016-07-12T13:43:18Z</updated>

		<summary type="html">&lt;p&gt;Efiop: Fix page to describe current coredump statate&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Generate valid core dump from CRIU images.&lt;br /&gt;
=== Description ===&lt;br /&gt;
Criu-coredump is a tool that takes a directory with CRIU images and produces Elf cores.&lt;br /&gt;
&lt;br /&gt;
It consists of a python script(criu/coredump/criu-coredump) for cmdline use, as well as a python module(criu/coredump/criu_coredump) to manipulate generated cores on a deeper level.&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
As the main goal of CRIU is to be able to save process tree on disk to be restored later, the amount of information its images contain is much bigger than what is typically contained in a core dump(i.e. memory + few notes). That and the fact that CRIU provides a number of convenient API's, in theory gives anyone an ability to use CRIU for debugging their applications, i.e. like the abandoned google-coredumper allows you to generate core dumps at any time. But in practice, there are no tools that have native support for criu images, making it impossible to conveniently use them for such purpose. So it would be nice if we could convert criu images into much more common core dumps to be used with a great variety of available tools.&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&lt;br /&gt;
For now only x86_64 is supported. The matter of supporting other architectures supported by CRIU is to use proper constants in elf header and provide proper arch-dependent notes.&lt;br /&gt;
&lt;br /&gt;
Some notes in coredump are not fullfilled(i.e. SIGINFO).&lt;br /&gt;
&lt;br /&gt;
VVAR and VSYSCALL vmas are just filled with zeroes, as CRIU doesn't currently provide them. VVAR is a tricky one and gdb also has problems dumping it[https://lkml.org/lkml/2015/3/12/439]. VSYSCALL in theory could just be read from current process, so it should be quite easy to fix.&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
criu-coredump [-h] [-i IN] [-p PID] [-o OUT]                         &lt;br /&gt;
                                                                            &lt;br /&gt;
CRIU core dump                                                              &lt;br /&gt;
                                                                            &lt;br /&gt;
optional arguments:                                                         &lt;br /&gt;
  -h, --help         show this help message and exit                        &lt;br /&gt;
  -i IN, --in IN     directory where to get images from                     &lt;br /&gt;
  -p PID, --pid PID  generate coredump for specific pid(all pids py default)&lt;br /&gt;
  -o OUT, --out OUT  directory to write coredumps to                        &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Project resources ===&lt;br /&gt;
[https://asciinema.org/a/18936 Demo] of a previous version of criu-coredump, when it was planned to be a part of CRIT.&lt;br /&gt;
&lt;br /&gt;
[[Category:Sub-projects]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Todo&amp;diff=2913</id>
		<title>Todo</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Todo&amp;diff=2913"/>
		<updated>2016-05-06T19:15:40Z</updated>

		<summary type="html">&lt;p&gt;Efiop: rm patch tester task&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{note|This list is being transformed into the [https://github.com/xemul/criu/issues github issues]}}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! component&lt;br /&gt;
! task&lt;br /&gt;
! complexity&lt;br /&gt;
! potential/willing assignee&lt;br /&gt;
! comments&lt;br /&gt;
|-&lt;br /&gt;
| tests || automate process of measurement code coverage || easy || - || It is required to automate process of getting code coverage. We have code coverage results [http://criu.org/cov/ measured in 2012]. Would be nice to get up to date results on periodic basis and without manual actions.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Inherit resources, not restore || medium || - || Sigactions are restored for every task before it fork()-s. Then children check for the sa_action from their image matches to one it got from parent. Need to do the same for rlimits, maybe other resources too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Implement [[restorer v2]] || hard (v2) || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || New images format || medium (v2) || - || See [[what's bad with V1 images]] &lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Tune the start-time of tasks || medium || - || When we restore tasks their start-time goes forward (since we create the new task effectively). Need to address this somehow, most likely with the [[time namespace]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support chroot-ed mount namespace || medium || - || If the root task lives in another mount namespace ''and'' has its root moved (with chroot()) CRIU dump fails with errors about inability to resolve files' paths. This is because CRIU treats the mount namespace's root as the init task's root which should be &amp;quot;/&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Non-stop memory (first?) pre-dump || medium || - || When reading only the memory we can avoid freezing tasks and draining memory with parasite. There's a system call named &amp;quot;read_process_vm&amp;quot; which can help us accessing the other task's memory. The disadvantage of this approach is the need for additional memory. We may control this behaviour by reading memory in chunks and not allocating to much of additional buffers.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Speed up fetching info about tasks || medium || Andrey Vagin || Using proc to get info about tasks is nice but too slow. We have measured that having socket-based engine that would fetch info about tasks from the kernel speeds things up significantly. So Andrey is working on the [[Task-diag]] patchset that would implement that.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Make pipes swappable || hard || - || When [[Memory dumping and restoring|pre-dumping]] memory we pull all the task's memory into pipe with vmsplice and then send it via network splicing the pages into socket. During this period all the memory is effectively pinned as pages in pipe are not swappable.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Adjust per-task/-container timers offsets || medium || - || Absolute timers differ on different nodes. When live migrating a task/container this difference may (and will) screw the timers up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[time namespace|Shift timers' timeouts]] according to the actual C-to-R delay || medium || - || If we pause tasks between C and R we, probably, need to adjust timers respectively. &amp;quot;Medium&amp;quot; complexity is because it's unclear ''what'' to do, not ''how''.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Put call to mmap into VDSO || easy || Cyrill || To put the [[parasite code]] into target process we modify its code to call the &amp;lt;code&amp;gt;mmap()&amp;lt;/code&amp;gt; system call (and the unmodify it back) and put the parasite into new area. Oleg Nesterov suggests not to patch victim, but to always have one on VDSO.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Integration]] with other projects || hard || - || CRIU is not working great by itself. There's alway some specific about what user wants to dump. Integrating CRIU with other projects will make CRIU work at its best.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore tasks into fresh new pid namespace || easy || Kuprieiev Ruslan || When we dumped processes, it can be hard to restore it back, if they didn't live in a pid namespace, due to PIDs conflict. It would be nice to have the ability to ask CRIU to create the pid namespace for those guys and restore them there. A thing to worry about is this new namespace's init task.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Rollback tree state || medium || - || When we checkpointed process tree with -R option (let them run after checkpoint) we might want to return the tasks into checkpointed state on the same machine. Currently this can only be done by killing the processes and restoring them from scratch. If we could ask CRIU to restore the images ''into'' the ready processes that could speed things up, especially if carefully caring about [[memory changes tracking]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary mountpoints tree || hard || - || Linux kernel can construct tricky knows with [[mount points]]. We don't support arbitrary configuration of such things, only those that are in active use by software. Need to fix them up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Lazy restore using [[userfaultfd]] || medium || xemul || It might make sense to restore tasks w/o putting all the memory into respective places. Instead, the VMAs in question can be marked as &amp;quot;lazy&amp;quot; and pages will get filled into them in the background and, upon demand, in the out-of-order manner. The functionality is related to lazy migration and seamless kernel update tasks.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Lazy migration]] using [[userfaultfd]] || medium || xemul || Lazy migration is when we move all the tasks on another node, but leave theirs memory on the source one. Not to allow tasks read garbage from empty address space we protect all of it as inaccessible. When tasks start reading/writing the mem they got page-fault-ed. With the userfaultfd technology it can be possible to intercept the #PF, pull the page from source node and map it into expected address.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Speed up [[logging]] || medium || Cyrill || Synchronous formatting and writes into log files slow things down. On the other hand turning logs off make it impossible to troubleshoot.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Sanitize [[logging]] messages || hard || - || Currently log messages are printed w/o any logic, it's hard to analize what has happened when CRIU fails. Need to improve that by, e.g. categorizing images and [[When C/R fails|explaining them]] in more details.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Page transfer filters || medium || - || The page-xfer engine just splices the pages from stealing pipes into socket. Packing or encrypting the data would be nice. Maybe it's purely for [[P.Haul]]?&lt;br /&gt;
|-&lt;br /&gt;
| crtools || TCP socket migration with changed IP || medium || - ||  It might make sense to migrate a tcp connection on a box with changed IP address _if_ both boxes are NAT-ed to the destination. We will then have to go to NAT box and fix the conntracks in that case and use CRIT images modifucation facilities.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Applying images]] || hard (v2) || xemul@ w/ students || Think about ability to take images and apply them to a living task(s). Like it was described in the &amp;quot;rollback&amp;quot; feature above. Another exampl -- repopulate fdtable according to data from image. Yet another use-case -- when doing partial migration (see below) we'll need to modify one part to switch from pipes to sockets. What else? With constant replication of tree state we can do incremental dumps on source node and apply those increments on pre-created replicas on the destination node.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Partial migration || hard || - || If tasks subtree has connections to the rest of the tree (e.g. with pipes of unix sockets) we try to detect this and refuse the dump. It should be possible to take part of the tree, migrating it somewhere and recreating the mentioned links with some other appropriate IPC channel. E.g. pipes with sockets, shared memory with distributed shared memory and so on.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shared objects (mm/fs) support || medium || - || Things created with CLONE_FOO flags are not supported now (exception -- full threads). Now we have the kcmp syscall and can do it. The shared fdtable (CLONE_FILES) is supported, the next candidate is mm sharing, as we do know, that MySQL does so sometimes.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Smart paths resolution || hard || - || Files can be overmounted. In this case CRIU will refuse the dump saying that file is [[invisible files|not alive]] but inaccessible by its name. Need a way to resolve paths to such. There are two ways: 1. Move mounts, that overlap the desired path temporarily, then open the file, then move the mountpoint back. 2. When creating a new mount pre-open an fd keeping the mountpoint. Later, do accurate path resolve and call openat() on proper mountpoint fd.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || [[TCP repair TODO|TCP repair fixes]] || hard || - || We can dump and restore live [[TCP connection]]. There are some issues with it, that should be fixed.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || [[Seamless kernel upgrade]] || hard || xemul || Briefly — dump tasks (into memory), change the kernel w/ kexec, then restore tasks back. From the tasks and remote client perspective tasks has just stopped and then resumed on the newer kernel. Can be a good complement to the classic live-patching technology.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary process tree || hard ||  - || Need to restore any process tree, which could be created with help PR_SET_CHILD_SUBREAPER and CLONE_PARENT. Processes can share other resources [http://man7.org/linux/man-pages/man2/clone2.2.html clone(2)]. Look at [https://github.com/xemul/criu/blob/master/test/zdtm/live/static/session02.c session02]. The task of resolving the given images into operations we might need to perform seem to be NP (not proven though).&lt;br /&gt;
|-&lt;br /&gt;
| crtools || C/R [[X applications]] || hard || Ruslan Kuprieiev || Dump/restore of graphical applications (see about [[integration]]). In case of X app part of its state is stored into the X-server. Need the way to fetch this state during dump and put this state back into the server on restore. Requires fixing the X-server software too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || More detailed RPC fail codes || easy || - || Currently only 3 typical errors are reported(see [https://github.com/xemul/criu/blob/master/include/cr-errno.h#L8 include/cr-errno.h]). Need to extend this set as currently it's hard to understand what has happened w/o analysing CRIU log files.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Make CRIU work on AArch32 with CONFIG_KUSER_HELPERS=n || medium || cov || CRIU currently fails on AArch32 kernels built with CONFIG_KUSER_HELPERS=n.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Fix VDSO remapping on non-x86 architectures || medium || Laurent Dufour, cov || However some architectures like PowerPC and ARM are keeping a reference to the VDSO base address to build the signal return stack frame by calling the VDSO sigreturn service. So once the VDSO has been moved, this reference is no more valid and the signal frame built later are not usable.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Run many/all tests in &amp;quot;container&amp;quot; || medium || - || Currently we run zdtm tests one-by-one. It would be nice to run the all in one pseudo-container and C/R them as one big subtree.&lt;br /&gt;
|-&lt;br /&gt;
| tests || [[Fuzz testing|Trinity-like (fuzz) testing]] || hard || - || The existing suite is 99% functionality testing. Need more sophisticated testing -- take a process that has done a random set of actions, C/R one, check that all is OK. The latter is the most complicated thing.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Set checkpoint tokens without recompiling || medium || - || Sometimes you need to call checkpoint in some particular point of the code. The way to do it now is to recompile app with criu_dump() call where needed. But it is quite a bummer to recompile, repackage and redistribute an app you want to c/r. It would be great if one could set a token in app source and then let criu find that point in running task and take a snapshot. The best way to do it might be in libcriu.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Large ghost files support || medium || - || If we have a large ghost (opened unlinked) file, it's inefficient to copy it to another node via CRIU dump. Need to migrate them independently, iteratively, using memory tracking.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Plans]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Todo&amp;diff=2640</id>
		<title>Todo</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Todo&amp;diff=2640"/>
		<updated>2015-09-28T11:57:15Z</updated>

		<summary type="html">&lt;p&gt;Efiop: checkpoint tokens without recompiling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This list is being transformed into the github issues @ https://github.com/xemul/criu/issues&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! component&lt;br /&gt;
! task&lt;br /&gt;
! complexity&lt;br /&gt;
! potential/willing assignee&lt;br /&gt;
! comments&lt;br /&gt;
|-&lt;br /&gt;
| tests || automate process of measurement code coverage || easy || - || It is required to automate process of getting code coverage. We have code coverage results [http://criu.org/cov/ measured in 2012]. Would be nice to get up to date results on periodic basis and without manual actions.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Inherit resources, not restore || medium || - || Sigactions are restored for every task before it fork()-s. Then children check for the sa_action from their image matches to one it got from parent. Need to do the same for rlimits, maybe other resources too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Implement [[restorer v2]] || hard (v2) || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || New images format || medium (v2) || - || See [[what's bad with V1 images]] &lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Tune the start-time of tasks || medium || - || When we restore tasks their start-time goes forward (since we create the new task effectively). Need to address this somehow, most likely with the [[time namespace]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support chroot-ed mount namespace || medium || - || If the root task lives in another mount namespace ''and'' has its root moved (with chroot()) CRIU dump fails with errors about inability to resolve files' paths. This is because CRIU treats the mount namespace's root as the init task's root which should be &amp;quot;/&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Non-stop memory (first?) pre-dump || medium || - || When reading only the memory we can avoid freezing tasks and draining memory with parasite. There's a system call named &amp;quot;read_process_vm&amp;quot; which can help us accessing the other task's memory. The disadvantage of this approach is the need for additional memory. We may control this behaviour by reading memory in chunks and not allocating to much of additional buffers.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Speed up fetching info about tasks || medium || Andrey Vagin || Using proc to get info about tasks is nice but too slow. We have measured that having socket-based engine that would fetch info about tasks from the kernel speeds things up significantly. So Andrey is working on the [[Task-diag]] patchset that would implement that.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Make pipes swappable || hard || - || When [[Memory dumping and restoring|pre-dumping]] memory we pull all the task's memory into pipe with vmsplice and then send it via network splicing the pages into socket. During this period all the memory is effectively pinned as pages in pipe are not swappable.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Adjust per-task/-container timers offsets || medium || - || Absolute timers differ on different nodes. When live migrating a task/container this difference may (and will) screw the timers up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[time namespace|Shift timers' timeouts]] according to the actual C-to-R delay || medium || - || If we pause tasks between C and R we, probably, need to adjust timers respectively. &amp;quot;Medium&amp;quot; complexity is because it's unclear ''what'' to do, not ''how''.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Put call to mmap into VDSO || easy || Cyrill || To put the [[parasite code]] into target process we modify its code to call the &amp;lt;code&amp;gt;mmap()&amp;lt;/code&amp;gt; system call (and the unmodify it back) and put the parasite into new area. Oleg Nesterov suggests not to patch victim, but to always have one on VDSO.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Integration]] with other projects || hard || - || CRIU is not working great by itself. There's alway some specific about what user wants to dump. Integrating CRIU with other projects will make CRIU work at its best.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore tasks into fresh new pid namespace || easy || Kuprieiev Ruslan || When we dumped processes, it can be hard to restore it back, if they didn't live in a pid namespace, due to PIDs conflict. It would be nice to have the ability to ask CRIU to create the pid namespace for those guys and restore them there. A thing to worry about is this new namespace's init task.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Rollback tree state || medium || - || When we checkpointed process tree with -R option (let them run after checkpoint) we might want to return the tasks into checkpointed state on the same machine. Currently this can only be done by killing the processes and restoring them from scratch. If we could ask CRIU to restore the images ''into'' the ready processes that could speed things up, especially if carefully caring about [[memory changes tracking]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary mountpoints tree || hard || - || Linux kernel can construct tricky knows with [[mount points]]. We don't support arbitrary configuration of such things, only those that are in active use by software. Need to fix them up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Lazy restore using [[userfaultfd]] || medium || xemul || It might make sense to restore tasks w/o putting all the memory into respective places. Instead, the VMAs in question can be marked as &amp;quot;lazy&amp;quot; and pages will get filled into them in the background and, upon demand, in the out-of-order manner. The functionality is related to lazy migration and seamless kernel update tasks.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Lazy migration]] using [[userfaultfd]] || medium || xemul || Lazy migration is when we move all the tasks on another node, but leave theirs memory on the source one. Not to allow tasks read garbage from empty address space we protect all of it as inaccessible. When tasks start reading/writing the mem they got page-fault-ed. With the userfaultfd technology it can be possible to intercept the #PF, pull the page from source node and map it into expected address.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Speed up [[logging]] || medium || Cyrill || Synchronous formatting and writes into log files slow things down. On the other hand turning logs off make it impossible to troubleshoot.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Sanitize [[logging]] messages || hard || - || Currently log messages are printed w/o any logic, it's hard to analize what has happened when CRIU fails. Need to improve that by, e.g. categorizing images and [[When C/R fails|explaining them]] in more details.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Page transfer filters || medium || - || The page-xfer engine just splices the pages from stealing pipes into socket. Packing or encrypting the data would be nice. Maybe it's purely for [[P.Haul]]?&lt;br /&gt;
|-&lt;br /&gt;
| crtools || TCP socket migration with changed IP || medium || - ||  It might make sense to migrate a tcp connection on a box with changed IP address _if_ both boxes are NAT-ed to the destination. We will then have to go to NAT box and fix the conntracks in that case and use CRIT images modifucation facilities.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Applying images]] || hard (v2) || xemul@ w/ students || Think about ability to take images and apply them to a living task(s). Like it was described in the &amp;quot;rollback&amp;quot; feature above. Another exampl -- repopulate fdtable according to data from image. Yet another use-case -- when doing partial migration (see below) we'll need to modify one part to switch from pipes to sockets. What else? With constant replication of tree state we can do incremental dumps on source node and apply those increments on pre-created replicas on the destination node.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Partial migration || hard || - || If tasks subtree has connections to the rest of the tree (e.g. with pipes of unix sockets) we try to detect this and refuse the dump. It should be possible to take part of the tree, migrating it somewhere and recreating the mentioned links with some other appropriate IPC channel. E.g. pipes with sockets, shared memory with distributed shared memory and so on.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shared objects (mm/fs) support || medium || - || Things created with CLONE_FOO flags are not supported now (exception -- full threads). Now we have the kcmp syscall and can do it. The shared fdtable (CLONE_FILES) is supported, the next candidate is mm sharing, as we do know, that MySQL does so sometimes.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Smart paths resolution || hard || - || Files can be overmounted. In this case CRIU will refuse the dump saying that file is [[invisible files|not alive]] but inaccessible by its name. Need a way to resolve paths to such. There are two ways: 1. Move mounts, that overlap the desired path temporarily, then open the file, then move the mountpoint back. 2. When creating a new mount pre-open an fd keeping the mountpoint. Later, do accurate path resolve and call openat() on proper mountpoint fd.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || [[TCP repair TODO|TCP repair fixes]] || hard || - || We can dump and restore live [[TCP connection]]. There are some issues with it, that should be fixed.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || [[Seamless kernel upgrade]] || hard || xemul || Briefly — dump tasks (into memory), change the kernel w/ kexec, then restore tasks back. From the tasks and remote client perspective tasks has just stopped and then resumed on the newer kernel. Can be a good complement to the classic live-patching technology.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary process tree || hard ||  - || Need to restore any process tree, which could be created with help PR_SET_CHILD_SUBREAPER and CLONE_PARENT. Processes can share other resources [http://man7.org/linux/man-pages/man2/clone2.2.html clone(2)]. Look at [http://git.criu.org/?p=crtools.git;a=blob;f=test/zdtm/live/static/session02.c;hb=HEAD session02]. The task of resolving the given images into operations we might need to perform seem to be NP (not proven though).&lt;br /&gt;
|-&lt;br /&gt;
| crtools || C/R [[X applications]] || hard || Ruslan Kuprieiev || Dump/restore of graphical applications (see about [[integration]]). In case of X app part of its state is stored into the X-server. Need the way to fetch this state during dump and put this state back into the server on restore. Requires fixing the X-server software too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || More detailed RPC fail codes || easy || - || Currently only 3 typical errors are reported(see [https://github.com/xemul/criu/blob/master/include/cr-errno.h#L8 include/cr-errno.h]). Need to extend this set as currently it's hard to understand what has happened w/o analysing CRIU log files.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Make CRIU work on AArch32 with CONFIG_KUSER_HELPERS=n || medium || cov || CRIU currently fails on AArch32 kernels built with CONFIG_KUSER_HELPERS=n.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Fix VDSO remapping on non-x86 architectures || medium || Laurent Dufour, cov || However some architectures like PowerPC and ARM are keeping a reference to the VDSO base address to build the signal return stack frame by calling the VDSO sigreturn service. So once the VDSO has been moved, this reference is no more valid and the signal frame built later are not usable.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Run many/all tests in &amp;quot;container&amp;quot; || medium || - || Currently we run zdtm tests one-by-one. It would be nice to run the all in one pseudo-container and C/R them as one big subtree.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Trinity-like (fuzz) testing || hard || - || The existing suite is 99% functionality testing. Need more sophisticated testing -- take a process that has done a random set of actions, C/R one, check that all is OK. The latter is the most complicated thing.&lt;br /&gt;
|-&lt;br /&gt;
| tests/infrastructure || Run tests on patches sent to the mailing lists || medium || Ruslan Kuprieiev || It's quite typical that a set sent to the mailing list fails some tests. Need a robot that would monitor the list, check the patches and send the result back.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Set checkpoint tokens without recompiling || medium || - || Sometimes you need to call checkpoint in some particular point of the code. The way to do it now is to recompile app with criu_dump() call where needed. But it is quite a bummer to recompile, repackage and redistribute an app you want to c/r. It would be great if one could set a token in app source and then let criu find that point in running task and take a snapshot. The best way to do it might be in libcriu.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Plans]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Todo&amp;diff=2589</id>
		<title>Todo</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Todo&amp;diff=2589"/>
		<updated>2015-09-04T00:25:24Z</updated>

		<summary type="html">&lt;p&gt;Efiop: --leave-stopped for restore&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! component&lt;br /&gt;
! task&lt;br /&gt;
! complexity&lt;br /&gt;
! potential/willing assignee&lt;br /&gt;
! comments&lt;br /&gt;
|-&lt;br /&gt;
| crtools/crit || Library/API to access pagemap+page images || medium || - || The [[memory dumps]] are quite sophisticated. It would be nice to have a library or API to access the data in them using some simple API. IOW -- API-ize the page_read.c&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Zombies with threads :) || easy || - || When milti-thread task's leader thread exits task turns into zombie state, but the other threads keep running. Need to support this (zdt test pthread02).&lt;br /&gt;
|-&lt;br /&gt;
| tests || automate process of measurement code coverage || easy || - || It is required to automate process of getting code coverage. We have code coverage results [http://criu.org/cov/ measured in 2012]. Would be nice to get up to date results on periodic basis and without manual actions.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Non-full mntns dump || medium || - || Systemd launches services in a new mount namespace with a single change -- /tmp is re-mounted into a private one(PrivateTmp option). Need to invent an API for dumping only a part of mntns.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Remap [[Vdso]] || medium || - || When at restore VDSO is found not in the place it was on dump we should &amp;lt;code&amp;gt;mremap()&amp;lt;/code&amp;gt; one. Unfortunately not always we can do it, need to fix the kernel.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Make dump and restore work under [[selinux]] || medium || - || Selinux imposes more restrictions on the stuff we typically do.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Inherit resources, not restore || medium || - || Sigactions are restored for every task before it fork()-s. Then children check for the sa_action from their image matches to one it got from parent. Need to do the same for rlimits, maybe other resources too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Implement [[restorer v2]] || hard (v2) || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || New images format || medium (v2) || - || See [[what's bad with V1 images]] &lt;br /&gt;
|-&lt;br /&gt;
| crtools || Make [[RPC]] &amp;quot;swrk&amp;quot; mode public || medium || xemul || There's an &amp;quot;swrk&amp;quot; action in CRIU [[Usage|CLI API]]. This turns CRIU into service worker accepting RPC commands. This mode is not documented. Need to standartify one and make public.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Tune the start-time of tasks || medium || - || When we restore tasks their start-time goes forward (since we create the new task effectively). Need to address this somehow, most likely with the [[time namespace]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support chroot-ed mount namespace || medium || - || If the root task lives in another mount namespace ''and'' has its root moved (with chroot()) CRIU dump fails with errors about inability to resolve files' paths. This is because CRIU treats the mount namespace's root as the init task's root which should be &amp;quot;/&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Non-stop memory (first?) pre-dump || medium || - || When reading only the memory we can avoid freezing tasks and draining memory with parasite. There's a system call named &amp;quot;read_process_vm&amp;quot; which can help us accessing the other task's memory. The disadvantage of this approach is the need for additional memory. We may control this behaviour by reading memory in chunks and not allocating to much of additional buffers.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Speed up fetching info about tasks || medium || Andrey Vagin || Using proc to get info about tasks is nice but too slow. We have measured that having socket-based engine that would fetch info about tasks from the kernel speeds things up significantly. So Andrey is working on the [[Task-diag]] patchset that would implement that.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Make pipes swappable || hard || - || When [[Memory dumping and restoring|pre-dumping]] memory we pull all the task's memory into pipe with vmsplice and then send it via network splicing the pages into socket. During this period all the memory is effectively pinned as pages in pipe are not swappable.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Deduplication for shmem [[memory dumps]] || easy || - || We have dedup action and --auto-dedup option for dump/restore which only works for pid pagemaps. Need the same for shmem.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Adjust per-task/-container timers offsets || medium || - || Absolute timers differ on different nodes. When live migrating a task/container this difference may (and will) screw the timers up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[time namespace|Shift timers' timeouts]] according to the actual C-to-R delay || medium || - || If we pause tasks between C and R we, probably, need to adjust timers respectively. &amp;quot;Medium&amp;quot; complexity is because it's unclear ''what'' to do, not ''how''.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Show what was left in the system after dump || easy || - || When we use [[Invisible files|--link-remap]] option or [[TCP connection|--tcp-established]] one CRIU leaves some traces in the system, in particular -- temporary hard links in the former case and iptables rules in the latter. Need some way to show these to the user.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Decode flags from images into symbolic names || easy || - || When we print images contents with [[CRIT]] the flags fields are shown in decimal/hex numbers. It would be nice to print the symbolic names for known flags in some form.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Leases support || easy || - || The F_SETLEASE/F_GETLEASE API is not currently supported, but doesn't differ much from regular locks.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Put call to mmap into VDSO || easy || Cyrill || To put the [[parasite code]] into target process we modify its code to call the &amp;lt;code&amp;gt;mmap()&amp;lt;/code&amp;gt; system call (and the unmodify it back) and put the parasite into new area. Oleg Nesterov suggests not to patch victim, but to always have one on VDSO.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Integration]] with other projects || hard || - || CRIU is not working great by itself. There's alway some specific about what user wants to dump. Integrating CRIU with other projects will make CRIU work at its best.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore tasks into fresh new pid namespace || easy || Kuprieiev Ruslan || When we dumped processes, it can be hard to restore it back, if they didn't live in a pid namespace, due to PIDs conflict. It would be nice to have the ability to ask CRIU to create the pid namespace for those guys and restore them there. A thing to worry about is this new namespace's init task.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Rollback tree state || medium || - || When we checkpointed process tree with -R option (let them run after checkpoint) we might want to return the tasks into checkpointed state on the same machine. Currently this can only be done by killing the processes and restoring them from scratch. If we could ask CRIU to restore the images ''into'' the ready processes that could speed things up, especially if carefully caring about [[memory changes tracking]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || AIO with pending events || medium || - || When we dump AIO ring we check it not to contain events inside and abort the dump otherwise. Need to dump events too and put them back on restore.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary mountpoints tree || hard || - || Linux kernel can construct tricky knows with [[mount points]]. We don't support arbitrary configuration of such things, only those that are in active use by software. Need to fix them up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Lazy restore using [[userfaultfd]] || medium || xemul || It might make sense to restore tasks w/o putting all the memory into respective places. Instead, the VMAs in question can be marked as &amp;quot;lazy&amp;quot; and pages will get filled into them in the background and, upon demand, in the out-of-order manner. The functionality is related to lazy migration and seamless kernel update tasks.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Lazy migration]] using [[userfaultfd]] || medium || xemul || Lazy migration is when we move all the tasks on another node, but leave theirs memory on the source one. Not to allow tasks read garbage from empty address space we protect all of it as inaccessible. When tasks start reading/writing the mem they got page-fault-ed. With the userfaultfd technology it can be possible to intercept the #PF, pull the page from source node and map it into expected address.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Dump tasks from cgroup || easy || - || Currently criu dumps a subtree from given pid. It makes sense to request CRIU to dump a set of tasks from given cgroup.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Speed up [[logging]] || medium || Cyrill || Synchronous formatting and writes into log files slow things down. On the other hand turning logs off make it impossible to troubleshoot.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Sanitize [[logging]] messages || hard || - || Currently log messages are printed w/o any logic, it's hard to analize what has happened when CRIU fails. Need to improve that by, e.g. categorizing images and [[When C/R fails|explaining them]] in more details.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support OFD posix locks || easy || - || These are still rarely used, but exist. Might make sense to support them in advance, it looks like kernel API allows for that.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Optimize kcmp calls || medium || - || CRIU build [[kcmp trees]] to find out IDs of such objects as MM, FDT and others. Currently we kcmp all tasks to get the ID, but we can improve that by pre-generating ID based on objects that live on MM, FS, etc. If pre-ID of two tasks matches, then we call kcmp, if not -- objects ''are'' different.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shmem changes tracking || medium || - || Memory changes tracker works on anonymous private mappings only. Anonymous shmem is not in active use by server applications, so we don't support one currently. Supporting it should be done by tracking the changes from all the tasks that ''could'' write into the segment. For anon shared memory and sysvipc segment inside IPC namespace this works reliably.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Page transfer filters || medium || - || The page-xfer engine just splices the pages from stealing pipes into socket. Packing or encrypting the data would be nice. Maybe it's purely for [[P.Haul]]?&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[FUSE]] mount points || hard || - || When dumping mountpoints we explicitly check the filesystem mounted. The thing is -- not all filesystems can be just ignored on dump. E.g. FUSE mount involves a user-space daemon that is responsible for the files tree contents. If we just kill one on dump we might not be able to restore it. Need to special-care one.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || 32-bit tasks || hard || Cyrill || For x86 we only dump and restore 64-bit tasks. Doing 32-bit should also be done, but keep in mind, that not only 64-bit tree OR 32-bit tree should be supported. There can be mixed 64-and-32-bit trees out there and CRIU should support those too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Modify restored resources run-time in [[CRIT]] daemon || medium || - || Sometimes it might make sense to tune the objects fro images on restore. E.g. -- change the IP address of sockets from task above or fix file paths to be &amp;quot;chroot-ed&amp;quot;. The best solution seems to be in launching CRIT in daemon mode, telling it what images and how to modify and teaching CRIU to &amp;quot;filter&amp;quot; the pb objects read from images through this daemon.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || TCP socket migration with changed IP || medium || - ||  It might make sense to migrate a tcp connection on a box with changed IP address _if_ both boxes are NAT-ed to the destination. We will then have to go to NAT box and fix the conntracks in that case and use CRIT images modifucation facilities.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Applying images]] || hard (v2) || xemul@ w/ students || Think about ability to take images and apply them to a living task(s). Like it was described in the &amp;quot;rollback&amp;quot; feature above. Another exampl -- repopulate fdtable according to data from image. Yet another use-case -- when doing partial migration (see below) we'll need to modify one part to switch from pipes to sockets. What else? With constant replication of tree state we can do incremental dumps on source node and apply those increments on pre-created replicas on the destination node.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Partial migration || hard || - || If tasks subtree has connections to the rest of the tree (e.g. with pipes of unix sockets) we try to detect this and refuse the dump. It should be possible to take part of the tree, migrating it somewhere and recreating the mentioned links with some other appropriate IPC channel. E.g. pipes with sockets, shared memory with distributed shared memory and so on.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shared objects (mm/fs) support || medium || - || Things created with CLONE_FOO flags are not supported now (exception -- full threads). Now we have the kcmp syscall and can do it. The shared fdtable (CLONE_FILES) is supported, the next candidate is mm sharing, as we do know, that MySQL does so sometimes.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Smart paths resolution || hard || - || Files can be overmounted. In this case CRIU will refuse the dump saying that file is [[invisible files|not alive]] but inaccessible by its name. Need a way to resolve paths to such. There are two ways: 1. Move mounts, that overlap the desired path temporarily, then open the file, then move the mountpoint back. 2. When creating a new mount pre-open an fd keeping the mountpoint. Later, do accurate path resolve and call openat() on proper mountpoint fd.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || [[TCP repair TODO|TCP repair fixes]] || hard || - || We can dump and restore live [[TCP connection]]. There are some issues with it, that should be fixed.&lt;br /&gt;
|-&lt;br /&gt;
| kernel?/crtools || TCP conntrack-ed connections || medium || - || When a container uses conntracks inside, we cannot just dump and restore alive TCP connection. Otherwise on restore the resurrected packets will be blocked by connection tracker as they would not be recognized as established connection. Need to check whether connection tracking is ON, dump the needed conntrack info and put the tracker back.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Bridges in container || medium || - || The bridge device state should be read, saved and restored.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || VLANs in containers || medium || - || Vlan (802.1q) device state should be read, saved and restored.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[PPP]] support || medium || - || PPP consists of several things, not just ppp devices. If container uses PPP we should take care of it, currently CRIU just aborts.&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || [[NFS mount points]] support || hard || - || NFS mount points from inside container cannot be easily restored. The thing is -- if we want to restore opened file we will go ahead and [[How hard is it to open a file|call]] the open system call. If the file in question resides on NFS, the latter might need to go to network to check whether the file actually exists and set up the handle. But if the networking is still not restored this operation would fail and we'll have to fail the whole restore. In order to untie this chicken-and-egg problem we may go in two directions.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || [[Seamless kernel upgrade]] || hard || xemul || Briefly -- dump tasks (into memory), change the kernel w/ kexec, then restore tasks back. From the tasks and remote client perspective tasks has just stopped and then resumed on the newer kernel. Can be a good complement to the classic live-patching technology.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Validate .img files || easy || - || [[CRIT]] sub-task. For a given set of image files check, that they are in &amp;quot;restorable&amp;quot; shape, i.e. contain valid data and no pieces are missing.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary process tree || hard ||  - || Need to restore any process tree, which could be created with help PR_SET_CHILD_SUBREAPER and CLONE_PARENT. Processes can share other resources [http://man7.org/linux/man-pages/man2/clone2.2.html clone(2)]. Look at [http://git.criu.org/?p=crtools.git;a=blob;f=test/zdtm/live/static/session02.c;hb=HEAD session02]. The task of resolving the given images into operations we might need to perform seem to be NP (not proven though).&lt;br /&gt;
|-&lt;br /&gt;
| crtools || C/R [[X applications]] || hard || Ruslan Kuprieiev || Dump/restore of graphical applications (see about [[integration]]). In case of X app part of its state is stored into the X-server. Need the way to fetch this state during dump and put this state back into the server on restore. Requires fixing the X-server software too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || Undo semaphores || medium || Cyrill Gorcunov || These are SysVIPC objects created with semctl() and SEM_UNDO flag. Shame on us, we don't even detect these are created. Fortunately they are not in active use. Need to do it -- dump and restore. Requires modifications from both sides -- criu and kernel.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || More detailed RPC fail codes || easy || - || Currently only 3 typical errors are reported(see [https://github.com/xemul/criu/blob/master/include/cr-errno.h#L8 include/cr-errno.h]). Need to extend this set as currently it's hard to understand what has happened w/o analysing CRIU log files.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/criu || FS-notify queues || hard || - || We dump [[Fsnotify]] files, but when they contain events inside -- just ignore those. Need to fetch then and put back on restore. The difficulty here is that while dumping/restoring CRIU may touch files that are monitored and thus produce unwanted events into queue.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Remove hardcoded TASK_SIZE (at least for AArch32) || medium || cov || Dumping an AArch32 application using an AArch32 CRIU under an AArch64 kernel fails because TASK_SIZE is wrong. If TASK_SIZE were determined at runtime, the process would be able to proceed further. TASK_SIZE could be guessed using uname/cpuinfo and rules, probed with a series of accesses, or perhaps, following the example of PAGE_SIZE, the ELF auxiliary vector should include it.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Hardcoded PAGE_SIZE (at least for AArch64) || medium || cov || Dumping an AArch64 under an AArch64 kernel with 64K pages fails because PAGE_SIZE is wrong. Many uses of the PAGE_SIZE constant don't actually need an exact page size. Maybe split uses into PAGE_OR_LESS, EXEC_PAGESIZE (max possible for a platform), and page_size (actual value, probably pulled from auxv in memory or /proc or from smaps in /proc).&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Make CRIU work on AArch32 with CONFIG_KUSER_HELPERS=n || medium || cov || CRIU currently fails on AArch32 kernels built with CONFIG_KUSER_HELPERS=n.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Fix VDSO remapping on non-x86 architectures || medium || Laurent Dufour, cov || However some architectures like PowerPC and ARM are keeping a reference to the VDSO base address to build the signal return stack frame by calling the VDSO sigreturn service. So once the VDSO has been moved, this reference is no more valid and the signal frame built later are not usable.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Run many/all tests in &amp;quot;container&amp;quot; || medium || - || Currently we run zdtm tests one-by-one. It would be nice to run the all in one pseudo-container and C/R them as one big subtree.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Trinity-like (fuzz) testing || hard || - || The existing suite is 99% functionality testing. Need more sophisticated testing -- take a process that has done a random set of actions, C/R one, check that all is OK. The latter is the most complicated thing.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Split mountpoints.c test into pieces || easy || - || Currently this one is one big set of tests. Need more fine-grained set.&lt;br /&gt;
|-&lt;br /&gt;
| tests/infrastructure || Run tests on patches sent to the mailing lists || medium || Ruslan Kuprieiev || It's quite typical that a set sent to the mailing list fails some tests. Need a robot that would monitor the list, check the patches and send the result back.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Fault injection || hard || - || Need some way to test error paths in CRIU. Right now we rely on the developers to write correct code :\ This is the most critical on dump.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Zombies with threads || medium || - || Support processes with alive threads and a dead leader&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Unix sender address || medium || - || Restore sender addresses for unix socket messages&lt;br /&gt;
|-&lt;br /&gt;
| crtools || --leave-stopped for restore || easy || - || Restore task but leave it stopped&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Plans]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Todo&amp;diff=2489</id>
		<title>Todo</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Todo&amp;diff=2489"/>
		<updated>2015-06-04T21:59:28Z</updated>

		<summary type="html">&lt;p&gt;Efiop: took crml patch test&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! component&lt;br /&gt;
! task&lt;br /&gt;
! complexity&lt;br /&gt;
! potential/willing assignee&lt;br /&gt;
! comments&lt;br /&gt;
|-&lt;br /&gt;
| crtools/crit || Library/API to access pagemap+page images || medium || - || The [[memory dumps]] are quite sophisticated. It would be nice to have a library or API to access the data in them using some simple API. IOW -- API-ize the page_read.c&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Zombies with threads :) || easy || - || When milti-thread task's leader thread exits task turns into zombie state, but the other threads keep running. Need to support this (zdt test pthread02).&lt;br /&gt;
|-&lt;br /&gt;
| tests || automate process of measurement code coverage || easy || - || It is required to automate process of getting code coverage. We have code coverage results [http://criu.org/cov/ measured in 2012]. Would be nice to get up to date results on periodic basis and without manual actions.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Non-full mntns dump || medium || - || Systemd launches services in a new mount namespace with a single change -- /tmp is re-mounted into a private one(PrivateTmp option). Need to invent an API for dumping only a part of mntns.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Remap [[Vdso]] || medium || - || When at restore VDSO is found not in the place it was on dump we should &amp;lt;code&amp;gt;mremap()&amp;lt;/code&amp;gt; one. Unfortunately not always we can do it, need to fix the kernel.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Make dump and restore work under [[selinux]] || medium || - || Selinux imposes more restrictions on the stuff we typically do.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Inherit resources, not restore || medium || - || Sigactions are restored for every task before it fork()-s. Then children check for the sa_action from their image matches to one it got from parent. Need to do the same for rlimits, maybe other resources too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Implement [[restorer v2]] || hard (v2) || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || New images format || medium (v2) || - || See [[what's bad with V1 images]] &lt;br /&gt;
|-&lt;br /&gt;
| crtools || Make [[RPC]] &amp;quot;swrk&amp;quot; mode public || medium || xemul || There's an &amp;quot;swrk&amp;quot; action in CRIU [[Usage|CLI API]]. This turns CRIU into service worker accepting RPC commands. This mode is not documented. Need to standartify one and make public.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Tune the start-time of tasks || medium || - || When we restore tasks their start-time goes forward (since we create the new task effectively). Need to address this somehow, most likely with the [[time namespace]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support chroot-ed mount namespace || medium || - || If the root task lives in another mount namespace ''and'' has its root moved (with chroot()) CRIU dump fails with errors about inability to resolve files' paths. This is because CRIU treats the mount namespace's root as the init task's root which should be &amp;quot;/&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Non-stop memory (first?) pre-dump || medium || - || When reading only the memory we can avoid freezing tasks and draining memory with parasite. There's a system call named &amp;quot;read_process_vm&amp;quot; which can help us accessing the other task's memory. The disadvantage of this approach is the need for additional memory. We may control this behaviour by reading memory in chunks and not allocating to much of additional buffers.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Speed up fetching info about tasks || medium || Andrey Vagin || Using proc to get info about tasks is nice but too slow. We have measured that having socket-based engine that would fetch info about tasks from the kernel speeds things up significantly. So Andrey is working on the [[Task-diag]] patchset that would implement that.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Make pipes swappable || hard || - || When [[Memory dumping and restoring|pre-dumping]] memory we pull all the task's memory into pipe with vmsplice and then send it via network splicing the pages into socket. During this period all the memory is effectively pinned as pages in pipe are not swappable.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Deduplication for shmem [[memory dumps]] || easy || - || We have dedup action and --auto-dedup option for dump/restore which only works for pid pagemaps. Need the same for shmem.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Adjust per-task/-container timers offsets || medium || - || Absolute timers differ on different nodes. When live migrating a task/container this difference may (and will) screw the timers up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[time namespace|Shift timers' timeouts]] according to the actual C-to-R delay || medium || - || If we pause tasks between C and R we, probably, need to adjust timers respectively. &amp;quot;Medium&amp;quot; complexity is because it's unclear ''what'' to do, not ''how''.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Show what was left in the system after dump || easy || - || When we use [[Invisible files|--link-remap]] option or [[TCP connection|--tcp-established]] one CRIU leaves some traces in the system, in particular -- temporary hard links in the former case and iptables rules in the latter. Need some way to show these to the user.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Decode flags from images into symbolic names || easy || - || When we print images contents with [[CRIT]] the flags fields are shown in decimal/hex numbers. It would be nice to print the symbolic names for known flags in some form.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Leases support || easy || - || The F_SETLEASE/F_GETLEASE API is not currently supported, but doesn't differ much from regular locks.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Put call to mmap into VDSO || easy || Cyrill || To put the [[parasite code]] into target process we modify its code to call the &amp;lt;code&amp;gt;mmap()&amp;lt;/code&amp;gt; system call (and the unmodify it back) and put the parasite into new area. Oleg Nesterov suggests not to patch victim, but to always have one on VDSO.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Integration]] with other projects || hard || - || CRIU is not working great by itself. There's alway some specific about what user wants to dump. Integrating CRIU with other projects will make CRIU work at its best.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore tasks into fresh new pid namespace || easy || Kuprieiev Ruslan || When we dumped processes, it can be hard to restore it back, if they didn't live in a pid namespace, due to PIDs conflict. It would be nice to have the ability to ask CRIU to create the pid namespace for those guys and restore them there. A thing to worry about is this new namespace's init task.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Rollback tree state || medium || - || When we checkpointed process tree with -R option (let them run after checkpoint) we might want to return the tasks into checkpointed state on the same machine. Currently this can only be done by killing the processes and restoring them from scratch. If we could ask CRIU to restore the images ''into'' the ready processes that could speed things up, especially if carefully caring about [[memory changes tracking]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || AIO with pending events || medium || - || When we dump AIO ring we check it not to contain events inside and abort the dump otherwise. Need to dump events too and put them back on restore.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary mountpoints tree || hard || - || Linux kernel can construct tricky knows with [[mount points]]. We don't support arbitrary configuration of such things, only those that are in active use by software. Need to fix them up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Lazy restore using [[userfaultfd]] || medium || xemul || It might make sense to restore tasks w/o putting all the memory into respective places. Instead, the VMAs in question can be marked as &amp;quot;lazy&amp;quot; and pages will get filled into them in the background and, upon demand, in the out-of-order manner. The functionality is related to lazy migration and seamless kernel update tasks.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Lazy migration]] using [[userfaultfd]] || medium || xemul || Lazy migration is when we move all the tasks on another node, but leave theirs memory on the source one. Not to allow tasks read garbage from empty address space we protect all of it as inaccessible. When tasks start reading/writing the mem they got page-fault-ed. With the userfaultfd technology it can be possible to intercept the #PF, pull the page from source node and map it into expected address.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Dump tasks from cgroup || easy || - || Currently criu dumps a subtree from given pid. It makes sense to request CRIU to dump a set of tasks from given cgroup.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Speed up [[logging]] || medium || Cyrill || Synchronous formatting and writes into log files slow things down. On the other hand turning logs off make it impossible to troubleshoot.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Sanitize [[logging]] messages || hard || - || Currently log messages are printed w/o any logic, it's hard to analize what has happened when CRIU fails. Need to improve that by, e.g. categorizing images and [[When C/R fails|explaining them]] in more details.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support OFD posix locks || easy || - || These are still rarely used, but exist. Might make sense to support them in advance, it looks like kernel API allows for that.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Optimize kcmp calls || medium || - || CRIU build [[kcmp trees]] to find out IDs of such objects as MM, FDT and others. Currently we kcmp all tasks to get the ID, but we can improve that by pre-generating ID based on objects that live on MM, FS, etc. If pre-ID of two tasks matches, then we call kcmp, if not -- objects ''are'' different.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shmem changes tracking || medium || - || Memory changes tracker works on anonymous private mappings only. Anonymous shmem is not in active use by server applications, so we don't support one currently. Supporting it should be done by tracking the changes from all the tasks that ''could'' write into the segment. For anon shared memory and sysvipc segment inside IPC namespace this works reliably.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Page transfer filters || medium || - || The page-xfer engine just splices the pages from stealing pipes into socket. Packing or encrypting the data would be nice. Maybe it's purely for [[P.Haul]]?&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[FUSE]] mount points || hard || - || When dumping mountpoints we explicitly check the filesystem mounted. The thing is -- not all filesystems can be just ignored on dump. E.g. FUSE mount involves a user-space daemon that is responsible for the files tree contents. If we just kill one on dump we might not be able to restore it. Need to special-care one.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || 32-bit tasks || hard || Cyrill || For x86 we only dump and restore 64-bit tasks. Doing 32-bit should also be done, but keep in mind, that not only 64-bit tree OR 32-bit tree should be supported. There can be mixed 64-and-32-bit trees out there and CRIU should support those too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Modify restored resources run-time in [[CRIT]] daemon || medium || - || Sometimes it might make sense to tune the objects fro images on restore. E.g. -- change the IP address of sockets from task above or fix file paths to be &amp;quot;chroot-ed&amp;quot;. The best solution seems to be in launching CRIT in daemon mode, telling it what images and how to modify and teaching CRIU to &amp;quot;filter&amp;quot; the pb objects read from images through this daemon.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || TCP socket migration with changed IP || medium || - ||  It might make sense to migrate a tcp connection on a box with changed IP address _if_ both boxes are NAT-ed to the destination. We will then have to go to NAT box and fix the conntracks in that case and use CRIT images modifucation facilities.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Applying images]] || hard (v2) || xemul@ w/ students || Think about ability to take images and apply them to a living task(s). Like it was described in the &amp;quot;rollback&amp;quot; feature above. Another exampl -- repopulate fdtable according to data from image. Yet another use-case -- when doing partial migration (see below) we'll need to modify one part to switch from pipes to sockets. What else? With constant replication of tree state we can do incremental dumps on source node and apply those increments on pre-created replicas on the destination node.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Partial migration || hard || - || If tasks subtree has connections to the rest of the tree (e.g. with pipes of unix sockets) we try to detect this and refuse the dump. It should be possible to take part of the tree, migrating it somewhere and recreating the mentioned links with some other appropriate IPC channel. E.g. pipes with sockets, shared memory with distributed shared memory and so on.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shared objects (mm/fs) support || medium || - || Things created with CLONE_FOO flags are not supported now (exception -- full threads). Now we have the kcmp syscall and can do it. The shared fdtable (CLONE_FILES) is supported, the next candidate is mm sharing, as we do know, that MySQL does so sometimes.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Smart paths resolution || hard || - || Files can be overmounted. In this case CRIU will refuse the dump saying that file is [[invisible files|not alive]] but inaccessible by its name. Need a way to resolve paths to such. There are two ways: 1. Move mounts, that overlap the desired path temporarily, then open the file, then move the mountpoint back. 2. When creating a new mount pre-open an fd keeping the mountpoint. Later, do accurate path resolve and call openat() on proper mountpoint fd.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || [[TCP repair TODO|TCP repair fixes]] || hard || - || We can dump and restore live [[TCP connection]]. There are some issues with it, that should be fixed.&lt;br /&gt;
|-&lt;br /&gt;
| kernel?/crtools || TCP conntrack-ed connections || medium || - || When a container uses conntracks inside, we cannot just dump and restore alive TCP connection. Otherwise on restore the resurrected packets will be blocked by connection tracker as they would not be recognized as established connection. Need to check whether connection tracking is ON, dump the needed conntrack info and put the tracker back.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Bridges in container || medium || - || The bridge device state should be read, saved and restored.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || VLANs in containers || medium || - || Vlan (802.1q) device state should be read, saved and restored.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[PPP]] support || medium || - || PPP consists of several things, not just ppp devices. If container uses PPP we should take care of it, currently CRIU just aborts.&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || [[NFS mount points]] support || hard || - || NFS mount points from inside container cannot be easily restored. The thing is -- if we want to restore opened file we will go ahead and [[How hard is it to open a file|call]] the open system call. If the file in question resides on NFS, the latter might need to go to network to check whether the file actually exists and set up the handle. But if the networking is still not restored this operation would fail and we'll have to fail the whole restore. In order to untie this chicken-and-egg problem we may go in two directions.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || [[Seamless kernel upgrade]] || hard || xemul || Briefly -- dump tasks (into memory), change the kernel w/ kexec, then restore tasks back. From the tasks and remote client perspective tasks has just stopped and then resumed on the newer kernel. Can be a good complement to the classic live-patching technology.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Validate .img files || easy || - || [[CRIT]] sub-task. For a given set of image files check, that they are in &amp;quot;restorable&amp;quot; shape, i.e. contain valid data and no pieces are missing.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary process tree || hard ||  - || Need to restore any process tree, which could be created with help PR_SET_CHILD_SUBREAPER and CLONE_PARENT. Processes can share other resources [http://man7.org/linux/man-pages/man2/clone2.2.html clone(2)]. Look at [http://git.criu.org/?p=crtools.git;a=blob;f=test/zdtm/live/static/session02.c;hb=HEAD session02]. The task of resolving the given images into operations we might need to perform seem to be NP (not proven though).&lt;br /&gt;
|-&lt;br /&gt;
| crtools || C/R [[X applications]] || hard || Ruslan Kuprieiev || Dump/restore of graphical applications (see about [[integration]]). In case of X app part of its state is stored into the X-server. Need the way to fetch this state during dump and put this state back into the server on restore. Requires fixing the X-server software too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || Undo semaphores || medium || Cyrill Gorcunov || These are SysVIPC objects created with semctl() and SEM_UNDO flag. Shame on us, we don't even detect these are created. Fortunately they are not in active use. Need to do it -- dump and restore. Requires modifications from both sides -- criu and kernel.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || More detailed RPC fail codes || easy || - || Currently only 3 typical errors are reported(see [https://github.com/xemul/criu/blob/master/include/cr-errno.h#L8 include/cr-errno.h]). Need to extend this set as currently it's hard to understand what has happened w/o analysing CRIU log files.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/criu || FS-notify queues || hard || - || We dump [[Fsnotify]] files, but when they contain events inside -- just ignore those. Need to fetch then and put back on restore. The difficulty here is that while dumping/restoring CRIU may touch files that are monitored and thus produce unwanted events into queue.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Remove hardcoded TASK_SIZE (at least for AArch32) || medium || cov || Dumping an AArch32 application using an AArch32 CRIU under an AArch64 kernel fails because TASK_SIZE is wrong. If TASK_SIZE were determined at runtime, the process would be able to proceed further. TASK_SIZE could be guessed using uname/cpuinfo and rules, probed with a series of accesses, or perhaps, following the example of PAGE_SIZE, the ELF auxiliary vector should include it.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Hardcoded PAGE_SIZE (at least for AArch64) || medium || cov || Dumping an AArch64 under an AArch64 kernel with 64K pages fails because PAGE_SIZE is wrong. Many uses of the PAGE_SIZE constant don't actually need an exact page size. Maybe split uses into PAGE_OR_LESS, EXEC_PAGESIZE (max possible for a platform), and page_size (actual value, probably pulled from auxv in memory or /proc or from smaps in /proc).&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Make CRIU work on AArch32 with CONFIG_KUSER_HELPERS=n || medium || cov || CRIU currently fails on AArch32 kernels built with CONFIG_KUSER_HELPERS=n.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Fix VDSO remapping on non-x86 architectures || medium || Laurent Dufour, cov || However some architectures like PowerPC and ARM are keeping a reference to the VDSO base address to build the signal return stack frame by calling the VDSO sigreturn service. So once the VDSO has been moved, this reference is no more valid and the signal frame built later are not usable.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Run many/all tests in &amp;quot;container&amp;quot; || medium || - || Currently we run zdtm tests one-by-one. It would be nice to run the all in one pseudo-container and C/R them as one big subtree.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Trinity-like (fuzz) testing || hard || - || The existing suite is 99% functionality testing. Need more sophisticated testing -- take a process that has done a random set of actions, C/R one, check that all is OK. The latter is the most complicated thing.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Split mountpoints.c test into pieces || easy || - || Currently this one is one big set of tests. Need more fine-grained set.&lt;br /&gt;
|-&lt;br /&gt;
| tests/infrastructure || Run tests on patches sent to the mailing lists || medium || Ruslan Kuprieiev || It's quite typical that a set sent to the mailing list fails some tests. Need a robot that would monitor the list, check the patches and send the result back.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Fault injection || hard || - || Need some way to test error paths in CRIU. Right now we rely on the developers to write correct code :\ This is the most critical on dump.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Zombies with threads || medium || - || Support processes with alive threads and a dead leader&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Plans]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Todo&amp;diff=2448</id>
		<title>Todo</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Todo&amp;diff=2448"/>
		<updated>2015-05-10T18:16:04Z</updated>

		<summary type="html">&lt;p&gt;Efiop: Coredump task is ready.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! component&lt;br /&gt;
! task&lt;br /&gt;
! complexity&lt;br /&gt;
! potential/willing assignee&lt;br /&gt;
! comments&lt;br /&gt;
|-&lt;br /&gt;
| crtools/crit || Library/API to access pagemap+page images || medium || - || The [[memory dumps]] are quite sophisticated. It would be nice to have a library or API to access the data in them using some simple API. IOW -- API-ize the page_read.c&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Zombies with threads :) || easy || - || When milti-thread task's leader thread exits task turns into zombie state, but the other threads keep running. Need to support this (zdt test pthread02).&lt;br /&gt;
|-&lt;br /&gt;
| tests || automate process of measurement code coverage || easy || - || It is required to automate process of getting code coverage. We have code coverage results [http://criu.org/cov/ measured in 2012]. Would be nice to get up to date results on periodic basis and without manual actions.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Non-full mntns dump || medium || - || Systemd launches services in a new mount namespace with a single change -- /tmp is re-mounted into a private one(PrivateTmp option). Need to invent an API for dumping only a part of mntns.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Remap [[Vdso]] || medium || - || When at restore VDSO is found not in the place it was on dump we should &amp;lt;code&amp;gt;mremap()&amp;lt;/code&amp;gt; one. Unfortunately not always we can do it, need to fix the kernel.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Make dump and restore work under [[selinux]] || medium || - || Selinux imposes more restrictions on the stuff we typically do.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Inherit resources, not restore || medium || - || Sigactions are restored for every task before it fork()-s. Then children check for the sa_action from their image matches to one it got from parent. Need to do the same for rlimits, maybe other resources too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Implement [[restorer v2]] || hard (v2) || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || New images format || medium (v2) || - || See [[what's bad with V1 images]] &lt;br /&gt;
|-&lt;br /&gt;
| crtools || Make [[RPC]] &amp;quot;swrk&amp;quot; mode public || medium || xemul || There's an &amp;quot;swrk&amp;quot; action in CRIU [[Usage|CLI API]]. This turns CRIU into service worker accepting RPC commands. This mode is not documented. Need to standartify one and make public.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Tune the start-time of tasks || medium || - || When we restore tasks their start-time goes forward (since we create the new task effectively). Need to address this somehow, most likely with the [[time namespace]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support chroot-ed mount namespace || medium || - || If the root task lives in another mount namespace ''and'' has its root moved (with chroot()) CRIU dump fails with errors about inability to resolve files' paths. This is because CRIU treats the mount namespace's root as the init task's root which should be &amp;quot;/&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Non-stop memory (first?) pre-dump || medium || - || When reading only the memory we can avoid freezing tasks and draining memory with parasite. There's a system call named &amp;quot;read_process_vm&amp;quot; which can help us accessing the other task's memory. The disadvantage of this approach is the need for additional memory. We may control this behaviour by reading memory in chunks and not allocating to much of additional buffers.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Speed up fetching info about tasks || medium || Andrey Vagin || Using proc to get info about tasks is nice but too slow. We have measured that having socket-based engine that would fetch info about tasks from the kernel speeds things up significantly. So Andrey is working on the [[Task-diag]] patchset that would implement that.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Make pipes swappable || hard || - || When [[Memory dumping and restoring|pre-dumping]] memory we pull all the task's memory into pipe with vmsplice and then send it via network splicing the pages into socket. During this period all the memory is effectively pinned as pages in pipe are not swappable.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Deduplication for shmem [[memory dumps]] || easy || - || We have dedup action and --auto-dedup option for dump/restore which only works for pid pagemaps. Need the same for shmem.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Adjust per-task/-container timers offsets || medium || - || Absolute timers differ on different nodes. When live migrating a task/container this difference may (and will) screw the timers up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[time namespace|Shift timers' timeouts]] according to the actual C-to-R delay || medium || - || If we pause tasks between C and R we, probably, need to adjust timers respectively. &amp;quot;Medium&amp;quot; complexity is because it's unclear ''what'' to do, not ''how''.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Show what was left in the system after dump || easy || - || When we use [[Invisible files|--link-remap]] option or [[TCP connection|--tcp-established]] one CRIU leaves some traces in the system, in particular -- temporary hard links in the former case and iptables rules in the latter. Need some way to show these to the user.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Decode flags from images into symbolic names || easy || - || When we print images contents with [[CRIT]] the flags fields are shown in decimal/hex numbers. It would be nice to print the symbolic names for known flags in some form.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Leases support || easy || - || The F_SETLEASE/F_GETLEASE API is not currently supported, but doesn't differ much from regular locks.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Make proper &amp;quot;check lock present&amp;quot; API in the kernel || medium || - || Currently we detect where a file lock belongs to by locking the file again with the alternative lock type and check how kernel reacts on that. This is not nice as it may tune the lock state on a file. Instead we need the &amp;quot;check lock on fd&amp;quot; call in the kernel.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Put call to mmap into VDSO || easy || Cyrill || To put the [[parasite code]] into target process we modify its code to call the &amp;lt;code&amp;gt;mmap()&amp;lt;/code&amp;gt; system call (and the unmodify it back) and put the parasite into new area. Oleg Nesterov suggests not to patch victim, but to always have one on VDSO.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Integration]] with other projects || hard || - || CRIU is not working great by itself. There's alway some specific about what user wants to dump. Integrating CRIU with other projects will make CRIU work at its best.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore tasks into fresh new pid namespace || easy || Kuprieiev Ruslan || When we dumped processes, it can be hard to restore it back, if they didn't live in a pid namespace, due to PIDs conflict. It would be nice to have the ability to ask CRIU to create the pid namespace for those guys and restore them there. A thing to worry about is this new namespace's init task.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Rollback tree state || medium || - || When we checkpointed process tree with -R option (let them run after checkpoint) we might want to return the tasks into checkpointed state on the same machine. Currently this can only be done by killing the processes and restoring them from scratch. If we could ask CRIU to restore the images ''into'' the ready processes that could speed things up, especially if carefully caring about [[memory changes tracking]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || AIO with pending events || medium || - || When we dump AIO ring we check it not to contain events inside and abort the dump otherwise. Need to dump events too and put them back on restore.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary mountpoints tree || hard || - || Linux kernel can construct tricky knows with [[mount points]]. We don't support arbitrary configuration of such things, only those that are in active use by software. Need to fix them up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Lazy restore using [[userfaultfd]] || medium || xemul || It might make sense to restore tasks w/o putting all the memory into respective places. Instead, the VMAs in question can be marked as &amp;quot;lazy&amp;quot; and pages will get filled into them in the background and, upon demand, in the out-of-order manner. The functionality is related to lazy migration and seamless kernel update tasks.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Lazy migration]] using [[userfaultfd]] || medium || xemul || Lazy migration is when we move all the tasks on another node, but leave theirs memory on the source one. Not to allow tasks read garbage from empty address space we protect all of it as inaccessible. When tasks start reading/writing the mem they got page-fault-ed. With the userfaultfd technology it can be possible to intercept the #PF, pull the page from source node and map it into expected address.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Dump tasks from cgroup || easy || - || Currently criu dumps a subtree from given pid. It makes sense to request CRIU to dump a set of tasks from given cgroup.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Speed up [[logging]] || medium || Cyrill || Synchronous formatting and writes into log files slow things down. On the other hand turning logs off make it impossible to troubleshoot.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Sanitize [[logging]] messages || hard || - || Currently log messages are printed w/o any logic, it's hard to analize what has happened when CRIU fails. Need to improve that by, e.g. categorizing images and [[When C/R fails|explaining them]] in more details.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support OFD posix locks || easy || - || These are still rarely used, but exist. Might make sense to support them in advance, it looks like kernel API allows for that.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Optimize kcmp calls || medium || - || CRIU build [[kcmp trees]] to find out IDs of such objects as MM, FDT and others. Currently we kcmp all tasks to get the ID, but we can improve that by pre-generating ID based on objects that live on MM, FS, etc. If pre-ID of two tasks matches, then we call kcmp, if not -- objects ''are'' different.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shmem changes tracking || medium || - || Memory changes tracker works on anonymous private mappings only. Anonymous shmem is not in active use by server applications, so we don't support one currently. Supporting it should be done by tracking the changes from all the tasks that ''could'' write into the segment. For anon shared memory and sysvipc segment inside IPC namespace this works reliably.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Page transfer filters || medium || - || The page-xfer engine just splices the pages from stealing pipes into socket. Packing or encrypting the data would be nice. Maybe it's purely for [[P.Haul]]?&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[FUSE]] mount points || hard || - || When dumping mountpoints we explicitly check the filesystem mounted. The thing is -- not all filesystems can be just ignored on dump. E.g. FUSE mount involves a user-space daemon that is responsible for the files tree contents. If we just kill one on dump we might not be able to restore it. Need to special-care one.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || 32-bit tasks || hard || Cyrill || For x86 we only dump and restore 64-bit tasks. Doing 32-bit should also be done, but keep in mind, that not only 64-bit tree OR 32-bit tree should be supported. There can be mixed 64-and-32-bit trees out there and CRIU should support those too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Modify restored resources run-time in [[CRIT]] daemon || medium || - || Sometimes it might make sense to tune the objects fro images on restore. E.g. -- change the IP address of sockets from task above or fix file paths to be &amp;quot;chroot-ed&amp;quot;. The best solution seems to be in launching CRIT in daemon mode, telling it what images and how to modify and teaching CRIU to &amp;quot;filter&amp;quot; the pb objects read from images through this daemon.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || TCP socket migration with changed IP || medium || - ||  It might make sense to migrate a tcp connection on a box with changed IP address _if_ both boxes are NAT-ed to the destination. We will then have to go to NAT box and fix the conntracks in that case and use CRIT images modifucation facilities.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Applying images]] || hard (v2) || xemul@ w/ students || Think about ability to take images and apply them to a living task(s). Like it was described in the &amp;quot;rollback&amp;quot; feature above. Another exampl -- repopulate fdtable according to data from image. Yet another use-case -- when doing partial migration (see below) we'll need to modify one part to switch from pipes to sockets. What else? With constant replication of tree state we can do incremental dumps on source node and apply those increments on pre-created replicas on the destination node.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Partial migration || hard || - || If tasks subtree has connections to the rest of the tree (e.g. with pipes of unix sockets) we try to detect this and refuse the dump. It should be possible to take part of the tree, migrating it somewhere and recreating the mentioned links with some other appropriate IPC channel. E.g. pipes with sockets, shared memory with distributed shared memory and so on.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shared objects (mm/fs) support || medium || - || Things created with CLONE_FOO flags are not supported now (exception -- full threads). Now we have the kcmp syscall and can do it. The shared fdtable (CLONE_FILES) is supported, the next candidate is mm sharing, as we do know, that MySQL does so sometimes.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Smart paths resolution || hard || - || Files can be overmounted. In this case CRIU will refuse the dump saying that file is [[invisible files|not alive]] but inaccessible by its name. Need a way to resolve paths to such. There are two ways: 1. Move mounts, that overlap the desired path temporarily, then open the file, then move the mountpoint back. 2. When creating a new mount pre-open an fd keeping the mountpoint. Later, do accurate path resolve and call openat() on proper mountpoint fd.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || [[TCP repair TODO|TCP repair fixes]] || hard || - || We can dump and restore live [[TCP connection]]. There are some issues with it, that should be fixed.&lt;br /&gt;
|-&lt;br /&gt;
| kernel?/crtools || TCP conntrack-ed connections || medium || - || When a container uses conntracks inside, we cannot just dump and restore alive TCP connection. Otherwise on restore the resurrected packets will be blocked by connection tracker as they would not be recognized as established connection. Need to check whether connection tracking is ON, dump the needed conntrack info and put the tracker back.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Bridges in container || medium || - || The bridge device state should be read, saved and restored.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || VLANs in containers || medium || - || Vlan (802.1q) device state should be read, saved and restored.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[PPP]] support || medium || - || PPP consists of several things, not just ppp devices. If container uses PPP we should take care of it, currently CRIU just aborts.&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || [[NFS mount points]] support || hard || - || NFS mount points from inside container cannot be easily restored. The thing is -- if we want to restore opened file we will go ahead and [[How hard is it to open a file|call]] the open system call. If the file in question resides on NFS, the latter might need to go to network to check whether the file actually exists and set up the handle. But if the networking is still not restored this operation would fail and we'll have to fail the whole restore. In order to untie this chicken-and-egg problem we may go in two directions.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || [[Seamless kernel upgrade]] || hard || xemul || Briefly -- dump tasks (into memory), change the kernel w/ kexec, then restore tasks back. From the tasks and remote client perspective tasks has just stopped and then resumed on the newer kernel. Can be a good complement to the classic live-patching technology.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Validate .img files || easy || - || [[CRIT]] sub-task. For a given set of image files check, that they are in &amp;quot;restorable&amp;quot; shape, i.e. contain valid data and no pieces are missing.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary process tree || hard ||  - || Need to restore any process tree, which could be created with help PR_SET_CHILD_SUBREAPER and CLONE_PARENT. Processes can share other resources [http://man7.org/linux/man-pages/man2/clone2.2.html clone(2)]. Look at [http://git.criu.org/?p=crtools.git;a=blob;f=test/zdtm/live/static/session02.c;hb=HEAD session02]. The task of resolving the given images into operations we might need to perform seem to be NP (not proven though).&lt;br /&gt;
|-&lt;br /&gt;
| crtools || C/R [[X applications]] || hard || Ruslan Kuprieiev || Dump/restore of graphical applications (see about [[integration]]). In case of X app part of its state is stored into the X-server. Need the way to fetch this state during dump and put this state back into the server on restore. Requires fixing the X-server software too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || Undo semaphores || medium || Cyrill Gorcunov || These are SysVIPC objects created with semctl() and SEM_UNDO flag. Shame on us, we don't even detect these are created. Fortunately they are not in active use. Need to do it -- dump and restore. Requires modifications from both sides -- criu and kernel.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || More detailed RPC fail codes || easy || - || Currently only 3 typical errors are reported(see [https://github.com/xemul/criu/blob/master/include/cr-errno.h#L8 include/cr-errno.h]). Need to extend this set as currently it's hard to understand what has happened w/o analysing CRIU log files.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/criu || FS-notify queues || hard || - || We dump [[Fsnotify]] files, but when they contain events inside -- just ignore those. Need to fetch then and put back on restore. The difficulty here is that while dumping/restoring CRIU may touch files that are monitored and thus produce unwanted events into queue.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Remove hardcoded TASK_SIZE (at least for AArch32) || medium || cov || Dumping an AArch32 application using an AArch32 CRIU under an AArch64 kernel fails because TASK_SIZE is wrong. If TASK_SIZE were determined at runtime, the process would be able to proceed further. TASK_SIZE could be guessed using uname/cpuinfo and rules, probed with a series of accesses, or perhaps, following the example of PAGE_SIZE, the ELF auxiliary vector should include it.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Hardcoded PAGE_SIZE (at least for AArch64) || medium || cov || Dumping an AArch64 under an AArch64 kernel with 64K pages fails because PAGE_SIZE is wrong. Many uses of the PAGE_SIZE constant don't actually need an exact page size. Maybe split uses into PAGE_OR_LESS, EXEC_PAGESIZE (max possible for a platform), and page_size (actual value, probably pulled from auxv in memory or /proc or from smaps in /proc).&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Make CRIU work on AArch32 with CONFIG_KUSER_HELPERS=n || medium || cov || CRIU currently fails on AArch32 kernels built with CONFIG_KUSER_HELPERS=n.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Fix VDSO remapping on non-x86 architectures || medium || Laurent Dufour, cov || However some architectures like PowerPC and ARM are keeping a reference to the VDSO base address to build the signal return stack frame by calling the VDSO sigreturn service. So once the VDSO has been moved, this reference is no more valid and the signal frame built later are not usable.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Run many/all tests in &amp;quot;container&amp;quot; || medium || - || Currently we run zdtm tests one-by-one. It would be nice to run the all in one pseudo-container and C/R them as one big subtree.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Trinity-like (fuzz) testing || hard || - || The existing suite is 99% functionality testing. Need more sophisticated testing -- take a process that has done a random set of actions, C/R one, check that all is OK. The latter is the most complicated thing.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Split mountpoints.c test into pieces || easy || - || Currently this one is one big set of tests. Need more fine-grained set.&lt;br /&gt;
|-&lt;br /&gt;
| tests/infrastructure || Run tests on patches sent to the mailing lists || medium || - || It's quite typical that a set sent to the mailing list fails some tests. Need a robot that would monitor the list, check the patches and send the result back.&lt;br /&gt;
|-&lt;br /&gt;
| tests || Fault injection || hard || - || Need some way to test error paths in CRIU. Right now we rely on the developers to write correct code :\ This is the most critical on dump.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Zombies with threads || medium || - || Support processes with alive threads and a dead leader&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Plans]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT&amp;diff=2447</id>
		<title>CRIT</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT&amp;diff=2447"/>
		<updated>2015-05-08T16:55:00Z</updated>

		<summary type="html">&lt;p&gt;Efiop: criu-coredump&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the CRiu Image Tool. CRIT is a feature-rich replacement for existing &amp;quot;criu show&amp;quot;.&lt;br /&gt;
It is written completely in Python, so it is quite easy to read the code and extend its features.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: crit [-h] [-i IN] [-o OUT] [--pretty] {decode,encode}&lt;br /&gt;
&lt;br /&gt;
CRiu Image Tool&lt;br /&gt;
&lt;br /&gt;
positional arguments:&lt;br /&gt;
  {decode,encode}       decode/encode - convert criu image from/to binary type&lt;br /&gt;
                        to/from json&lt;br /&gt;
&lt;br /&gt;
optional arguments:&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
  -i IN, --in IN        input file (stdin by default)&lt;br /&gt;
  -o OUT, --out OUT     output file (stdout by default)&lt;br /&gt;
  --pretty              multi-line with indentation and some fields printed in more human-readable format&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pretty output ===&lt;br /&gt;
&lt;br /&gt;
By default CRIT prints JSON text in one line. This can be read by any further JSON-aware tool for parsing. For human eyes it's more convenient to read JSON multi-line with indentation. However, CRIT does a little bit more and prints some fields in even more pretty manner.&lt;br /&gt;
&lt;br /&gt;
; Addresses and registers&lt;br /&gt;
: VM addresses and core.img register values are all printed in hex. Since JSON doesn't support this form of numbers, such fields are encoded as strings.&lt;br /&gt;
&lt;br /&gt;
; Bit-fields&lt;br /&gt;
: Such things as flags and masks (e.g. sig-block mask) are also better understood when written in hex, so CRIT does this.&lt;br /&gt;
&lt;br /&gt;
; IP addresses&lt;br /&gt;
: By default those a printed in decimal, but the &amp;quot;1.2.3.4&amp;quot; for v4 or &amp;quot;::1&amp;quot; for v6 can be seen in the --pretty mode.&lt;br /&gt;
&lt;br /&gt;
==== TODO ====&lt;br /&gt;
&lt;br /&gt;
; Symbolic names for flags&lt;br /&gt;
: Some known bits (e.g. MAP_PRIVATE, MAP_ANONYMOUS, etc. for vma-&amp;gt;flags) can be shown with names.&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
&lt;br /&gt;
=== Convert images to JSON and back ===&lt;br /&gt;
&lt;br /&gt;
{{Status|ready}}&lt;br /&gt;
&lt;br /&gt;
This is the replacement for (rather nasty) criu show code. Also this is the way to edit the images before restoring from them.&lt;br /&gt;
&lt;br /&gt;
It uses [https://developers.google.com/protocol-buffers/docs/reference/python/google.protobuf.text_format-module text_format] as a human-readable format for protobuf messages.&lt;br /&gt;
&lt;br /&gt;
The output file is structured in the following way.&lt;br /&gt;
&lt;br /&gt;
Without &amp;quot;--pretty&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;, &amp;quot;entries&amp;quot; : [{&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot;: &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot;: &amp;quot;abc&amp;quot;}, {&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;} ]}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;--pretty&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;,&lt;br /&gt;
    &amp;quot;entries&amp;quot; : [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Example(&amp;quot;crit decode -i core-5679.img --pretty&amp;quot;)&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;amp;quot;magic&amp;amp;quot;: &amp;amp;quot;CORE&amp;amp;quot;, &lt;br /&gt;
    &amp;amp;quot;entries&amp;amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;amp;quot;mtype&amp;amp;quot;: &amp;amp;quot;X86_64&amp;amp;quot;, &lt;br /&gt;
            &amp;amp;quot;thread_core&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;futex_rla_len&amp;amp;quot;: 24, &lt;br /&gt;
                &amp;amp;quot;sched_policy&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;sched_nice&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;futex_rla&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;signals_p&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;sas&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;ss_size&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_sp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_flags&amp;amp;quot;: 2&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;thread_info&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;fpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;st_space&amp;amp;quot;: [&lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;fop&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rdp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;twd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr&amp;amp;quot;: 8064, &lt;br /&gt;
                    &amp;amp;quot;swd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rip&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;xsave&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;ymmh_space&amp;amp;quot;: [&lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0&lt;br /&gt;
                        ], &lt;br /&gt;
                        &amp;amp;quot;xstate_bv&amp;amp;quot;: 2&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;xmm_space&amp;amp;quot;: [&lt;br /&gt;
                        0, &lt;br /&gt;
                        4278190080, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        1701145715, &lt;br /&gt;
                        3219568, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        33, &lt;br /&gt;
                        0, &lt;br /&gt;
                        792358505, &lt;br /&gt;
                        1953460082, &lt;br /&gt;
                        1852400175, &lt;br /&gt;
                        0, &lt;br /&gt;
                        942882145, &lt;br /&gt;
                        876295483, &lt;br /&gt;
                        774519349, &lt;br /&gt;
                        1031303283, &lt;br /&gt;
                        893073459, &lt;br /&gt;
                        976565307, &lt;br /&gt;
                        1937255978, &lt;br /&gt;
                        859661936, &lt;br /&gt;
                        993344312, &lt;br /&gt;
                        3814708, &lt;br /&gt;
                        65, &lt;br /&gt;
                        0, &lt;br /&gt;
                        37049520, &lt;br /&gt;
                        0, &lt;br /&gt;
                        37049632, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4294901760, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;cwd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr_mask&amp;amp;quot;: 65535&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;clear_tid_addr&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;gpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;gs&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ip&amp;amp;quot;: &amp;amp;quot;0x7f172cf1ea04&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;cx&amp;amp;quot;: &amp;amp;quot;0xffffffffffffffff&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;cs&amp;amp;quot;: &amp;amp;quot;0x33&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ax&amp;amp;quot;: &amp;amp;quot;0x38&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;orig_ax&amp;amp;quot;: &amp;amp;quot;0x38&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;di&amp;amp;quot;: &amp;amp;quot;0x1200011&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;es&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;gs_base&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r14&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r15&amp;amp;quot;: &amp;amp;quot;0x2355e00&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r12&amp;amp;quot;: &amp;amp;quot;0x7ffffdbf74f0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r13&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r10&amp;amp;quot;: &amp;amp;quot;0x7f172d83d9d0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r11&amp;amp;quot;: &amp;amp;quot;0x246&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;fs_base&amp;amp;quot;: &amp;amp;quot;0x7f172d83d700&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;bp&amp;amp;quot;: &amp;amp;quot;0x7ffffdbf7530&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;dx&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;bx&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ds&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ss&amp;amp;quot;: &amp;amp;quot;0x2b&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;sp&amp;amp;quot;: &amp;amp;quot;0x7ffffdbf74f0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r8&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r9&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;fs&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;si&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;flags&amp;amp;quot;: &amp;amp;quot;0x246&amp;amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;tc&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;timers&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;real&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;virt&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;prof&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;cg_set&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;signals_s&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;blk_sigset&amp;amp;quot;: &amp;amp;quot;0x10002&amp;amp;quot;, &lt;br /&gt;
                &amp;amp;quot;exit_code&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;rlimits&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;rlimits&amp;amp;quot;: [&lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 8388608&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62844, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62844&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 4096, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 1024&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 65536, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 65536&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62844, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62844&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 819200, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 819200&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }&lt;br /&gt;
                    ]&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;comm&amp;amp;quot;: &amp;amp;quot;loop.sh&amp;amp;quot;, &lt;br /&gt;
                &amp;amp;quot;flags&amp;amp;quot;: 1077960704, &lt;br /&gt;
                &amp;amp;quot;task_state&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;personality&amp;amp;quot;: 0&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Generate core files out of task images ===&lt;br /&gt;
&lt;br /&gt;
{{Status|ready}}&lt;br /&gt;
&lt;br /&gt;
Moved into separate project called [[criu-coredump]].&lt;br /&gt;
&lt;br /&gt;
=== On-the-fly conversion ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
There's an idea to make CRIU spawn CRIT and read images &amp;quot;through&amp;quot; it, to allow for at-the-restore-time modifications&lt;br /&gt;
&lt;br /&gt;
=== Convert between different image versions ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
Right now we store the images version in inventory.img and collect info about [[what's bad with V1 images]]. If some day we have v2, CRIT will convert from v1. And for backward compatibility we'll use on-the-fly conversion when restoring from old images.&lt;br /&gt;
&lt;br /&gt;
=== Show images statistics ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
E.g. -- total number of processes, files, memory, sockets, etc.&lt;br /&gt;
&lt;br /&gt;
=== Check/validate images ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
Check that&lt;br /&gt;
* all images are present&lt;br /&gt;
* the inter-images IDs are in consistent state&lt;br /&gt;
&lt;br /&gt;
[[Category:Images]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Criu-coredump&amp;diff=2446</id>
		<title>Criu-coredump</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Criu-coredump&amp;diff=2446"/>
		<updated>2015-05-08T16:54:56Z</updated>

		<summary type="html">&lt;p&gt;Efiop: Created page with &amp;quot;Generate valid core dump from CRIU images. === Description === CRIU images contain lots of information about process state. In fact, it is sufficient enough to generate a vali...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Generate valid core dump from CRIU images.&lt;br /&gt;
=== Description ===&lt;br /&gt;
CRIU images contain lots of information about process state. In fact, it is sufficient enough to generate a&lt;br /&gt;
valid core dump which can be later be used by gdb, for example. criu-coredump does exactly that, it takes a&lt;br /&gt;
directory with CRIU images and produces Elf core dumps.&lt;br /&gt;
&lt;br /&gt;
Basically, you can use CRIU to checkpoint task when you need it (i.e. when it hangs, or when an error occures)&lt;br /&gt;
or make your application call CRIU via one of its interfaces(CLI, RPC or C library) and then produce core dump&lt;br /&gt;
and inspect it via gdb.&lt;br /&gt;
&lt;br /&gt;
To generate core dump of your application you don't even need to be a root, it is enough for you to be the owner&lt;br /&gt;
of that task. For that all you have two choices: 1) Use CRIU service running and use [[RPC]] or [[C_API]]. It is&lt;br /&gt;
useful if you want your app to automatically call CRIU. 2) Use CRIU binary with suid bit set.&lt;br /&gt;
&lt;br /&gt;
criu-coredump project provides both cmdline tool and python module(criu_coredump), so you can use it in your&lt;br /&gt;
python apps.&lt;br /&gt;
&lt;br /&gt;
=== Limitations ===&lt;br /&gt;
&lt;br /&gt;
For now only x86_64 is supported. The matter of supporting other architectures supported by CRIU is to use proper constants in elf header and provide proper arch-dependent notes.&lt;br /&gt;
&lt;br /&gt;
Some notes in coredump are not fullfilled(i.e. SIGINFO).&lt;br /&gt;
&lt;br /&gt;
VVAR and VSYSCALL vmas are just filled with zeroes, as CRIU doesn't currently provide them. VVAR is a tricky one and gdb also has problems dumping it[https://lkml.org/lkml/2015/3/12/439]. VSYSCALL in theory could just be read from current process, so it should be quite easy to fix.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ python setup.py install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
criu-coredump [-h] [-i IN] [-p PID] [-o OUT]&lt;br /&gt;
&lt;br /&gt;
optional arguments:&lt;br /&gt;
  -h, --help         show this help message and exit&lt;br /&gt;
  -i IN, --in IN     directory where to get images from.&lt;br /&gt;
  -p PID, --pid PID  generate core dump of a process identified by PID.&lt;br /&gt;
                     If not specified -- generating for each pid.&lt;br /&gt;
  -o OUT, --out OUT  directory to write core dump to.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Project resources ===&lt;br /&gt;
Project is located at [https://github.com/efiop/criu-coredump GitHub].&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Todo&amp;diff=2306</id>
		<title>Todo</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Todo&amp;diff=2306"/>
		<updated>2015-03-27T09:22:13Z</updated>

		<summary type="html">&lt;p&gt;Efiop: PrivateTmp&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! component&lt;br /&gt;
! task&lt;br /&gt;
! complexity&lt;br /&gt;
! potential/willing assignee&lt;br /&gt;
! comments&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Non-full mntns dump || medium || - || Systemd launches services in a new mount namespace with a single change -- /tmp is re-mounted into a private one(PrivateTmp option). Need to invent an API for dumping only a part of mntns.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Remap [[Vdso]] || medium || - || When at restore VDSO is found not in the place it was on dump we should &amp;lt;code&amp;gt;mremap()&amp;lt;/code&amp;gt; one. Unfortunately not always we can do it, need to fix the kernel.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Make dump and restore work under [[selinux]] || medium || - || Selinux imposes more restrictions on the stuff we typically do.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Inherit resources, not restore || medium || - || Sigactions are restored for every task before it fork()-s. Then children check for the sa_action from their image matches to one it got from parent. Need to do the same for rlimits, maybe other resources too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Implement [[restorer v2]] || hard (v2) || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || New images format || medium (v2) || - || See [[what's bad with V1 images]] &lt;br /&gt;
|-&lt;br /&gt;
| crtools || Make [[RPC]] &amp;quot;swrk&amp;quot; mode public || medium || xemul || There's an &amp;quot;swrk&amp;quot; action in CRIU [[Usage|CLI API]]. This turns CRIU into service worker accepting RPC commands. This mode is not documented. Need to standartify one and make public.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Tune the start-time of tasks || medium || - || When we restore tasks their start-time goes forward (since we create the new task effectively). Need to address this somehow, most likely with the [[time namespace]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support chroot-ed mount namespace || medium || - || If the root task lives in another mount namespace ''and'' has its root moved (with chroot()) CRIU dump fails with errors about inability to resolve files' paths. This is because CRIU treats the mount namespace's root as the init task's root which should be &amp;quot;/&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Non-stop memory (first?) pre-dump || medium || - || When reading only the memory we can avoid freezing tasks and draining memory with parasite. There's a system call named &amp;quot;read_process_vm&amp;quot; which can help us accessing the other task's memory. The disadvantage of this approach is the need for additional memory. We may control this behaviour by reading memory in chunks and not allocating to much of additional buffers.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Speed up fetching info about tasks || medium || Andrey Vagin || Using proc to get info about tasks is nice but too slow. We have measured that having socket-based engine that would fetch info about tasks from the kernel speeds things up significantly. So Andrey is working on the [[Task-diag]] patchset that would implement that.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Make pipes swappable || hard || - || When [[Memory dumping and restoring|pre-dumping]] memory we pull all the task's memory into pipe with vmsplice and then send it via network splicing the pages into socket. During this period all the memory is effectively pinned as pages in pipe are not swappable.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Deduplication for shmem [[memory dumps]] || easy || - || We have dedup action and --auto-dedup option for dump/restore which only works for pid pagemaps. Need the same for shmem.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Adjust per-task/-container timers offsets || medium || - || Absolute timers differ on different nodes. When live migrating a task/container this difference may (and will) screw the timers up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[time namespace|Shift timers' timeouts]] according to the actual C-to-R delay || medium || - || If we pause tasks between C and R we, probably, need to adjust timers respectively. &amp;quot;Medium&amp;quot; complexity is because it's unclear ''what'' to do, not ''how''.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Show what was left in the system after dump || easy || - || When we use [[Invisible files|--link-remap]] option or [[TCP connection|--tcp-established]] one CRIU leaves some traces in the system, in particular -- temporary hard links in the former case and iptables rules in the latter. Need some way to show these to the user.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Decode flags from images into symbolic names || easy || - || When we print images contents with [[CRIT]] the flags fields are shown in decimal/hex numbers. It would be nice to print the symbolic names for known flags in some form.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Leases support || easy || - || The F_SETLEASE/F_GETLEASE API is not currently supported, but doesn't differ much from regular locks.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Make proper &amp;quot;check lock present&amp;quot; API in the kernel || medium || - || Currently we detect where a file lock belongs to by locking the file again with the alternative lock type and check how kernel reacts on that. This is not nice as it may tune the lock state on a file. Instead we need the &amp;quot;check lock on fd&amp;quot; call in the kernel.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Put call to mmap into VDSO || easy || Cyrill || To put the [[parasite code]] into target process we modify its code to call the &amp;lt;code&amp;gt;mmap()&amp;lt;/code&amp;gt; system call (and the unmodify it back) and put the parasite into new area. Oleg Nesterov suggests not to patch victim, but to always have one on VDSO.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Integration]] with other projects || hard || - || CRIU is not working great by itself. There's alway some specific about what user wants to dump. Integrating CRIU with other projects will make CRIU work at its best.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore tasks into fresh new pid namespace || easy || Kuprieiev Ruslan || When we dumped processes, it can be hard to restore it back, if they didn't live in a pid namespace, due to PIDs conflict. It would be nice to have the ability to ask CRIU to create the pid namespace for those guys and restore them there. A thing to worry about is this new namespace's init task.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Rollback tree state || medium || - || When we checkpointed process tree with -R option (let them run after checkpoint) we might want to return the tasks into checkpointed state on the same machine. Currently this can only be done by killing the processes and restoring them from scratch. If we could ask CRIU to restore the images ''into'' the ready processes that could speed things up, especially if carefully caring about [[memory changes tracking]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || AIO with pending events || medium || - || When we dump AIO ring we check it not to contain events inside and abort the dump otherwise. Need to dump events too and put them back on restore.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary mountpoints tree || hard || - || Linux kernel can construct tricky knows with [[mount points]]. We don't support arbitrary configuration of such things, only those that are in active use by software. Need to fix them up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Lazy restore using [[userfaultfd]] || medium || xemul || It might make sense to restore tasks w/o putting all the memory into respective places. Instead, the VMAs in question can be marked as &amp;quot;lazy&amp;quot; and pages will get filled into them in the background and, upon demand, in the out-of-order manner. The functionality is related to lazy migration and seamless kernel update tasks.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Lazy migration]] using [[userfaultfd]] || medium || xemul || Lazy migration is when we move all the tasks on another node, but leave theirs memory on the source one. Not to allow tasks read garbage from empty address space we protect all of it as inaccessible. When tasks start reading/writing the mem they got page-fault-ed. With the userfaultfd technology it can be possible to intercept the #PF, pull the page from source node and map it into expected address.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Dump tasks from cgroup || easy || - || Currently criu dumps a subtree from given pid. It makes sense to request CRIU to dump a set of tasks from given cgroup.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Speed up [[logging]] || medium || Cyrill || Synchronous formatting and writes into log files slow things down. On the other hand turning logs off make it impossible to troubleshoot.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Sanitize [[logging]] messages || hard || - || Currently log messages are printed w/o any logic, it's hard to analize what has happened when CRIU fails. Need to improve that by, e.g. categorizing images and [[When C/R fails|explaining them]] in more details.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support OFD posix locks || easy || - || These are still rarely used, but exist. Might make sense to support them in advance, it looks like kernel API allows for that.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Optimize kcmp calls || medium || - || CRIU build [[kcmp trees]] to find out IDs of such objects as MM, FDT and others. Currently we kcmp all tasks to get the ID, but we can improve that by pre-generating ID based on objects that live on MM, FS, etc. If pre-ID of two tasks matches, then we call kcmp, if not -- objects ''are'' different.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shmem changes tracking || medium || - || Memory changes tracker works on anonymous private mappings only. Anonymous shmem is not in active use by server applications, so we don't support one currently. Supporting it should be done by tracking the changes from all the tasks that ''could'' write into the segment. For anon shared memory and sysvipc segment inside IPC namespace this works reliably.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Page transfer filters || medium || - || The page-xfer engine just splices the pages from stealing pipes into socket. Packing or encrypting the data would be nice. Maybe it's purely for [[P.Haul]]?&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[FUSE]] mount points || hard || - || When dumping mountpoints we explicitly check the filesystem mounted. The thing is -- not all filesystems can be just ignored on dump. E.g. FUSE mount involves a user-space daemon that is responsible for the files tree contents. If we just kill one on dump we might not be able to restore it. Need to special-care one.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || 32-bit tasks || hard || Cyrill || For x86 we only dump and restore 64-bit tasks. Doing 32-bit should also be done, but keep in mind, that not only 64-bit tree OR 32-bit tree should be supported. There can be mixed 64-and-32-bit trees out there and CRIU should support those too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Generate task's core file out of images with [[CRIT]] || medium || Ruslan Kuprieiev || Nothing special -- just take core.img, mm.img and pagemap.img and produce the canonical core image out of those.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Modify restored resources run-time in [[CRIT]] daemon || medium || - || Sometimes it might make sense to tune the objects fro images on restore. E.g. -- change the IP address of sockets from task above or fix file paths to be &amp;quot;chroot-ed&amp;quot;. The best solution seems to be in launching CRIT in daemon mode, telling it what images and how to modify and teaching CRIU to &amp;quot;filter&amp;quot; the pb objects read from images through this daemon.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || TCP socket migration with changed IP || medium || - ||  It might make sense to migrate a tcp connection on a box with changed IP address _if_ both boxes are NAT-ed to the destination. We will then have to go to NAT box and fix the conntracks in that case and use CRIT images modifucation facilities.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Applying images]] || hard (v2) || xemul@ w/ students || Think about ability to take images and apply them to a living task(s). Like it was described in the &amp;quot;rollback&amp;quot; feature above. Another exampl -- repopulate fdtable according to data from image. Yet another use-case -- when doing partial migration (see below) we'll need to modify one part to switch from pipes to sockets. What else? With constant replication of tree state we can do incremental dumps on source node and apply those increments on pre-created replicas on the destination node.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Partial migration || hard || - || If tasks subtree has connections to the rest of the tree (e.g. with pipes of unix sockets) we try to detect this and refuse the dump. It should be possible to take part of the tree, migrating it somewhere and recreating the mentioned links with some other appropriate IPC channel. E.g. pipes with sockets, shared memory with distributed shared memory and so on.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shared objects (mm/fs) support || medium || - || Things created with CLONE_FOO flags are not supported now (exception -- full threads). Now we have the kcmp syscall and can do it. The shared fdtable (CLONE_FILES) is supported, the next candidate is mm sharing, as we do know, that MySQL does so sometimes.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Smart paths resolution || hard || - || Files can be overmounted. In this case CRIU will refuse the dump saying that file is [[invisible files|not alive]] but inaccessible by its name. Need a way to resolve paths to such. There are two ways: 1. Move mounts, that overlap the desired path temporarily, then open the file, then move the mountpoint back. 2. When creating a new mount pre-open an fd keeping the mountpoint. Later, do accurate path resolve and call openat() on proper mountpoint fd.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || [[TCP repair TODO|TCP repair fixes]] || hard || - || We can dump and restore live [[TCP connection]]. There are some issues with it, that should be fixed.&lt;br /&gt;
|-&lt;br /&gt;
| kernel?/crtools || TCP conntrack-ed connections || medium || - || When a container uses conntracks inside, we cannot just dump and restore alive TCP connection. Otherwise on restore the resurrected packets will be blocked by connection tracker as they would not be recognized as established connection. Need to check whether connection tracking is ON, dump the needed conntrack info and put the tracker back.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Bridges in container || medium || - || The bridge device state should be read, saved and restored.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || VLANs in containers || medium || - || Vlan (802.1q) device state should be read, saved and restored.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[PPP]] support || medium || - || PPP consists of several things, not just ppp devices. If container uses PPP we should take care of it, currently CRIU just aborts.&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || [[NFS mount points]] support || hard || - || NFS mount points from inside container cannot be easily restored. The thing is -- if we want to restore opened file we will go ahead and [[How hard is it to open a file|call]] the open system call. If the file in question resides on NFS, the latter might need to go to network to check whether the file actually exists and set up the handle. But if the networking is still not restored this operation would fail and we'll have to fail the whole restore. In order to untie this chicken-and-egg problem we may go in two directions.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || [[Seamless kernel upgrade]] || hard || xemul || Briefly -- dump tasks (into memory), change the kernel w/ kexec, then restore tasks back. From the tasks and remote client perspective tasks has just stopped and then resumed on the newer kernel. Can be a good complement to the classic live-patching technology.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Validate .img files || easy || - || [[CRIT]] sub-task. For a given set of image files check, that they are in &amp;quot;restorable&amp;quot; shape, i.e. contain valid data and no pieces are missing.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary process tree || hard ||  - || Need to restore any process tree, which could be created with help PR_SET_CHILD_SUBREAPER and CLONE_PARENT. Processes can share other resources [http://man7.org/linux/man-pages/man2/clone2.2.html clone(2)]. Look at [http://git.criu.org/?p=crtools.git;a=blob;f=test/zdtm/live/static/session02.c;hb=HEAD session02]. The task of resolving the given images into operations we might need to perform seem to be NP (not proven though).&lt;br /&gt;
|-&lt;br /&gt;
| crtools || C/R [[X applications]] || hard || Ruslan Kuprieiev || Dump/restore of graphical applications (see about [[integration]]). In case of X app part of its state is stored into the X-server. Need the way to fetch this state during dump and put this state back into the server on restore. Requires fixing the X-server software too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || Undo semaphores || medium || Cyrill Gorcunov || These are SysVIPC objects created with semctl() and SEM_UNDO flag. Shame on us, we don't even detect these are created. Fortunately they are not in active use. Need to do it -- dump and restore. Requires modifications from both sides -- criu and kernel.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || More detailed RPC fail codes || easy || - || Currently only 3 typical errors are reported(see [https://github.com/xemul/criu/blob/master/include/cr-errno.h#L8 include/cr-errno.h]). Need to extend this set as currently it's hard to understand what has happened w/o analysing CRIU log files.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/criu || FS-notify queues || hard || - || We dump [[Fsnotify]] files, but when they contain events inside -- just ignore those. Need to fetch then and put back on restore. The difficulty here is that while dumping/restoring CRIU may touch files that are monitored and thus produce unwanted events into queue.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Plans]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Todo&amp;diff=2208</id>
		<title>Todo</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Todo&amp;diff=2208"/>
		<updated>2015-03-04T08:33:57Z</updated>

		<summary type="html">&lt;p&gt;Efiop: took &amp;quot;Restore task into fresh new pid namespace&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! component&lt;br /&gt;
! task&lt;br /&gt;
! complexity&lt;br /&gt;
! potential/willing assignee&lt;br /&gt;
! comments&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Make [[RPC]] &amp;quot;swrk&amp;quot; mode public || medium || xemul || There's an &amp;quot;swrk&amp;quot; action in CRIU [[Usage|CLI API]]. This turns CRIU into service worker accepting RPC commands. This mode is not documented. Need to standartify one and make public.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Tune the start-time of tasks || medium || - || When we restore tasks their start-time goes forward (since we create the new task effectively). Need to address this somehow, most likely with the [[time namespace]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support chroot-ed mount namespace || medium || - || If the root task lives in another mount namespace ''and'' has its root moved (with chroot()) CRIU dump fails with errors about inability to resolve files' paths. This is because CRIU treats the mount namespace's root as the init task's root which should be &amp;quot;/&amp;quot;.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Non-stop memory (first?) pre-dump || medium || - || When reading only the memory we can avoid freezing tasks and draining memory with parasite. There's a system call named &amp;quot;read_process_vm&amp;quot; which can help us accessing the other task's memory. The disadvantage of this approach is the need for additional memory. We may control this behaviour by reading memory in chunks and not allocating to much of additional buffers.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Speed up fetching info about tasks || medium || Andrey Vagin || Using proc to get info about tasks is nice but too slow. We have measured that having socket-based engine that would fetch info about tasks from the kernel speeds things up significantly. So Andrey is working on the [[Task-diag]] patchset that would implement that.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Make pipes swappable || hard || - || When [[Memory dumping and restoring|pre-dumping]] memory we pull all the task's memory into pipe with vmsplice and then send it via network splicing the pages into socket. During this period all the memory is effectively pinned as pages in pipe are not swappable.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Deduplication for shmem [[memory dumps]] || easy || - || We have dedup action and --auto-dedup option for dump/restore which only works for pid pagemaps. Need the same for shmem.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Adjust per-task/-container timers offsets || medium || - || Absolute timers differ on different nodes. When live migrating a task/container this difference may (and will) screw the timers up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[time namespace|Shift timers' timeouts]] according to the actual C-to-R delay || medium || - || If we pause tasks between C and R we, probably, need to adjust timers respectively. &amp;quot;Medium&amp;quot; complexity is because it's unclear ''what'' to do, not ''how''.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Show what was left in the system after dump || easy || - || When we use [[Invisible files|--link-remap]] option or [[TCP connection|--tcp-established]] one CRIU leaves some traces in the system, in particular -- temporary hard links in the former case and iptables rules in the latter. Need some way to show these to the user.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Decode flags from images into symbolic names || easy || - || When we print images contents with [[CRIT]] the flags fields are shown in decimal/hex numbers. It would be nice to print the symbolic names for known flags in some form.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Leases support || easy || - || The F_SETLEASE/F_GETLEASE API is not currently supported, but doesn't differ much from regular locks.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Make proper &amp;quot;check lock present&amp;quot; API in the kernel || medium || - || Currently we detect where a file lock belongs to by locking the file again with the alternative lock type and check how kernel reacts on that. This is not nice as it may tune the lock state on a file. Instead we need the &amp;quot;check lock on fd&amp;quot; call in the kernel.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || Put call to mmap into VDSO || easy || Cyrill || To put the [[parasite code]] into target process we modify its code to call the &amp;lt;code&amp;gt;mmap()&amp;lt;/code&amp;gt; system call (and the unmodify it back) and put the parasite into new area. Oleg Nesterov suggests not to patch victim, but to always have one on VDSO.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Integration]] with other projects || hard || - || CRIU is not working great by itself. There's alway some specific about what user wants to dump. Integrating CRIU with other projects will make CRIU work at its best.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore tasks into fresh new pid namespace || easy || Kuprieiev Ruslan || When we dumped processes, it can be hard to restore it back, if they didn't live in a pid namespace, due to PIDs conflict. It would be nice to have the ability to ask CRIU to create the pid namespace for those guys and restore them there. A thing to worry about is this new namespace's init task.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Rollback tree state || medium || - || When we checkpointed process tree with -R option (let them run after checkpoint) we might want to return the tasks into checkpointed state on the same machine. Currently this can only be done by killing the processes and restoring them from scratch. If we could ask CRIU to restore the images ''into'' the ready processes that could speed things up, especially if carefully caring about [[memory changes tracking]].&lt;br /&gt;
|-&lt;br /&gt;
| crtools || AIO with pending events || medium || - || When we dump AIO ring we check it not to contain events inside and abort the dump otherwise. Need to dump events too and put them back on restore.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary mountpoints tree || hard || - || Linux kernel can construct tricky knows with [[mount points]]. We don't support arbitrary configuration of such things, only those that are in active use by software. Need to fix them up.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Lazy restore using [[userfaultfd]] || medium || xemul || It might make sense to restore tasks w/o putting all the memory into respective places. Instead, the VMAs in question can be marked as &amp;quot;lazy&amp;quot; and pages will get filled into them in the background and, upon demand, in the out-of-order manner. The functionality is related to lazy migration and seamless kernel update tasks.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Lazy migration]] using [[userfaultfd]] || medium || xemul || Lazy migration is when we move all the tasks on another node, but leave theirs memory on the source one. Not to allow tasks read garbage from empty address space we protect all of it as inaccessible. When tasks start reading/writing the mem they got page-fault-ed. With the userfaultfd technology it can be possible to intercept the #PF, pull the page from source node and map it into expected address.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Dump tasks from cgroup || easy || - || Currently criu dumps a subtree from given pid. It makes sense to request CRIU to dump a set of tasks from given cgroup.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Speed up [[logging]] || medium || Cyrill || Synchronous formatting and writes into log files slow things down. On the other hand turning logs off make it impossible to troubleshoot.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Sanitize [[logging]] messages || hard || - || Currently log messages are printed w/o any logic, it's hard to analize what has happened when CRIU fails. Need to improve that by, e.g. categorizing images and [[When C/R fails|explaining them]] in more details.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support OFD posix locks || easy || - || These are still rarely used, but exist. Might make sense to support them in advance, it looks like kernel API allows for that.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Optimize kcmp calls || medium || - || CRIU build [[kcmp trees]] to find out IDs of such objects as MM, FDT and others. Currently we kcmp all tasks to get the ID, but we can improve that by pre-generating ID based on objects that live on MM, FS, etc. If pre-ID of two tasks matches, then we call kcmp, if not -- objects ''are'' different.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shmem changes tracking || medium || - || Memory changes tracker works on anonymous private mappings only. Anonymous shmem is not in active use by server applications, so we don't support one currently. Supporting it should be done by tracking the changes from all the tasks that ''could'' write into the segment. For anon shared memory and sysvipc segment inside IPC namespace this works reliably.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Page transfer filters || medium || - || The page-xfer engine just splices the pages from stealing pipes into socket. Packing or encrypting the data would be nice. Maybe it's purely for [[P.Haul]]?&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[FUSE]] mount points || hard || - || When dumping mountpoints we explicitly check the filesystem mounted. The thing is -- not all filesystems can be just ignored on dump. E.g. FUSE mount involves a user-space daemon that is responsible for the files tree contents. If we just kill one on dump we might not be able to restore it. Need to special-care one.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || 32-bit tasks || hard || Cyrill || For x86 we only dump and restore 64-bit tasks. Doing 32-bit should also be done, but keep in mind, that not only 64-bit tree OR 32-bit tree should be supported. There can be mixed 64-and-32-bit trees out there and CRIU should support those too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Generate task's core file out of images with [[CRIT]] || medium || Ruslan Kuprieiev || Nothing special -- just take core.img, mm.img and pagemap.img and produce the canonical core image out of those.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Modify restored resources run-time in [[CRIT]] daemon || medium || - || Sometimes it might make sense to tune the objects fro images on restore. E.g. -- change the IP address of sockets from task above or fix file paths to be &amp;quot;chroot-ed&amp;quot;. The best solution seems to be in launching CRIT in daemon mode, telling it what images and how to modify and teaching CRIU to &amp;quot;filter&amp;quot; the pb objects read from images through this daemon.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || TCP socket migration with changed IP || medium || - ||  It might make sense to migrate a tcp connection on a box with changed IP address _if_ both boxes are NAT-ed to the destination. We will then have to go to NAT box and fix the conntracks in that case and use CRIT images modifucation facilities.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Applying images]] || hard || xemul@ w/ students || Think about ability to take images and apply them to a living task(s). Like it was described in the &amp;quot;rollback&amp;quot; feature above. Another exampl -- repopulate fdtable according to data from image. Yet another use-case -- when doing partial migration (see below) we'll need to modify one part to switch from pipes to sockets. What else? With constant replication of tree state we can do incremental dumps on source node and apply those increments on pre-created replicas on the destination node.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Partial migration || hard || - || If tasks subtree has connections to the rest of the tree (e.g. with pipes of unix sockets) we try to detect this and refuse the dump. It should be possible to take part of the tree, migrating it somewhere and recreating the mentioned links with some other appropriate IPC channel. E.g. pipes with sockets, shared memory with distributed shared memory and so on.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shared objects (mm/fs) support || medium || - || Things created with CLONE_FOO flags are not supported now (exception -- full threads). Now we have the kcmp syscall and can do it. The shared fdtable (CLONE_FILES) is supported, the next candidate is mm sharing, as we do know, that MySQL does so sometimes.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Smart paths resolution || hard || - || Files can be overmounted. In this case CRIU will refuse the dump saying that file is [[invisible files|not alive]] but inaccessible by its name. Need a way to resolve paths to such. There are two ways: 1. Move mounts, that overlap the desired path temporarily, then open the file, then move the mountpoint back. 2. When creating a new mount pre-open an fd keeping the mountpoint. Later, do accurate path resolve and call openat() on proper mountpoint fd.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || [[TCP repair TODO|TCP repair fixes]] || hard || - || We can dump and restore live [[TCP connection]]. There are some issues with it, that should be fixed.&lt;br /&gt;
|-&lt;br /&gt;
| kernel?/crtools || TCP conntrack-ed connections || medium || - || When a container uses conntracks inside, we cannot just dump and restore alive TCP connection. Otherwise on restore the resurrected packets will be blocked by connection tracker as they would not be recognized as established connection. Need to check whether connection tracking is ON, dump the needed conntrack info and put the tracker back.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Bridges in container || medium || - || The bridge device state should be read, saved and restored.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || VLANs in containers || medium || - || Vlan (802.1q) device state should be read, saved and restored.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[PPP]] support || medium || - || PPP consists of several things, not just ppp devices. If container uses PPP we should take care of it, currently CRIU just aborts.&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || [[NFS mount points]] support || hard || - || NFS mount points from inside container cannot be easily restored. The thing is -- if we want to restore opened file we will go ahead and [[How hard is it to open a file|call]] the open system call. If the file in question resides on NFS, the latter might need to go to network to check whether the file actually exists and set up the handle. But if the networking is still not restored this operation would fail and we'll have to fail the whole restore. In order to untie this chicken-and-egg problem we may go in two directions.&lt;br /&gt;
|-&lt;br /&gt;
| kernel || [[Seamless kernel upgrade]] || hard || xemul || Briefly -- dump tasks (into memory), change the kernel w/ kexec, then restore tasks back. From the tasks and remote client perspective tasks has just stopped and then resumed on the newer kernel. Can be a good complement to the classic live-patching technology.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Validate .img files || easy || - || [[CRIT]] sub-task. For a given set of image files check, that they are in &amp;quot;restorable&amp;quot; shape, i.e. contain valid data and no pieces are missing.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore arbitrary process tree || hard ||  - || Need to restore any process tree, which could be created with help PR_SET_CHILD_SUBREAPER and CLONE_PARENT. Processes can share other resources [http://man7.org/linux/man-pages/man2/clone2.2.html clone(2)]. Look at [http://git.criu.org/?p=crtools.git;a=blob;f=test/zdtm/live/static/session02.c;hb=HEAD session02]. The task of resolving the given images into operations we might need to perform seem to be NP (not proven though).&lt;br /&gt;
|-&lt;br /&gt;
| crtools || C/R [[X applications]] || hard || Ruslan Kuprieiev || Dump/restore of graphical applications (see about [[integration]]). In case of X app part of its state is stored into the X-server. Need the way to fetch this state during dump and put this state back into the server on restore. Requires fixing the X-server software too.&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || Undo semaphores || medium || Cyrill Gorcunov || These are SysVIPC objects created with semctl() and SEM_UNDO flag. Shame on us, we don't even detect these are created. Fortunately they are not in active use. Need to do it -- dump and restore. Requires modifications from both sides -- criu and kernel.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || More detailed RPC fail codes || easy || - || Currently only 3 typical errors are reported(see [https://github.com/xemul/criu/blob/master/include/cr-errno.h#L8 include/cr-errno.h]). Need to extend this set as currently it's hard to understand what has happened w/o analysing CRIU log files.&lt;br /&gt;
|-&lt;br /&gt;
| kernel/criu || FS-notify queues || hard || - || We dump [[Fsnotify]] files, but when they contain events inside -- just ignore those. Need to fetch then and put back on restore. The difficulty here is that while dumping/restoring CRIU may touch files that are monitored and thus produce unwanted events into queue.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Plans]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Integration&amp;diff=2055</id>
		<title>Integration</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Integration&amp;diff=2055"/>
		<updated>2015-02-15T15:54:19Z</updated>

		<summary type="html">&lt;p&gt;Efiop: /* Wayland/Weston */ Not X-server, but weston.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CRIU is not so easy to be used as a standalone tool -- it works best integrated into other software. This page lists such software and provides details about the current status.&lt;br /&gt;
&lt;br /&gt;
== OpenVZ ==&lt;br /&gt;
{{Status|in progress}}&lt;br /&gt;
&lt;br /&gt;
Currently, vzctl supports CRIU for checkpoint/restore of upstream containers (i.e. when non-OpenVZ kernel is used). Commands &amp;lt;code&amp;gt;vzctl suspend&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;vzctl restore&amp;lt;/code&amp;gt; fully work. Live migration doesn't work yet as it requires support for &amp;lt;code&amp;gt;vzctl suspend {--suspend, --dump, --kill, --restore}&amp;lt;/code&amp;gt; which is not yet implemented as it requires a separate daemon to hold the state of a partially checkpointed container (or an ability from criu tool to do that).&lt;br /&gt;
* [https://openvz.org Project homepage]&lt;br /&gt;
* [http://git.openvz.org/?p=vzctl&amp;amp;a=search&amp;amp;h=HEAD&amp;amp;st=commit&amp;amp;s=CRIU%7Ccriu%7Ccrtools&amp;amp;sr=1 Relevant vzctl git commits]&lt;br /&gt;
&lt;br /&gt;
== LXC/LXD ==&lt;br /&gt;
{{Status|ready}}&lt;br /&gt;
* [http://linuxcontainers.org Project homepage]&lt;br /&gt;
* The tools version 1.1.0 fully supports CRIU to C/R LXC containers&lt;br /&gt;
* [https://linuxcontainers.org/lxc/manpages/man1/lxc-checkpoint.1.html lxc-checkpoint man page]&lt;br /&gt;
&lt;br /&gt;
== Docker ==&lt;br /&gt;
{{Status|in progress}}&lt;br /&gt;
* [https://docker.io Project homepage]&lt;br /&gt;
* Integration [https://github.com/docker/libcontainer/pull/204 efforts] done by Saied Kazemi from Google&lt;br /&gt;
&lt;br /&gt;
== CoreOS Rocket ==&lt;br /&gt;
{{Status|not started}}&lt;br /&gt;
&lt;br /&gt;
== OpenMPI ==&lt;br /&gt;
{{Status|stalled}}&lt;br /&gt;
* Adrian Reber [https://lisas.de/~adrian/open-mpi.git/ did] first version of patches&lt;br /&gt;
&lt;br /&gt;
== Wayland/Weston ==&lt;br /&gt;
{{Status|under investigation}}&lt;br /&gt;
* Ruslan Kuprieiev plans to [http://lists.openvz.org/pipermail/criu/2015-January/018875.html patch] Weston to let CRIU C/R graphical apps&lt;br /&gt;
&lt;br /&gt;
[[Category:Plans]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Technologies&amp;diff=2031</id>
		<title>Technologies</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Technologies&amp;diff=2031"/>
		<updated>2015-02-09T15:12:58Z</updated>

		<summary type="html">&lt;p&gt;Efiop: Gather useful tools that were developed for criu and could be used in other projects.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains a list of tools that were developed for criu and which others might want to use in their projects.&lt;br /&gt;
These tools are being still maintained, unlike their alternatives. Some of them are not formatted as a separate project(still could be just used,i.e. python modules), but feel free to ask us to distinguish them.&lt;br /&gt;
&lt;br /&gt;
== [https://github.com/xemul/compel Compel] ==&lt;br /&gt;
An utility to execute code in foreign process address space. It is based on the same technology we use in CRIU to obtain some process-private data on dump.&lt;br /&gt;
&lt;br /&gt;
== [https://github.com/xemul/criu/blob/master/pycriu/images/pb2dict.py pb2dict.py] ==&lt;br /&gt;
A Python module to convert google protocol buffers to json and back.&lt;br /&gt;
&lt;br /&gt;
Unlike other projects to convert pb to python dict or json, our pb2dict does treat optional fields with empty repeated inside properly. It includes special support for custom field options to mark those needed to be treated in a special way.&lt;br /&gt;
For example, you could include our [https://github.com/xemul/criu/blob/master/protobuf/opts.proto opts.proto] in your proto-file and use criu.* options&lt;br /&gt;
to mark your fields, i.e.:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;required uint64 blk_sigset = 5[(criu).hex = true];&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See more examples in our protobuf/*.proto files.&lt;br /&gt;
&lt;br /&gt;
It is also worth noting, that we have a unique number for all kinds of custom protobuf options(see [[Images#Notes_about_protobuf]]), so you don't have to worry that it might collide with others.&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT&amp;diff=2027</id>
		<title>CRIT</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT&amp;diff=2027"/>
		<updated>2015-02-07T12:20:10Z</updated>

		<summary type="html">&lt;p&gt;Efiop: /* Convert images to JSON and back */  refresh example and use --pretty&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the CRiu Image Tool. CRIT is a feature-rich replacement for existing &amp;quot;criu show&amp;quot;.&lt;br /&gt;
It is written completely in Python, so it is quite easy to read the code and extend its features.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: crit [-h] [-i IN] [-o OUT] [-f {raw,nice}] {decode,encode}&lt;br /&gt;
&lt;br /&gt;
CRiu Image Tool&lt;br /&gt;
&lt;br /&gt;
positional arguments:&lt;br /&gt;
  {decode,encode}       decode/encode - convert criu image from/to binary type&lt;br /&gt;
                        to/from json&lt;br /&gt;
&lt;br /&gt;
optional arguments:&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
  -i IN, --in IN        input file (stdin by default)&lt;br /&gt;
  -o OUT, --out OUT     output file (stdout by default)&lt;br /&gt;
  --pretty              multi-line with indentation and some fields printed in more human-readable format&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pretty output ===&lt;br /&gt;
&lt;br /&gt;
By default CRIT prints JSON text in one line. This can be read by any further JSON-aware tool for parsing. For human eyes it's more convenient to read JSON multi-line with indentation. However, CRIT does a little bit more and prints some fields in even more pretty manner.&lt;br /&gt;
&lt;br /&gt;
; Addresses and registers&lt;br /&gt;
: VM addresses and core.img register values are all printed in hex. Since JSON doesn't support this form of numbers, such fields are encoded as strings.&lt;br /&gt;
&lt;br /&gt;
; Bit-fields&lt;br /&gt;
: Such things as flags and masks (e.g. sig-block mask) are also better understood when written in hex, so CRIT does this.&lt;br /&gt;
&lt;br /&gt;
; IP addresses&lt;br /&gt;
: By default those a printed in decimal, but the &amp;quot;1.2.3.4&amp;quot; for v4 or &amp;quot;::1&amp;quot; for v6 can be seen in the --pretty mode.&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
&lt;br /&gt;
=== Convert images to JSON and back ===&lt;br /&gt;
&lt;br /&gt;
{{Status|ready}}&lt;br /&gt;
&lt;br /&gt;
This is the replacement for (rather nasty) criu show code. Also this is the way to edit the images before restoring from them.&lt;br /&gt;
&lt;br /&gt;
It uses [https://developers.google.com/protocol-buffers/docs/reference/python/google.protobuf.text_format-module text_format] as a human-readable format for protobuf messages.&lt;br /&gt;
&lt;br /&gt;
The output file is structured in the following way.&lt;br /&gt;
&lt;br /&gt;
Without &amp;quot;--pretty&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;, &amp;quot;entries&amp;quot; : [{&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot;: &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot;: &amp;quot;abc&amp;quot;}, {&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;} ]}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;--pretty&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;,&lt;br /&gt;
    &amp;quot;entries&amp;quot; : [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Example(&amp;quot;crit decode -i core-5679.img --pretty&amp;quot;)&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;amp;quot;magic&amp;amp;quot;: &amp;amp;quot;CORE&amp;amp;quot;, &lt;br /&gt;
    &amp;amp;quot;entries&amp;amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;amp;quot;mtype&amp;amp;quot;: &amp;amp;quot;X86_64&amp;amp;quot;, &lt;br /&gt;
            &amp;amp;quot;thread_core&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;futex_rla_len&amp;amp;quot;: 24, &lt;br /&gt;
                &amp;amp;quot;sched_policy&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;sched_nice&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;futex_rla&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;signals_p&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;sas&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;ss_size&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_sp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_flags&amp;amp;quot;: 2&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;thread_info&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;fpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;st_space&amp;amp;quot;: [&lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;fop&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rdp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;twd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr&amp;amp;quot;: 8064, &lt;br /&gt;
                    &amp;amp;quot;swd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rip&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;xsave&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;ymmh_space&amp;amp;quot;: [&lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0&lt;br /&gt;
                        ], &lt;br /&gt;
                        &amp;amp;quot;xstate_bv&amp;amp;quot;: 2&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;xmm_space&amp;amp;quot;: [&lt;br /&gt;
                        0, &lt;br /&gt;
                        4278190080, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        1701145715, &lt;br /&gt;
                        3219568, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        33, &lt;br /&gt;
                        0, &lt;br /&gt;
                        792358505, &lt;br /&gt;
                        1953460082, &lt;br /&gt;
                        1852400175, &lt;br /&gt;
                        0, &lt;br /&gt;
                        942882145, &lt;br /&gt;
                        876295483, &lt;br /&gt;
                        774519349, &lt;br /&gt;
                        1031303283, &lt;br /&gt;
                        893073459, &lt;br /&gt;
                        976565307, &lt;br /&gt;
                        1937255978, &lt;br /&gt;
                        859661936, &lt;br /&gt;
                        993344312, &lt;br /&gt;
                        3814708, &lt;br /&gt;
                        65, &lt;br /&gt;
                        0, &lt;br /&gt;
                        37049520, &lt;br /&gt;
                        0, &lt;br /&gt;
                        37049632, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4294901760, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;cwd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr_mask&amp;amp;quot;: 65535&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;clear_tid_addr&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;gpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;gs&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ip&amp;amp;quot;: &amp;amp;quot;0x7f172cf1ea04&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;cx&amp;amp;quot;: &amp;amp;quot;0xffffffffffffffff&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;cs&amp;amp;quot;: &amp;amp;quot;0x33&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ax&amp;amp;quot;: &amp;amp;quot;0x38&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;orig_ax&amp;amp;quot;: &amp;amp;quot;0x38&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;di&amp;amp;quot;: &amp;amp;quot;0x1200011&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;es&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;gs_base&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r14&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r15&amp;amp;quot;: &amp;amp;quot;0x2355e00&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r12&amp;amp;quot;: &amp;amp;quot;0x7ffffdbf74f0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r13&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r10&amp;amp;quot;: &amp;amp;quot;0x7f172d83d9d0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r11&amp;amp;quot;: &amp;amp;quot;0x246&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;fs_base&amp;amp;quot;: &amp;amp;quot;0x7f172d83d700&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;bp&amp;amp;quot;: &amp;amp;quot;0x7ffffdbf7530&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;dx&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;bx&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ds&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;ss&amp;amp;quot;: &amp;amp;quot;0x2b&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;sp&amp;amp;quot;: &amp;amp;quot;0x7ffffdbf74f0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r8&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;r9&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;fs&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;si&amp;amp;quot;: &amp;amp;quot;0x0&amp;amp;quot;, &lt;br /&gt;
                    &amp;amp;quot;flags&amp;amp;quot;: &amp;amp;quot;0x246&amp;amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;tc&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;timers&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;real&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;virt&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;prof&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;cg_set&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;signals_s&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;blk_sigset&amp;amp;quot;: &amp;amp;quot;0x10002&amp;amp;quot;, &lt;br /&gt;
                &amp;amp;quot;exit_code&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;rlimits&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;rlimits&amp;amp;quot;: [&lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 8388608&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62844, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62844&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 4096, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 1024&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 65536, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 65536&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62844, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62844&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 819200, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 819200&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }&lt;br /&gt;
                    ]&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;comm&amp;amp;quot;: &amp;amp;quot;loop.sh&amp;amp;quot;, &lt;br /&gt;
                &amp;amp;quot;flags&amp;amp;quot;: 1077960704, &lt;br /&gt;
                &amp;amp;quot;task_state&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;personality&amp;amp;quot;: 0&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Generate core files out of task images ===&lt;br /&gt;
&lt;br /&gt;
{{Status|in progress}}&lt;br /&gt;
&lt;br /&gt;
All the needed information is in core-$pid.img and pagemap-$pid.img&lt;br /&gt;
&lt;br /&gt;
=== On-the-fly conversion ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
There's an idea to make CRIU spawn CRIT and read images &amp;quot;through&amp;quot; it, to allow for at-the-restore-time modifications&lt;br /&gt;
&lt;br /&gt;
=== Convert between different image versions ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
Right now we store the images version in inventory.img and collect info about [[what's bad with V1 images]]. If some day we have v2, CRIT will convert from v1. And for backward compatibility we'll use on-the-fly conversion when restoring from old images.&lt;br /&gt;
&lt;br /&gt;
=== Show images statistics ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
E.g. -- total number of processes, files, memory, sockets, etc.&lt;br /&gt;
&lt;br /&gt;
=== Check/validate images ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
Check that&lt;br /&gt;
* all images are present&lt;br /&gt;
* the inter-images IDs are in consistent state&lt;br /&gt;
&lt;br /&gt;
[[Category:Images]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT&amp;diff=2026</id>
		<title>CRIT</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT&amp;diff=2026"/>
		<updated>2015-02-07T12:15:15Z</updated>

		<summary type="html">&lt;p&gt;Efiop: /* Generate core files out of task images */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the CRiu Image Tool. CRIT is a feature-rich replacement for existing &amp;quot;criu show&amp;quot;.&lt;br /&gt;
It is written completely in Python, so it is quite easy to read the code and extend its features.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: crit [-h] [-i IN] [-o OUT] [-f {raw,nice}] {decode,encode}&lt;br /&gt;
&lt;br /&gt;
CRiu Image Tool&lt;br /&gt;
&lt;br /&gt;
positional arguments:&lt;br /&gt;
  {decode,encode}       decode/encode - convert criu image from/to binary type&lt;br /&gt;
                        to/from json&lt;br /&gt;
&lt;br /&gt;
optional arguments:&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
  -i IN, --in IN        input file (stdin by default)&lt;br /&gt;
  -o OUT, --out OUT     output file (stdout by default)&lt;br /&gt;
  --pretty              multi-line with indentation and some fields printed in more human-readable format&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pretty output ===&lt;br /&gt;
&lt;br /&gt;
By default CRIT prints JSON text in one line. This can be read by any further JSON-aware tool for parsing. For human eyes it's more convenient to read JSON multi-line with indentation. However, CRIT does a little bit more and prints some fields in even more pretty manner.&lt;br /&gt;
&lt;br /&gt;
; Addresses and registers&lt;br /&gt;
: VM addresses and core.img register values are all printed in hex. Since JSON doesn't support this form of numbers, such fields are encoded as strings.&lt;br /&gt;
&lt;br /&gt;
; Bit-fields&lt;br /&gt;
: Such things as flags and masks (e.g. sig-block mask) are also better understood when written in hex, so CRIT does this.&lt;br /&gt;
&lt;br /&gt;
; IP addresses&lt;br /&gt;
: By default those a printed in decimal, but the &amp;quot;1.2.3.4&amp;quot; for v4 or &amp;quot;::1&amp;quot; for v6 can be seen in the --pretty mode.&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
&lt;br /&gt;
=== Convert images to JSON and back ===&lt;br /&gt;
&lt;br /&gt;
{{Status|ready}}&lt;br /&gt;
&lt;br /&gt;
This is the replacement for (rather nasty) criu show code. Also this is the way to edit the images before restoring from them.&lt;br /&gt;
&lt;br /&gt;
It uses [https://developers.google.com/protocol-buffers/docs/reference/python/google.protobuf.text_format-module text_format] as a human-readable format for protobuf messages.&lt;br /&gt;
&lt;br /&gt;
The output file is structured in the following way.&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;--format raw&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;, &amp;quot;entries&amp;quot; : [{&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot;: &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot;: &amp;quot;abc&amp;quot;}, {&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;} ]}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;--format nice&amp;quot;(default for stdout):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;,&lt;br /&gt;
    &amp;quot;entries&amp;quot; : [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Example(&amp;quot;crit decode -i core-20700.img&amp;quot;)&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;amp;quot;magic&amp;amp;quot;: &amp;amp;quot;CORE&amp;amp;quot;, &lt;br /&gt;
    &amp;amp;quot;entries&amp;amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;amp;quot;mtype&amp;amp;quot;: &amp;amp;quot;X86_64&amp;amp;quot;, &lt;br /&gt;
            &amp;amp;quot;thread_core&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;futex_rla_len&amp;amp;quot;: 24, &lt;br /&gt;
                &amp;amp;quot;sched_policy&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;sched_nice&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;futex_rla&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;signals_p&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;sas&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;ss_size&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_sp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_flags&amp;amp;quot;: 2&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;thread_info&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;fpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;st_space&amp;amp;quot;: [&lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;fop&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rdp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;twd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr&amp;amp;quot;: 8064, &lt;br /&gt;
                    &amp;amp;quot;swd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rip&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;xsave&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;ymmh_space&amp;amp;quot;: [&lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0&lt;br /&gt;
                        ], &lt;br /&gt;
                        &amp;amp;quot;xstate_bv&amp;amp;quot;: 2&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;xmm_space&amp;amp;quot;: [&lt;br /&gt;
                        1953064751, &lt;br /&gt;
                        1769104175, &lt;br /&gt;
                        1702113141, &lt;br /&gt;
                        1664054387, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4294901760, &lt;br /&gt;
                        255, &lt;br /&gt;
                        0, &lt;br /&gt;
                        792358505, &lt;br /&gt;
                        1953460082, &lt;br /&gt;
                        1852400175, &lt;br /&gt;
                        0, &lt;br /&gt;
                        942882145, &lt;br /&gt;
                        876295483, &lt;br /&gt;
                        774519349, &lt;br /&gt;
                        1031303283, &lt;br /&gt;
                        893073459, &lt;br /&gt;
                        976565307, &lt;br /&gt;
                        1937255978, &lt;br /&gt;
                        859661936, &lt;br /&gt;
                        993344312, &lt;br /&gt;
                        3814708, &lt;br /&gt;
                        65, &lt;br /&gt;
                        0, &lt;br /&gt;
                        21771440, &lt;br /&gt;
                        0, &lt;br /&gt;
                        21771552, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4278190080, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        4294967040, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4278190080, &lt;br /&gt;
                        4294967040, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;cwd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr_mask&amp;amp;quot;: 65535&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;clear_tid_addr&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;gpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;gs&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ip&amp;amp;quot;: 140137968588056, &lt;br /&gt;
                    &amp;amp;quot;cx&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                    &amp;amp;quot;cs&amp;amp;quot;: 51, &lt;br /&gt;
                    &amp;amp;quot;ax&amp;amp;quot;: 61, &lt;br /&gt;
                    &amp;amp;quot;orig_ax&amp;amp;quot;: 61, &lt;br /&gt;
                    &amp;amp;quot;di&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                    &amp;amp;quot;es&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;gs_base&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r14&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r15&amp;amp;quot;: 4294967295, &lt;br /&gt;
                    &amp;amp;quot;r12&amp;amp;quot;: 21789168, &lt;br /&gt;
                    &amp;amp;quot;r13&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r10&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r11&amp;amp;quot;: 582, &lt;br /&gt;
                    &amp;amp;quot;fs_base&amp;amp;quot;: 140137978173184, &lt;br /&gt;
                    &amp;amp;quot;bp&amp;amp;quot;: 2560, &lt;br /&gt;
                    &amp;amp;quot;dx&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;bx&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ds&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss&amp;amp;quot;: 43, &lt;br /&gt;
                    &amp;amp;quot;sp&amp;amp;quot;: 140736135950616, &lt;br /&gt;
                    &amp;amp;quot;r8&amp;amp;quot;: 21789168, &lt;br /&gt;
                    &amp;amp;quot;r9&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;fs&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;si&amp;amp;quot;: 140736135950656, &lt;br /&gt;
                    &amp;amp;quot;flags&amp;amp;quot;: 582&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;tc&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;timers&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;real&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;virt&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;prof&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;cg_set&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;signals_s&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;blk_sigset&amp;amp;quot;: 65536, &lt;br /&gt;
                &amp;amp;quot;exit_code&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;rlimits&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;rlimits&amp;amp;quot;: [&lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 8388608&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62845, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62845&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 4096, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 1024&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 65536, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 65536&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62845, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62845&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 819200, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 819200&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }&lt;br /&gt;
                    ]&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;comm&amp;amp;quot;: &amp;amp;quot;loop.sh&amp;amp;quot;, &lt;br /&gt;
                &amp;amp;quot;flags&amp;amp;quot;: 1077960704, &lt;br /&gt;
                &amp;amp;quot;task_state&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;personality&amp;amp;quot;: 0&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Generate core files out of task images ===&lt;br /&gt;
&lt;br /&gt;
{{Status|in progress}}&lt;br /&gt;
&lt;br /&gt;
All the needed information is in core-$pid.img and pagemap-$pid.img&lt;br /&gt;
&lt;br /&gt;
=== On-the-fly conversion ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
There's an idea to make CRIU spawn CRIT and read images &amp;quot;through&amp;quot; it, to allow for at-the-restore-time modifications&lt;br /&gt;
&lt;br /&gt;
=== Convert between different image versions ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
Right now we store the images version in inventory.img and collect info about [[what's bad with V1 images]]. If some day we have v2, CRIT will convert from v1. And for backward compatibility we'll use on-the-fly conversion when restoring from old images.&lt;br /&gt;
&lt;br /&gt;
=== Show images statistics ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
E.g. -- total number of processes, files, memory, sockets, etc.&lt;br /&gt;
&lt;br /&gt;
=== Check/validate images ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
Check that&lt;br /&gt;
* all images are present&lt;br /&gt;
* the inter-images IDs are in consistent state&lt;br /&gt;
&lt;br /&gt;
[[Category:Images]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT&amp;diff=2018</id>
		<title>CRIT</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT&amp;diff=2018"/>
		<updated>2015-02-03T18:58:08Z</updated>

		<summary type="html">&lt;p&gt;Efiop: switch core dump state to &amp;quot;In progress&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the CRiu Image Tool. CRIT is a feature-rich replacement for existing &amp;quot;criu show&amp;quot;.&lt;br /&gt;
It is written completely in Python, so it is quite easy to read the code and extend its features.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: crit [-h] [-i IN] [-o OUT] [-f {raw,nice}] {decode,encode}&lt;br /&gt;
&lt;br /&gt;
CRiu Image Tool&lt;br /&gt;
&lt;br /&gt;
positional arguments:&lt;br /&gt;
  {decode,encode}       decode/encode - convert criu image from/to binary type&lt;br /&gt;
                        to/from json&lt;br /&gt;
&lt;br /&gt;
optional arguments:&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
  -i IN, --in IN        input file (stdin by default)&lt;br /&gt;
  -o OUT, --out OUT     output file (stdout by default)&lt;br /&gt;
  --pretty              multi-line with indentation and some fields printed in more human-readable format&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pretty output ===&lt;br /&gt;
&lt;br /&gt;
By default CRIT prints JSON text in one line. This can be read by any further JSON-aware tool for parsing. For human eyes it's more convenient to read JSON multi-line with indentation. However, CRIT does a little bit more and prints some fields in even more pretty manner.&lt;br /&gt;
&lt;br /&gt;
; Addresses and registers&lt;br /&gt;
: VM addresses and core.img register values are all printed in hex. Since JSON doesn't support this form of numbers, such fields are encoded as strings.&lt;br /&gt;
&lt;br /&gt;
; Bit-fields&lt;br /&gt;
: Such things as flags and masks (e.g. sig-block mask) are also better understood when written in hex, so CRIT does this.&lt;br /&gt;
&lt;br /&gt;
; IP addresses&lt;br /&gt;
: By default those a printed in decimal, but the &amp;quot;1.2.3.4&amp;quot; for v4 or &amp;quot;::1&amp;quot; for v6 can be seen in the --pretty mode.&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
&lt;br /&gt;
=== Convert images to JSON and back ===&lt;br /&gt;
&lt;br /&gt;
{{Status|ready}}&lt;br /&gt;
&lt;br /&gt;
This is the replacement for (rather nasty) criu show code. Also this is the way to edit the images before restoring from them.&lt;br /&gt;
&lt;br /&gt;
It uses [https://developers.google.com/protocol-buffers/docs/reference/python/google.protobuf.text_format-module text_format] as a human-readable format for protobuf messages.&lt;br /&gt;
&lt;br /&gt;
The output file is structured in the following way.&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;--format raw&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;, &amp;quot;entries&amp;quot; : [{&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot;: &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot;: &amp;quot;abc&amp;quot;}, {&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;} ]}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;--format nice&amp;quot;(default for stdout):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;,&lt;br /&gt;
    &amp;quot;entries&amp;quot; : [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Example(&amp;quot;crit decode -i core-20700.img&amp;quot;)&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;amp;quot;magic&amp;amp;quot;: &amp;amp;quot;CORE&amp;amp;quot;, &lt;br /&gt;
    &amp;amp;quot;entries&amp;amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;amp;quot;mtype&amp;amp;quot;: &amp;amp;quot;X86_64&amp;amp;quot;, &lt;br /&gt;
            &amp;amp;quot;thread_core&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;futex_rla_len&amp;amp;quot;: 24, &lt;br /&gt;
                &amp;amp;quot;sched_policy&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;sched_nice&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;futex_rla&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;signals_p&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;sas&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;ss_size&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_sp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_flags&amp;amp;quot;: 2&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;thread_info&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;fpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;st_space&amp;amp;quot;: [&lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;fop&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rdp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;twd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr&amp;amp;quot;: 8064, &lt;br /&gt;
                    &amp;amp;quot;swd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rip&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;xsave&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;ymmh_space&amp;amp;quot;: [&lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0&lt;br /&gt;
                        ], &lt;br /&gt;
                        &amp;amp;quot;xstate_bv&amp;amp;quot;: 2&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;xmm_space&amp;amp;quot;: [&lt;br /&gt;
                        1953064751, &lt;br /&gt;
                        1769104175, &lt;br /&gt;
                        1702113141, &lt;br /&gt;
                        1664054387, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4294901760, &lt;br /&gt;
                        255, &lt;br /&gt;
                        0, &lt;br /&gt;
                        792358505, &lt;br /&gt;
                        1953460082, &lt;br /&gt;
                        1852400175, &lt;br /&gt;
                        0, &lt;br /&gt;
                        942882145, &lt;br /&gt;
                        876295483, &lt;br /&gt;
                        774519349, &lt;br /&gt;
                        1031303283, &lt;br /&gt;
                        893073459, &lt;br /&gt;
                        976565307, &lt;br /&gt;
                        1937255978, &lt;br /&gt;
                        859661936, &lt;br /&gt;
                        993344312, &lt;br /&gt;
                        3814708, &lt;br /&gt;
                        65, &lt;br /&gt;
                        0, &lt;br /&gt;
                        21771440, &lt;br /&gt;
                        0, &lt;br /&gt;
                        21771552, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4278190080, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        4294967040, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4278190080, &lt;br /&gt;
                        4294967040, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;cwd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr_mask&amp;amp;quot;: 65535&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;clear_tid_addr&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;gpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;gs&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ip&amp;amp;quot;: 140137968588056, &lt;br /&gt;
                    &amp;amp;quot;cx&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                    &amp;amp;quot;cs&amp;amp;quot;: 51, &lt;br /&gt;
                    &amp;amp;quot;ax&amp;amp;quot;: 61, &lt;br /&gt;
                    &amp;amp;quot;orig_ax&amp;amp;quot;: 61, &lt;br /&gt;
                    &amp;amp;quot;di&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                    &amp;amp;quot;es&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;gs_base&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r14&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r15&amp;amp;quot;: 4294967295, &lt;br /&gt;
                    &amp;amp;quot;r12&amp;amp;quot;: 21789168, &lt;br /&gt;
                    &amp;amp;quot;r13&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r10&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r11&amp;amp;quot;: 582, &lt;br /&gt;
                    &amp;amp;quot;fs_base&amp;amp;quot;: 140137978173184, &lt;br /&gt;
                    &amp;amp;quot;bp&amp;amp;quot;: 2560, &lt;br /&gt;
                    &amp;amp;quot;dx&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;bx&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ds&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss&amp;amp;quot;: 43, &lt;br /&gt;
                    &amp;amp;quot;sp&amp;amp;quot;: 140736135950616, &lt;br /&gt;
                    &amp;amp;quot;r8&amp;amp;quot;: 21789168, &lt;br /&gt;
                    &amp;amp;quot;r9&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;fs&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;si&amp;amp;quot;: 140736135950656, &lt;br /&gt;
                    &amp;amp;quot;flags&amp;amp;quot;: 582&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;tc&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;timers&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;real&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;virt&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;prof&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;cg_set&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;signals_s&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;blk_sigset&amp;amp;quot;: 65536, &lt;br /&gt;
                &amp;amp;quot;exit_code&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;rlimits&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;rlimits&amp;amp;quot;: [&lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 8388608&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62845, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62845&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 4096, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 1024&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 65536, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 65536&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62845, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62845&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 819200, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 819200&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }&lt;br /&gt;
                    ]&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;comm&amp;amp;quot;: &amp;amp;quot;loop.sh&amp;amp;quot;, &lt;br /&gt;
                &amp;amp;quot;flags&amp;amp;quot;: 1077960704, &lt;br /&gt;
                &amp;amp;quot;task_state&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;personality&amp;amp;quot;: 0&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Generate core files out of task images ===&lt;br /&gt;
&lt;br /&gt;
{{Status|In progress}}&lt;br /&gt;
&lt;br /&gt;
All the needed information is in core-$pid.img and pagemap-$pid.img&lt;br /&gt;
&lt;br /&gt;
=== On-the-fly conversion ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
There's an idea to make CRIU spawn CRIT and read images &amp;quot;through&amp;quot; it, to allow for at-the-restore-time modifications&lt;br /&gt;
&lt;br /&gt;
=== Convert between different image versions ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
Right now we store the images version in inventory.img and collect info about [[what's bad with V1 images]]. If some day we have v2, CRIT will convert from v1. And for backward compatibility we'll use on-the-fly conversion when restoring from old images.&lt;br /&gt;
&lt;br /&gt;
=== Show images statistics ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
E.g. -- total number of processes, files, memory, sockets, etc.&lt;br /&gt;
&lt;br /&gt;
=== Check/validate images ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
Check that&lt;br /&gt;
* all images are present&lt;br /&gt;
* the inter-images IDs are in consistent state&lt;br /&gt;
&lt;br /&gt;
[[Category:Images]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Installation&amp;diff=2009</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Installation&amp;diff=2009"/>
		<updated>2015-02-02T14:35:31Z</updated>

		<summary type="html">&lt;p&gt;Efiop: python-ipaddr&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;criu&amp;lt;/code&amp;gt; is an utility to checkpoint/restore a process tree. This page describes how to manually build and install prerequisites and the tool itself.&lt;br /&gt;
&lt;br /&gt;
{{Note|Most probably you don't need manual installation, but rather [[Packages]] for your distro.}}&lt;br /&gt;
&lt;br /&gt;
== Obtaining CRIU Source ==&lt;br /&gt;
&lt;br /&gt;
You can download the source code as a release tarball or sync the [http://git.criu.org/?p=criu.git;a=summary git repository].&lt;br /&gt;
&lt;br /&gt;
{{Out|{{Latest release}}}}&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.criu.org/criu.git&lt;br /&gt;
 cd criu&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== Compiler and C Library ===&lt;br /&gt;
For native compilation on Debian based systems, install the &amp;lt;code&amp;gt;build-essential&amp;lt;/code&amp;gt; package. For cross compiling for ARM and AArch64, the Linaro prebuilt toolchains are a good choice. Installing them is described below. They are ia32 architecture binaries. On a modern Debian based x86_64 you will need to install the &amp;lt;code&amp;gt;lib32stdc++6&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lib32z1&amp;lt;/code&amp;gt; packages.&lt;br /&gt;
&lt;br /&gt;
 mkdir -p deps/`uname -m`-linux-gnu&lt;br /&gt;
 cd deps&lt;br /&gt;
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.06_linux.tar.xz&lt;br /&gt;
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-aarch64-linux-gnu-4.9-2014.06-02_linux.tar.xz&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
=== Protocol Buffers with C Bindings ===&lt;br /&gt;
&lt;br /&gt;
CRIU uses the [https://github.com/protobuf-c/protobuf-c C language bindings] of [https://developers.google.com/protocol-buffers/ Google Protocol Buffers] for serialization. The &amp;lt;code&amp;gt;protoc&amp;lt;/code&amp;gt; tool is required at build time and &amp;lt;code&amp;gt;libprotobuf-c.so&amp;lt;/code&amp;gt; is required at build time and at run time, assuming dynamic linking.&lt;br /&gt;
&lt;br /&gt;
[[CRIT]] also uses python language bindings of Google Protocol Buffers and requires descriptor.proto from developer files that could be found in protobuf-devel package. &lt;br /&gt;
&lt;br /&gt;
==== Distribution Packages ====&lt;br /&gt;
The easiest approach for most would be to install distribution packages. RPM package names: &amp;lt;code&amp;gt;protobuf-c-compiler&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;protobuf-c-devel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;protobuf-devel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;protobuf-python&amp;lt;/code&amp;gt;. Debian package names: &amp;lt;code&amp;gt;protobuf-c-compiler&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;libprotobuf-c0-dev&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;protobuf-compiler&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;protobuf-python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Building Protocol Buffers From Source ====&lt;br /&gt;
If you would like to build from source, you can use the following commands to obtain the source code repositories, configure, and build the code. On a Debian based system, you may have to install the following packages first: &amp;lt;code&amp;gt;autoconf curl g++ libtool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Native protobuf =====&lt;br /&gt;
 cd deps&lt;br /&gt;
 git clone https://github.com/google/protobuf.git protobuf&lt;br /&gt;
 cd protobuf&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure --prefix=`pwd`/../`uname -m`-linux-gnu&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
===== Native protobuf-c =====&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 git clone https://github.com/protobuf-c/protobuf-c.git protobuf-c&lt;br /&gt;
 cd protobuf-c&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 mkdir ../pbc-`uname -m`&lt;br /&gt;
 cd ../pbc-`uname -m`&lt;br /&gt;
 ../protobuf-c/configure --prefix=`pwd`/../`uname -m`-linux-gnu \&lt;br /&gt;
   PKG_CONFIG_PATH=`pwd`/../`uname -m`-linux-gnu/lib/pkgconfig&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
===== Cross Compiling for ARMv7 =====&lt;br /&gt;
If you would like to cross-compile for armv7:&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-arm&lt;br /&gt;
 cd pbc-arm&lt;br /&gt;
 ../protobuf-c/configure --host=arm-linux-gnueabihf --prefix=`pwd`/../arm-linux-gnueabihf --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
===== Cross Compiling for ARMv8 =====&lt;br /&gt;
If you would like to cross-compile for armv8:&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-aarch64&lt;br /&gt;
 cd pbc-aarch64&lt;br /&gt;
  ../protobuf-c/configure --host=aarch64-linux-gnu --prefix=`pwd`/../aarch64-linux-gnu --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
=== Other deps ===&lt;br /&gt;
==== python-ipaddr ====&lt;br /&gt;
Used in CRIT to pretty-print ip.&lt;br /&gt;
=== Some minor, but useful dependencies ===&lt;br /&gt;
==== libbsd ====&lt;br /&gt;
If libbsd is available, CRIU will be compiled with setproctitle() support. It allows to make process titles of service workers to be more verbose.&lt;br /&gt;
&lt;br /&gt;
== Building CRIU From Source ==&lt;br /&gt;
&lt;br /&gt;
=== Native Compilation ===&lt;br /&gt;
With the CRIU source obtained in the first step and dependencies satisfied in the second step, we are now compile CRIU. For native compilation with the dependencies met using distribution packages, simply run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the CRIU source directory.&lt;br /&gt;
&lt;br /&gt;
Here is an example of building natively specifying manually built dependencies.&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 rsync -a --exclude=.git --exclude=deps .. criu-`uname -m`&lt;br /&gt;
 cd criu-`uname -m`&lt;br /&gt;
 make \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../`uname -m`-linux-gnu/include -L`pwd`/../`uname -m`-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
 sudo LD_LIBRARY_PATH=`pwd`/../`uname -m`-linux-gnu/lib ./criu check&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
=== Cross Compilation for ARMv7 ===&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 rsync -a --exclude=.git --exclude=deps .. criu-arm&lt;br /&gt;
 cd criu-arm&lt;br /&gt;
 make \&lt;br /&gt;
   ARCH=arm \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/arm-linux-gnueabihf- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../arm-linux-gnueabihf/include -L`pwd`/../arm-linux-gnueabihf/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
=== Cross Compilation for ARMv8 ===&lt;br /&gt;
&lt;br /&gt;
  cd deps&lt;br /&gt;
  rsync -a --exclude=.git --exclude=deps .. criu-aarch64&lt;br /&gt;
  cd criu-aarch64&lt;br /&gt;
  make \&lt;br /&gt;
   ARCH=aarch64 \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/aarch64-linux-gnu- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../aarch64-linux-gnu/include -L`pwd`/../aarch64-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
  cd ../..&lt;br /&gt;
&lt;br /&gt;
=== Linux Kernel ===&lt;br /&gt;
&lt;br /&gt;
Linux kernel v3.11 or newer is required, with some specific options set. If your distribution does not provide needed kernel, you might want to compile one yourself. Note we also have our [[custom kernel]], which might contain some experimental CRIU related patches.&lt;br /&gt;
&lt;br /&gt;
Note you might have to enable&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EXPERT&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Configure standard kernel features (expert users)&lt;br /&gt;
option, which depends on&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EMBEDDED&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Embedded system&lt;br /&gt;
(welcome to Kconfig reverse chains hell).&lt;br /&gt;
&lt;br /&gt;
The following options must be enabled for CRIU to work:&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_CHECKPOINT_RESTORE&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Checkpoint/restore support&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NAMESPACES&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support &lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_UTS_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; UTS namespace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_IPC_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; IPC namespace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_PID_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; PID namespaces&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NET_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; Network namespace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_FHANDLE&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; open by fhandle syscalls&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EVENTFD&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Enable eventfd() system call&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EPOLL&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Enable eventpoll support&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_INOTIFY_USER&amp;lt;/code&amp;gt;&lt;br /&gt;
: File systems -&amp;gt; Inotify support for userspace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_IA32_EMULATION&amp;lt;/code&amp;gt;&lt;br /&gt;
: Executable file formats -&amp;gt; Emulations -&amp;gt; IA32 Emulation&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_UNIX_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Unix domain sockets -&amp;gt; UNIX: socket monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_INET_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; TCP/IP networking -&amp;gt; INET: socket monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_INET_UDP_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; TCP/IP networking -&amp;gt; INET: socket monitoring interface -&amp;gt; UDP: socket monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_PACKET_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Packet socket -&amp;gt; Packet: sockets monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NETLINK_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Netlink socket -&amp;gt; Netlink: sockets monitoring interface&lt;br /&gt;
&lt;br /&gt;
For some [[usage scenarios]] there is an ability to track memory changes and produce [[incremental dumps]]. Need to enable&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_MEM_SOFT_DIRTY&amp;lt;/code&amp;gt;&lt;br /&gt;
: Processor type and features -&amp;gt; Track memory changes&lt;br /&gt;
&lt;br /&gt;
At the moment it's known that CRIU will '''NOT''' work if packet generator module is loaded. Thus make sure&lt;br /&gt;
that either module is unloaded or not compiled at all.&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NET_PKTGEN&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Network testing -&amp;gt; Packet generator&lt;br /&gt;
&lt;br /&gt;
=== iproute2 ===&lt;br /&gt;
The iproute2 tool version 3.5.0 or higher is needed for dumping network namespaces.&lt;br /&gt;
The latest one can be cloned from [http://git.kernel.org/?p=linux/kernel/git/shemminger/iproute2.git;a=summary iproute2]. It should be compiled and a path to ip written in the environment variable &amp;lt;code&amp;gt;CR_IP_TOOL&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Checking That It Works ==&lt;br /&gt;
&lt;br /&gt;
First thing to do is to run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# criu check --ms&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end it should say &amp;quot;Looks OK&amp;quot;, if it doesn't the messages on the screen explain what functionality is missing.&lt;br /&gt;
If you're using our custom kernel, then the &amp;lt;code&amp;gt;--ms&amp;lt;/code&amp;gt; option should not be used, in this case CRIU would&lt;br /&gt;
check for ''all'' the kernel features to work.&lt;br /&gt;
&lt;br /&gt;
You can then try running the [[ZDTM Test Suite]] which sits in the &amp;lt;code&amp;gt;tests/zdtm/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
{{Out|There's a known issue with BTRFS spoiling dev_t values for files and sockets! Not all tests will work on it.}}&lt;br /&gt;
&lt;br /&gt;
== Using CR tools ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Usage]] and [[Advanced usage]], as well as [[:Category:HOWTO]].&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT&amp;diff=2007</id>
		<title>CRIT</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT&amp;diff=2007"/>
		<updated>2015-02-01T18:33:43Z</updated>

		<summary type="html">&lt;p&gt;Efiop: add a bit more verbose CRIT description and its purpose&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the CRiu Image Tool. CRIT is a feature-rich replacement for existing &amp;quot;criu show&amp;quot;.&lt;br /&gt;
It is written completely in Python, so it is quite easy to read the code and extend its features.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: crit [-h] [-i IN] [-o OUT] [-f {raw,nice}] {decode,encode}&lt;br /&gt;
&lt;br /&gt;
CRiu Image Tool&lt;br /&gt;
&lt;br /&gt;
positional arguments:&lt;br /&gt;
  {decode,encode}       decode/encode - convert criu image from/to binary type&lt;br /&gt;
                        to/from json&lt;br /&gt;
&lt;br /&gt;
optional arguments:&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
  -i IN, --in IN        input file (stdin by default)&lt;br /&gt;
  -o OUT, --out OUT     output file (stdout by default)&lt;br /&gt;
  -f {raw,nice}, --format {raw,nice}&lt;br /&gt;
                        well-formated output (by default: raw for files and&lt;br /&gt;
                        nice for stdout)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
&lt;br /&gt;
=== Convert images to JSON and back ===&lt;br /&gt;
&lt;br /&gt;
{{Status|ready}}&lt;br /&gt;
&lt;br /&gt;
This is the replacement for (rather nasty) criu show code. Also this is the way to edit the images before restoring from them.&lt;br /&gt;
&lt;br /&gt;
It uses [https://developers.google.com/protocol-buffers/docs/reference/python/google.protobuf.text_format-module text_format] as a human-readable format for protobuf messages.&lt;br /&gt;
&lt;br /&gt;
The output file is structured in the following way.&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;--format raw&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;, &amp;quot;entries&amp;quot; : [{&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot;: &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot;: &amp;quot;abc&amp;quot;}, {&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;} ]}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;--format nice&amp;quot;(default for stdout):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;,&lt;br /&gt;
    &amp;quot;entries&amp;quot; : [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Example(&amp;quot;crit decode -i core-20700.img&amp;quot;)&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;amp;quot;magic&amp;amp;quot;: &amp;amp;quot;CORE&amp;amp;quot;, &lt;br /&gt;
    &amp;amp;quot;entries&amp;amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;amp;quot;mtype&amp;amp;quot;: &amp;amp;quot;X86_64&amp;amp;quot;, &lt;br /&gt;
            &amp;amp;quot;thread_core&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;futex_rla_len&amp;amp;quot;: 24, &lt;br /&gt;
                &amp;amp;quot;sched_policy&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;sched_nice&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;futex_rla&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;signals_p&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;sas&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;ss_size&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_sp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_flags&amp;amp;quot;: 2&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;thread_info&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;fpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;st_space&amp;amp;quot;: [&lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;fop&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rdp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;twd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr&amp;amp;quot;: 8064, &lt;br /&gt;
                    &amp;amp;quot;swd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rip&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;xsave&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;ymmh_space&amp;amp;quot;: [&lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0&lt;br /&gt;
                        ], &lt;br /&gt;
                        &amp;amp;quot;xstate_bv&amp;amp;quot;: 2&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;xmm_space&amp;amp;quot;: [&lt;br /&gt;
                        1953064751, &lt;br /&gt;
                        1769104175, &lt;br /&gt;
                        1702113141, &lt;br /&gt;
                        1664054387, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4294901760, &lt;br /&gt;
                        255, &lt;br /&gt;
                        0, &lt;br /&gt;
                        792358505, &lt;br /&gt;
                        1953460082, &lt;br /&gt;
                        1852400175, &lt;br /&gt;
                        0, &lt;br /&gt;
                        942882145, &lt;br /&gt;
                        876295483, &lt;br /&gt;
                        774519349, &lt;br /&gt;
                        1031303283, &lt;br /&gt;
                        893073459, &lt;br /&gt;
                        976565307, &lt;br /&gt;
                        1937255978, &lt;br /&gt;
                        859661936, &lt;br /&gt;
                        993344312, &lt;br /&gt;
                        3814708, &lt;br /&gt;
                        65, &lt;br /&gt;
                        0, &lt;br /&gt;
                        21771440, &lt;br /&gt;
                        0, &lt;br /&gt;
                        21771552, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4278190080, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        4294967040, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4278190080, &lt;br /&gt;
                        4294967040, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;cwd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr_mask&amp;amp;quot;: 65535&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;clear_tid_addr&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;gpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;gs&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ip&amp;amp;quot;: 140137968588056, &lt;br /&gt;
                    &amp;amp;quot;cx&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                    &amp;amp;quot;cs&amp;amp;quot;: 51, &lt;br /&gt;
                    &amp;amp;quot;ax&amp;amp;quot;: 61, &lt;br /&gt;
                    &amp;amp;quot;orig_ax&amp;amp;quot;: 61, &lt;br /&gt;
                    &amp;amp;quot;di&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                    &amp;amp;quot;es&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;gs_base&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r14&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r15&amp;amp;quot;: 4294967295, &lt;br /&gt;
                    &amp;amp;quot;r12&amp;amp;quot;: 21789168, &lt;br /&gt;
                    &amp;amp;quot;r13&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r10&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r11&amp;amp;quot;: 582, &lt;br /&gt;
                    &amp;amp;quot;fs_base&amp;amp;quot;: 140137978173184, &lt;br /&gt;
                    &amp;amp;quot;bp&amp;amp;quot;: 2560, &lt;br /&gt;
                    &amp;amp;quot;dx&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;bx&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ds&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss&amp;amp;quot;: 43, &lt;br /&gt;
                    &amp;amp;quot;sp&amp;amp;quot;: 140736135950616, &lt;br /&gt;
                    &amp;amp;quot;r8&amp;amp;quot;: 21789168, &lt;br /&gt;
                    &amp;amp;quot;r9&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;fs&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;si&amp;amp;quot;: 140736135950656, &lt;br /&gt;
                    &amp;amp;quot;flags&amp;amp;quot;: 582&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;tc&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;timers&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;real&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;virt&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;prof&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;cg_set&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;signals_s&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;blk_sigset&amp;amp;quot;: 65536, &lt;br /&gt;
                &amp;amp;quot;exit_code&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;rlimits&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;rlimits&amp;amp;quot;: [&lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 8388608&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62845, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62845&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 4096, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 1024&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 65536, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 65536&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62845, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62845&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 819200, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 819200&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }&lt;br /&gt;
                    ]&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;comm&amp;amp;quot;: &amp;amp;quot;loop.sh&amp;amp;quot;, &lt;br /&gt;
                &amp;amp;quot;flags&amp;amp;quot;: 1077960704, &lt;br /&gt;
                &amp;amp;quot;task_state&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;personality&amp;amp;quot;: 0&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Generate core files out of task images ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
All the needed information is in core-$pid.img and pagemap-$pid.img&lt;br /&gt;
&lt;br /&gt;
=== On-the-fly conversion ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
There's an idea to make CRIU spawn CRIT and read images &amp;quot;through&amp;quot; it, to allow for at-the-restore-time modifications&lt;br /&gt;
&lt;br /&gt;
=== Convert between different image versions ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
Right now we store the images version in inventory.img and collect info about [[what's bad with V1 images]]. If some day we have v2, CRIT will convert from v1. And for backward compatibility we'll use on-the-fly conversion when restoring from old images.&lt;br /&gt;
&lt;br /&gt;
=== Show images statistics ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
E.g. -- total number of processes, files, memory, sockets, etc.&lt;br /&gt;
&lt;br /&gt;
=== Check/validate images ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
Check that&lt;br /&gt;
* all images are present&lt;br /&gt;
* the inter-images IDs are in consistent state&lt;br /&gt;
&lt;br /&gt;
[[Category:Images]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Todo&amp;diff=2006</id>
		<title>Todo</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Todo&amp;diff=2006"/>
		<updated>2015-02-01T17:33:44Z</updated>

		<summary type="html">&lt;p&gt;Efiop: sign for core dump&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! component&lt;br /&gt;
! task&lt;br /&gt;
! complexity&lt;br /&gt;
! potential/willing assignee&lt;br /&gt;
! comments&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore tasks into fresh new pid namespace || easy || - || A thing to worry about is this new namespace's init task.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Rollback tree state || medium || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || AIO with pending events || medium || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || restore  mountpoints || hard || - || -&lt;br /&gt;
|-&lt;br /&gt;
| crtools || lazy migration using userfaultd || medium || xemul || -&lt;br /&gt;
|-&lt;br /&gt;
| crtools || dump tasks from cgroup || easy || - || Currently criu dumps a subtree from given pid&lt;br /&gt;
|-&lt;br /&gt;
| crtools || speed up logging || medium || Cyrill || Synchronous formatting and writes to log files slow things down ([[Logging]])&lt;br /&gt;
|-&lt;br /&gt;
| crtools || sanitize logging messages || hard || - || Currently log messages are placed w/o any logic. Need to improve that ... somehow.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || support OFD posix locks || easy || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || optimize kcmp calls || medium || - || For fs/fdt/vm/etc we can pre-generate ID based on objects that live on them. If pre-ID matches, then call kcmp.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shmem changes tracking || medium || - || &lt;br /&gt;
|-&lt;br /&gt;
| crtools || Page transfer filters || medium || Ruslan Kuprieiev || Packing or encrypting the data would be nice. Maybe it's purely for [[P.Haul]]?&lt;br /&gt;
|-&lt;br /&gt;
| crtools || FUSE || hard || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || 32-bit tasks || hard || Cyrill || &lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support one of MPI implementations || hard || Adrian Reber || worth starting with OpenMPI&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Generate task's core file out of images || medium || Ruslan Kuprieiev || [[CRIT]]&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Modify restored resources run-time || medium || - || [[CRIT]] Need (probably) some way to alter what is being restored. Usage example -- change the IP address of sockets from task above.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || TCP socket migration with changed IP || medium || - ||  [[CRIT]] it might make sense to migrate a tcp connection on a box with changed IP address _if_ both boxes are NAT-ed to the destination. We will then have to go to NAT box and fix the conntracks, but this might make sense.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Applying images]] || hard || xemul@ w/ students || Think about ability to take images and apply them to a living task(s). E.g. -- repopulate fdtable according to data from image. Another use-case -- when doing partial migration we'll need to modify one part to switch from pipes to sockets&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Partial migration || hard || - || migrate some tasks while proxying IPC to existing others (pipes-&amp;gt;sockets, etc.)&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shared objects (mm/fs) support || medium || - || Now we have the kcmp syscall and can do it. The first candidate is mm sharing, as we do know, that MySQL does so sometimes.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Smart paths resolution || hard || - || Need a way to resolve paths to overmounted files. There are two ways: 1. Move mounts, that overlap the desired path temprarily. 2. When creating a new mount pre-open an fd keeping the mountpoint. Later, do accurate path resolve and call openat() on proper mountpoint fd&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || TCP repair fixes || hard || - || [[TCP repair TODO]]&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Bridges in container || medium || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || VLANs in containers || medium || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || PPP support || medium || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || DelayFS for NFS/Fuse migration || hard || - ||&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Seamless kernel upgrade || hard || xemul ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || NFS || hard || - || Probably depends on DelayFS&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Validate .img files || easy || - || [[CRIT]] For a given set of image files check, that they are in &amp;quot;restorable&amp;quot; shape&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore a process tree || hard ||  - || Need to restore any process tree, which could be created with help PR_SET_CHILD_SUBREAPER and CLONE_PARENT. Processes can share other resources [http://man7.org/linux/man-pages/man2/clone2.2.html clone(2)]. Look at [http://git.criu.org/?p=crtools.git;a=blob;f=test/zdtm/live/static/session02.c;hb=HEAD session02]&lt;br /&gt;
|-&lt;br /&gt;
| crtools || X app || hard || - || Dump/restore of graphical applications(Maybe worth switching to Wayland?)&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Wayland app || hard || - || Dump/restore of a graphical application. Require mods from compositors(worth starting with Weston) to get\set state. [http://people.freedesktop.org/~cbrill/dri-log/?channel=wayland&amp;amp;highlight_names=&amp;amp;date=2015-01-30 Here] are some talks on #wayland.&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || Undo semaphores || medium || Cyrill Gorcunov || Require mods from both sides -- criu and kernel&lt;br /&gt;
|-&lt;br /&gt;
| crtools || More detailed RPC fail codes || easy || - || Currently only 3 typical errors are reported(see [https://github.com/xemul/criu/blob/master/include/cr-errno.h#L8 include/cr-errno.h])&lt;br /&gt;
|-&lt;br /&gt;
| kernel/criu || fsnotify queues || hard || - || [[Fsnotify]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Plans]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Todo&amp;diff=2005</id>
		<title>Todo</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Todo&amp;diff=2005"/>
		<updated>2015-02-01T17:31:28Z</updated>

		<summary type="html">&lt;p&gt;Efiop: wayland&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! component&lt;br /&gt;
! task&lt;br /&gt;
! complexity&lt;br /&gt;
! potential/willing assignee&lt;br /&gt;
! comments&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore tasks into fresh new pid namespace || easy || - || A thing to worry about is this new namespace's init task.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Rollback tree state || medium || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || AIO with pending events || medium || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || restore  mountpoints || hard || - || -&lt;br /&gt;
|-&lt;br /&gt;
| crtools || lazy migration using userfaultd || medium || xemul || -&lt;br /&gt;
|-&lt;br /&gt;
| crtools || dump tasks from cgroup || easy || - || Currently criu dumps a subtree from given pid&lt;br /&gt;
|-&lt;br /&gt;
| crtools || speed up logging || medium || Cyrill || Synchronous formatting and writes to log files slow things down ([[Logging]])&lt;br /&gt;
|-&lt;br /&gt;
| crtools || sanitize logging messages || hard || - || Currently log messages are placed w/o any logic. Need to improve that ... somehow.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || support OFD posix locks || easy || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || optimize kcmp calls || medium || - || For fs/fdt/vm/etc we can pre-generate ID based on objects that live on them. If pre-ID matches, then call kcmp.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shmem changes tracking || medium || - || &lt;br /&gt;
|-&lt;br /&gt;
| crtools || Page transfer filters || medium || Ruslan Kuprieiev || Packing or encrypting the data would be nice. Maybe it's purely for [[P.Haul]]?&lt;br /&gt;
|-&lt;br /&gt;
| crtools || FUSE || hard || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || 32-bit tasks || hard || Cyrill || &lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support one of MPI implementations || hard || Adrian Reber || worth starting with OpenMPI&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Generate task's core file out of images || medium || - || [[CRIT]]&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Modify restored resources run-time || medium || - || [[CRIT]] Need (probably) some way to alter what is being restored. Usage example -- change the IP address of sockets from task above.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || TCP socket migration with changed IP || medium || - ||  [[CRIT]] it might make sense to migrate a tcp connection on a box with changed IP address _if_ both boxes are NAT-ed to the destination. We will then have to go to NAT box and fix the conntracks, but this might make sense.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Applying images]] || hard || xemul@ w/ students || Think about ability to take images and apply them to a living task(s). E.g. -- repopulate fdtable according to data from image. Another use-case -- when doing partial migration we'll need to modify one part to switch from pipes to sockets&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Partial migration || hard || - || migrate some tasks while proxying IPC to existing others (pipes-&amp;gt;sockets, etc.)&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shared objects (mm/fs) support || medium || - || Now we have the kcmp syscall and can do it. The first candidate is mm sharing, as we do know, that MySQL does so sometimes.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Smart paths resolution || hard || - || Need a way to resolve paths to overmounted files. There are two ways: 1. Move mounts, that overlap the desired path temprarily. 2. When creating a new mount pre-open an fd keeping the mountpoint. Later, do accurate path resolve and call openat() on proper mountpoint fd&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || TCP repair fixes || hard || - || [[TCP repair TODO]]&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Bridges in container || medium || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || VLANs in containers || medium || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || PPP support || medium || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || DelayFS for NFS/Fuse migration || hard || - ||&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Seamless kernel upgrade || hard || xemul ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || NFS || hard || - || Probably depends on DelayFS&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Validate .img files || easy || - || [[CRIT]] For a given set of image files check, that they are in &amp;quot;restorable&amp;quot; shape&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore a process tree || hard ||  - || Need to restore any process tree, which could be created with help PR_SET_CHILD_SUBREAPER and CLONE_PARENT. Processes can share other resources [http://man7.org/linux/man-pages/man2/clone2.2.html clone(2)]. Look at [http://git.criu.org/?p=crtools.git;a=blob;f=test/zdtm/live/static/session02.c;hb=HEAD session02]&lt;br /&gt;
|-&lt;br /&gt;
| crtools || X app || hard || - || Dump/restore of graphical applications(Maybe worth switching to Wayland?)&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Wayland app || hard || - || Dump/restore of a graphical application. Require mods from compositors(worth starting with Weston) to get\set state. [http://people.freedesktop.org/~cbrill/dri-log/?channel=wayland&amp;amp;highlight_names=&amp;amp;date=2015-01-30 Here] are some talks on #wayland.&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || Undo semaphores || medium || Cyrill Gorcunov || Require mods from both sides -- criu and kernel&lt;br /&gt;
|-&lt;br /&gt;
| crtools || More detailed RPC fail codes || easy || - || Currently only 3 typical errors are reported(see [https://github.com/xemul/criu/blob/master/include/cr-errno.h#L8 include/cr-errno.h])&lt;br /&gt;
|-&lt;br /&gt;
| kernel/criu || fsnotify queues || hard || - || [[Fsnotify]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Plans]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Asciinema&amp;diff=2002</id>
		<title>Asciinema</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Asciinema&amp;diff=2002"/>
		<updated>2015-01-31T15:17:32Z</updated>

		<summary type="html">&lt;p&gt;Efiop: Self-dump of a python app using CRIU RPC&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There's a nice service called [https://asciinema.org asciinema] out there. We plan to create a set of tutorials and this page lists the plans and already finished ones.&lt;br /&gt;
&lt;br /&gt;
* [https://asciinema.org/a/15649 Getting started]&lt;br /&gt;
* [https://asciinema.org/a/15651 Single ZDTM test run] ([[ZDTM Test Suite]])&lt;br /&gt;
* [https://asciinema.org/a/15652 Exploring the images] ([[CRIT]])&lt;br /&gt;
* [https://asciinema.org/a/15653 Running the &amp;quot;criu dump&amp;quot; command]&lt;br /&gt;
* [https://asciinema.org/a/15655 Preparing the patch for submission] ([[How to submit patches]])&lt;br /&gt;
* [https://asciinema.org/a/15668 Adding a new ZDTM test case] ([[ZDTM API]])&lt;br /&gt;
* [https://asciinema.org/a/15832 C/R of running &amp;quot;top&amp;quot;] ([[Advanced usage]])&lt;br /&gt;
* [https://asciinema.org/a/15833 Live TCP connection C/R] ([[TCP connection]])&lt;br /&gt;
* [https://asciinema.org/a/15842 Playing with action scripts] ([[Action scripts]])&lt;br /&gt;
* [https://asciinema.org/a/15844 Stackable images basics] ([[Memory changes tracking]])&lt;br /&gt;
* [https://asciinema.org/a/15847 Using page-server] ([[Disk-less migration]])&lt;br /&gt;
* [https://asciinema.org/a/15857 Using the pre-dump command] ([[Iterative migration]])&lt;br /&gt;
* [https://asciinema.org/a/15920 Self-dump of a python app using CRIU RPC] ([[RPC]])&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Images&amp;diff=1990</id>
		<title>Images</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Images&amp;diff=1990"/>
		<updated>2015-01-28T18:00:50Z</updated>

		<summary type="html">&lt;p&gt;Efiop: mention undocumented tcp-stream image structure&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The criu utility dumps the state of processes/containers into a set of image files. This article describes the format of them.&lt;br /&gt;
&lt;br /&gt;
{{Note| You might also want to checkout our image tool called [[CRIT]]}}&lt;br /&gt;
&lt;br /&gt;
== Types of image files ==&lt;br /&gt;
&lt;br /&gt;
CRIU images can be in one of formats&lt;br /&gt;
&lt;br /&gt;
* criu specific images in google protocol buffer format (PB format)&lt;br /&gt;
* criu specific images with binary data in it&lt;br /&gt;
* image files in 3rd party format (a.k.a. raw images)&lt;br /&gt;
&lt;br /&gt;
== Images in criu-specific format ==&lt;br /&gt;
&lt;br /&gt;
All criu-specific image files begin with 32-bit magic cookie. Images in PB format are followed by zero or more entries of the same type (not size!), each entry is preceded with 32-bit entry size value (not including this 32-bit value itself). Optionally each entry may be followed by extra payload which depends on the entry type.&lt;br /&gt;
&lt;br /&gt;
IOW protocol-buffers image files look like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IMAGE_FILE ::= MAGIC { ENTRY }&lt;br /&gt;
ENTRY      ::= SIZE PAYLOAD [ EXTRA ]&lt;br /&gt;
PAYLOAD    ::= &amp;quot;message encoded in ProtocolBuffer format&amp;quot;&lt;br /&gt;
EXTRA      ::= &amp;quot;arbitrary blob, depends on the PAYLOAD contents&amp;quot;&lt;br /&gt;
&lt;br /&gt;
MAGIC      ::= &amp;quot;32 bit integer&amp;quot;&lt;br /&gt;
SIZE       ::= &amp;quot;32 bit integer, equals the PAYLOAD length&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or, you can visualize it like&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Size(bytes)&lt;br /&gt;
|-&lt;br /&gt;
| Magic || 4&lt;br /&gt;
|-&lt;br /&gt;
| Size0 || 4&lt;br /&gt;
|-&lt;br /&gt;
| Message0 || Size0&lt;br /&gt;
|-&lt;br /&gt;
| ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| SizeN || 4&lt;br /&gt;
|-&lt;br /&gt;
| MessageN || SizeN&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The amount of entries in a image file depends on the type of file.&lt;br /&gt;
&lt;br /&gt;
=== Images with PB data  ===&lt;br /&gt;
&lt;br /&gt;
Such images can be one of&lt;br /&gt;
&lt;br /&gt;
; Array image files&lt;br /&gt;
: In these files the amount of entries can be any. You should read the image file up to the EOF to find out the exact number.&lt;br /&gt;
; Single-entry image files&lt;br /&gt;
: In these files exactly one entry is stored.&lt;br /&gt;
&lt;br /&gt;
A file type can be guessed by the magic. The description of the entries in ProtocolBuffers language are in respective .proto files which reside in &amp;lt;code&amp;gt;protobuf/&amp;lt;/code&amp;gt; directory in the source tree.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! name&lt;br /&gt;
 ! type&lt;br /&gt;
 ! description&lt;br /&gt;
 ! extra payload&lt;br /&gt;
 ! describing proto file&lt;br /&gt;
 |-&lt;br /&gt;
 | inventory || single-entry || Top level description of images || - || inventory.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fdinfo || array || Open file descriptors || - || fdinfo.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | reg-files || array || Paths to files opened with &amp;lt;code&amp;gt;open(2)&amp;lt;/code&amp;gt; syscall || - || regfile.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventfd || array || Eventfd file information || - || eventfd.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventpoll || array || Eventpoll file information || - || eventpoll.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventpoll-tfd || array || Target file descriptors of eventpoll fds || - || eventpoll.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inotify || array || Inotify file information || - || intotify.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inotify-wd || array || Watch descriptors of inotify fds || - || inotify.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | signalfd || array || signalfd info || - || signalfd.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | core || single-entry || Arch-dependent information (registers, etc.) || - || core.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | mm || single-entry ||  Address space generic information (segments, exe file, etc.) || - || mm.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | vmas || array || Virtual mappings (&amp;lt;code&amp;gt;mmap(2)&amp;lt;/code&amp;gt;) || - || vma.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pipes || array || Pipes information || - || pipe.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pipes-data || array || Contents of pipes || &amp;lt;code&amp;gt;entry.bytes&amp;lt;/code&amp;gt; bytes of data sitting in a pipe || pipe-data.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fifo || array || FIFO information || - || fifo.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fifo-data || array || Contents of FIFOs || same as in pipes-data || pipe-data.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pstree || array || Process tree linkage and IDs || - || pstree.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | sigacts || array || Signal handling map || - || sa.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | unixsk || array || Unix domain sockets || - || sk-unix.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inetsk || array || PF_INET sockets, both IPv4 and IPv6 || - || sk-inet.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | sk-queues || array || Contents of socket queues || &amp;lt;code&amp;gt;entry.length&amp;lt;/code&amp;gt; bytes of data, one entry per packet || sk-packet.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | itimers || array || Interval timers state || - || itimer.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | creds || single-entry || Task credentials: uids, gids, caps, etc. || - || creds.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fs || single-entry || Chroot and chdir information || - || fs.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | remap-fpath || array || File paths remaps || - || remap-file-path.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | ghost-file || single-entry || Ghost files (those, not visible from FS, but still used by tasks) || Right after the entry up to the EOF goes the contents of the file || ghost-file.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tcp-stream || single-entry || TCP connection state (including data in queues) || &amp;lt;code&amp;gt;entry.inq_len&amp;lt;/code&amp;gt; bytes of in-queue data followed by &amp;lt;code&amp;gt;entry.outq_len&amp;lt;/code&amp;gt; bytes of out-queue data || tcp-stream.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | mountpoints || array || Mountpoints information || - || mnt.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | utsns || single-entry || Uname nodename and domainname of a UTS namespace || - || utsns.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tty || array || Information about opened tty-s || - || tty.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tty-info || array || Termios and similar stuff about tty-s || - || tty.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | packetsk || array || Info about PF_PACKET sockets || - || packet-sock.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | netdev || array || Info about network devices || - || netdev.proto&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Images with memory dumps ===&lt;br /&gt;
&lt;br /&gt;
Memory info is stored in two types of images&lt;br /&gt;
&lt;br /&gt;
; Pagemap files&lt;br /&gt;
: These files contain info about which virtual regions are populated with data. The file is a set of protobuf messages.&lt;br /&gt;
{{Note| Even though, pagemap is an array kind of image(and can be included to the previous type), first pb message is of type pagemap_head and all the following ones are of type pagemap_entry. }}&lt;br /&gt;
&lt;br /&gt;
; Pages files&lt;br /&gt;
: These contain 4k pages that are to be put into the memory according to the pagemap.&lt;br /&gt;
&lt;br /&gt;
== Raw images ==&lt;br /&gt;
&lt;br /&gt;
These images contain data that were collected by criu with the help of some external tools. These are&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! name&lt;br /&gt;
 ! tool that understand this format&lt;br /&gt;
 ! description&lt;br /&gt;
 |-&lt;br /&gt;
 | ifaddr || iproute2's ip || Contains info about IP addresses on network devices&lt;br /&gt;
 |-&lt;br /&gt;
 | route || iproute2's ip || Contains routing tables&lt;br /&gt;
 |-&lt;br /&gt;
 | tmpfs || tar + gzip || Contains contents of tmpfs filesystem&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== Notes about protobuf ==&lt;br /&gt;
We have a registered field number(1018) for [https://developers.google.com/protocol-buffers/docs/proto#options custom options] of all kinds. See protobuf/opts.proto for more info.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[What's bad with V1 images]]&lt;br /&gt;
* [[ImageFieldMerging | Image field merging]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Images]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=C_API&amp;diff=1945</id>
		<title>C API</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=C_API&amp;diff=1945"/>
		<updated>2015-01-19T19:44:54Z</updated>

		<summary type="html">&lt;p&gt;Efiop: fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''libcriu''' is a C API for CRIU, which is a simple wrapper around our [[RPC]]. Although you can use [[RPC]] directly, libcriu is a wrapper providing the interface that is much easier to use from C code. Note that [[RPC]] is supported in the first place, and if you want the most recent set of features you should probably use [[RPC]] directly.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
libcriu functions are defined in &amp;lt;code&amp;gt;lib/criu.h&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To create a library &amp;lt;code&amp;gt;lib/libcriu.so&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the main directory.&lt;br /&gt;
&lt;br /&gt;
The library is not thread- and fork- safe.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
&lt;br /&gt;
=== init options ===&lt;br /&gt;
&lt;br /&gt;
Call &amp;lt;code&amp;gt;int criu_init_opts(void)&amp;lt;/code&amp;gt; to initialize request options.&lt;br /&gt;
&lt;br /&gt;
Note: it should be called before using any other functions from libcriu, except &amp;lt;code&amp;gt;criu_check()&amp;lt;/code&amp;gt;. Also you should use it to reinitialize options. It returns 0 on success and -1 on fail.&lt;br /&gt;
&lt;br /&gt;
=== set service address ===&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;void criu_set_service_address(char *address)&amp;lt;/code&amp;gt; to specify path to a CRIU service socket. Call it with NULL to make libcriu use the default address (currently &amp;lt;code&amp;gt;/var/run/criu_service.socket&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== set dump/restore options ===&lt;br /&gt;
Use &amp;lt;code&amp;gt;criu_set_*&amp;lt;/code&amp;gt; functions to setup dump/restore options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void criu_set_pid(int pid);&lt;br /&gt;
void criu_set_images_dir_fd(int fd); /* must be set for dump/restore */&lt;br /&gt;
void criu_set_leave_running(bool leave_running);&lt;br /&gt;
void criu_set_ext_unix_sk(bool ext_unix_sk);&lt;br /&gt;
void criu_set_tcp_established(bool tcp_established);&lt;br /&gt;
void criu_set_evasive_devices(bool evasive_devices);&lt;br /&gt;
void criu_set_shell_job(bool shell_job);&lt;br /&gt;
void criu_set_file_locks(bool file_locks);&lt;br /&gt;
void criu_set_log_level(int log_level);&lt;br /&gt;
void criu_set_log_file(char *log_file);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no pid is set on dump, CRIU will dump the calling process itself.&lt;br /&gt;
{{Note|If a calling process is not run as root, the whole process tree to be dumped must have the same uid, otherwise CRIU refuses to dump. See [[Usage#Security]].}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;lt;code&amp;gt;images_dir_fd&amp;lt;/code&amp;gt; is '''required''' at dump/restore, all other options might be left unset.&lt;br /&gt;
The client must open directory for/with images by itself and set &amp;lt;code&amp;gt;images_dir_fd&amp;lt;/code&amp;gt; to the opened directory fd.&lt;br /&gt;
CRIU will open /proc/&amp;lt;client's_pid&amp;gt;/fd/&amp;lt;images_dir_fd&amp;gt;, so it will work even if the client is in another namespace.}}&lt;br /&gt;
&lt;br /&gt;
The logic of setting request is the same as when setting options in console. Here is an example:&lt;br /&gt;
&lt;br /&gt;
 #criu restore -D /path/to/imgs_dir -v4 -o restore.log&lt;br /&gt;
&lt;br /&gt;
is equal to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
criu_init_opts();&lt;br /&gt;
criu_set_service_address(&amp;quot;/path/to/criu/service/socket&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
int fd = open(&amp;quot;/path/to/imgs_dir&amp;quot;, O_DIRECTORY);&lt;br /&gt;
criu_set_images_dir_fd(fd);&lt;br /&gt;
&lt;br /&gt;
criu_set_log_file(&amp;quot;restore.log&amp;quot;);&lt;br /&gt;
criu_set_log_level(4);&lt;br /&gt;
&lt;br /&gt;
criu_restore();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Operations ==&lt;br /&gt;
&lt;br /&gt;
Use the following functions to perform CRIU actions.&lt;br /&gt;
&lt;br /&gt;
=== check ===&lt;br /&gt;
&lt;br /&gt;
 int criu_check(void);&lt;br /&gt;
&lt;br /&gt;
=== dump ===&lt;br /&gt;
&lt;br /&gt;
 int criu_dump(void);&lt;br /&gt;
&lt;br /&gt;
=== restore ===&lt;br /&gt;
&lt;br /&gt;
 int criu_restore(void);&lt;br /&gt;
&lt;br /&gt;
=== restore as child ===&lt;br /&gt;
This one is special. It will fork and exec criu swrk(Service WoRKer) to allow restoring process as a caller child. Calling &amp;quot;exec&amp;quot; implies some restrictions, as, for example, one should make sure, that criu binary is present in PATH and has suid bit set(see  [[Usage#Security]]).&lt;br /&gt;
&lt;br /&gt;
 int criu_restore_child(void);&lt;br /&gt;
&lt;br /&gt;
=== Return values ===&lt;br /&gt;
&lt;br /&gt;
Here is a table of return and errno values of the above functions:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value&lt;br /&gt;
! errno&lt;br /&gt;
! Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| undefined&lt;br /&gt;
| Success&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;0&lt;br /&gt;
| undefined&lt;br /&gt;
| Success (&amp;lt;code&amp;gt;criu_restore()&amp;lt;/code&amp;gt; only)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| -EBADE&lt;br /&gt;
| RPC error (if provided(see [https://github.com/xemul/criu/blob/master/include/cr-errno.h#L8 include/cr-errno.h]), 0 otherwise)&lt;br /&gt;
| RPC has returned fail.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| -ECONNREFUSED&lt;br /&gt;
| errno&lt;br /&gt;
| Unable to connect to CRIU.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| -ECOMM&lt;br /&gt;
| errno&lt;br /&gt;
| Unable to send/recv msg to/from CRIU.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| -EINVAL&lt;br /&gt;
| undefined&lt;br /&gt;
| CRIU doesn't support this type of request. You should probably update CRIU.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| -EBADMSG&lt;br /&gt;
| undefined&lt;br /&gt;
| Unexpected response from CRIU. You should probably update CRIU.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
You could find example of using libcriu at [http://git.criu.org/?p=criu.git;a=tree;f=test/libcriu test/libcriu].&lt;br /&gt;
&lt;br /&gt;
[[Category: API]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=C_API&amp;diff=1944</id>
		<title>C API</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=C_API&amp;diff=1944"/>
		<updated>2015-01-19T19:43:03Z</updated>

		<summary type="html">&lt;p&gt;Efiop: add criu_restore_child()&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''libcriu''' is a C API for CRIU, which is a simple wrapper around our [[RPC]]. Although you can use [[RPC]] directly, libcriu is a wrapper providing the interface that is much easier to use from C code. Note that [[RPC]] is supported in the first place, and if you want the most recent set of features you should probably use [[RPC]] directly.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
libcriu functions are defined in &amp;lt;code&amp;gt;lib/criu.h&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To create a library &amp;lt;code&amp;gt;lib/libcriu.so&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the main directory.&lt;br /&gt;
&lt;br /&gt;
The library is not thread- and fork- safe.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
&lt;br /&gt;
=== init options ===&lt;br /&gt;
&lt;br /&gt;
Call &amp;lt;code&amp;gt;int criu_init_opts(void)&amp;lt;/code&amp;gt; to initialize request options.&lt;br /&gt;
&lt;br /&gt;
Note: it should be called before using any other functions from libcriu, except &amp;lt;code&amp;gt;criu_check()&amp;lt;/code&amp;gt;. Also you should use it to reinitialize options. It returns 0 on success and -1 on fail.&lt;br /&gt;
&lt;br /&gt;
=== set service address ===&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;void criu_set_service_address(char *address)&amp;lt;/code&amp;gt; to specify path to a CRIU service socket. Call it with NULL to make libcriu use the default address (currently &amp;lt;code&amp;gt;/var/run/criu_service.socket&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== set dump/restore options ===&lt;br /&gt;
Use &amp;lt;code&amp;gt;criu_set_*&amp;lt;/code&amp;gt; functions to setup dump/restore options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void criu_set_pid(int pid);&lt;br /&gt;
void criu_set_images_dir_fd(int fd); /* must be set for dump/restore */&lt;br /&gt;
void criu_set_leave_running(bool leave_running);&lt;br /&gt;
void criu_set_ext_unix_sk(bool ext_unix_sk);&lt;br /&gt;
void criu_set_tcp_established(bool tcp_established);&lt;br /&gt;
void criu_set_evasive_devices(bool evasive_devices);&lt;br /&gt;
void criu_set_shell_job(bool shell_job);&lt;br /&gt;
void criu_set_file_locks(bool file_locks);&lt;br /&gt;
void criu_set_log_level(int log_level);&lt;br /&gt;
void criu_set_log_file(char *log_file);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no pid is set on dump, CRIU will dump the calling process itself.&lt;br /&gt;
{{Note|If a calling process is not run as root, the whole process tree to be dumped must have the same uid, otherwise CRIU refuses to dump. See [[Usage#Security]].}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;lt;code&amp;gt;images_dir_fd&amp;lt;/code&amp;gt; is '''required''' at dump/restore, all other options might be left unset.&lt;br /&gt;
The client must open directory for/with images by itself and set &amp;lt;code&amp;gt;images_dir_fd&amp;lt;/code&amp;gt; to the opened directory fd.&lt;br /&gt;
CRIU will open /proc/&amp;lt;client's_pid&amp;gt;/fd/&amp;lt;images_dir_fd&amp;gt;, so it will work even if the client is in another namespace.}}&lt;br /&gt;
&lt;br /&gt;
The logic of setting request is the same as when setting options in console. Here is an example:&lt;br /&gt;
&lt;br /&gt;
 #criu restore -D /path/to/imgs_dir -v4 -o restore.log&lt;br /&gt;
&lt;br /&gt;
is equal to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
criu_init_opts();&lt;br /&gt;
criu_set_service_address(&amp;quot;/path/to/criu/service/socket&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
int fd = open(&amp;quot;/path/to/imgs_dir&amp;quot;, O_DIRECTORY);&lt;br /&gt;
criu_set_images_dir_fd(fd);&lt;br /&gt;
&lt;br /&gt;
criu_set_log_file(&amp;quot;restore.log&amp;quot;);&lt;br /&gt;
criu_set_log_level(4);&lt;br /&gt;
&lt;br /&gt;
criu_restore();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Operations ==&lt;br /&gt;
&lt;br /&gt;
Use the following functions to perform CRIU actions.&lt;br /&gt;
&lt;br /&gt;
=== check ===&lt;br /&gt;
&lt;br /&gt;
 int criu_check(void);&lt;br /&gt;
&lt;br /&gt;
=== dump ===&lt;br /&gt;
&lt;br /&gt;
 int criu_dump(void);&lt;br /&gt;
&lt;br /&gt;
=== restore ===&lt;br /&gt;
&lt;br /&gt;
 int criu_restore(void);&lt;br /&gt;
&lt;br /&gt;
=== restore as child ===&lt;br /&gt;
This one is special. It will fork and exec criu swrk(Service WoRKer) to allow restoring process as a caller child. Calling &amp;quot;exec&amp;quot; implies some restrictions, as, for example, one should make sure, that criu binary is present in PATH and has [[Security suid bit]] set.&lt;br /&gt;
&lt;br /&gt;
 int criu_restore_child(void);&lt;br /&gt;
&lt;br /&gt;
=== Return values ===&lt;br /&gt;
&lt;br /&gt;
Here is a table of return and errno values of the above functions:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value&lt;br /&gt;
! errno&lt;br /&gt;
! Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| undefined&lt;br /&gt;
| Success&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;0&lt;br /&gt;
| undefined&lt;br /&gt;
| Success (&amp;lt;code&amp;gt;criu_restore()&amp;lt;/code&amp;gt; only)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| -EBADE&lt;br /&gt;
| RPC error (if provided(see [https://github.com/xemul/criu/blob/master/include/cr-errno.h#L8 include/cr-errno.h]), 0 otherwise)&lt;br /&gt;
| RPC has returned fail.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| -ECONNREFUSED&lt;br /&gt;
| errno&lt;br /&gt;
| Unable to connect to CRIU.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| -ECOMM&lt;br /&gt;
| errno&lt;br /&gt;
| Unable to send/recv msg to/from CRIU.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| -EINVAL&lt;br /&gt;
| undefined&lt;br /&gt;
| CRIU doesn't support this type of request. You should probably update CRIU.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| -EBADMSG&lt;br /&gt;
| undefined&lt;br /&gt;
| Unexpected response from CRIU. You should probably update CRIU.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
You could find example of using libcriu at [http://git.criu.org/?p=criu.git;a=tree;f=test/libcriu test/libcriu].&lt;br /&gt;
&lt;br /&gt;
[[Category: API]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Installation&amp;diff=1943</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Installation&amp;diff=1943"/>
		<updated>2015-01-19T12:50:27Z</updated>

		<summary type="html">&lt;p&gt;Efiop: protobuf-devel&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;criu&amp;lt;/code&amp;gt; is an utility to checkpoint/restore a process tree. This page describes how to manually build and install prerequisites and the tool itself.&lt;br /&gt;
&lt;br /&gt;
{{Note|Most probably you don't need manual installation, but rather [[Packages]] for your distro.}}&lt;br /&gt;
&lt;br /&gt;
== Obtaining CRIU Source ==&lt;br /&gt;
&lt;br /&gt;
You can download the source code as a release tarball or sync the [http://git.criu.org/?p=criu.git;a=summary git repository].&lt;br /&gt;
&lt;br /&gt;
{{Out|{{Latest release}}}}&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.criu.org/criu.git&lt;br /&gt;
 cd criu&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== Compiler and C Library ===&lt;br /&gt;
For native compilation on Debian based systems, install the &amp;lt;code&amp;gt;build-essential&amp;lt;/code&amp;gt; package. For cross compiling for ARM and AArch64, the Linaro prebuilt toolchains are a good choice. Installing them is described below. They are ia32 architecture binaries. On a modern Debian based x86_64 you will need to install the &amp;lt;code&amp;gt;lib32stdc++6&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lib32z1&amp;lt;/code&amp;gt; packages.&lt;br /&gt;
&lt;br /&gt;
 mkdir -p deps/`uname -m`-linux-gnu&lt;br /&gt;
 cd deps&lt;br /&gt;
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.06_linux.tar.xz&lt;br /&gt;
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-aarch64-linux-gnu-4.9-2014.06-02_linux.tar.xz&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
=== Protocol Buffers with C Bindings ===&lt;br /&gt;
&lt;br /&gt;
CRIU uses the [https://github.com/protobuf-c/protobuf-c C language bindings] of [https://developers.google.com/protocol-buffers/ Google Protocol Buffers] for serialization. The &amp;lt;code&amp;gt;protoc&amp;lt;/code&amp;gt; tool is required at build time and &amp;lt;code&amp;gt;libprotobuf-c.so&amp;lt;/code&amp;gt; is required at build time and at run time, assuming dynamic linking.&lt;br /&gt;
&lt;br /&gt;
[[CRIT]] also uses python language bindings of Google Protocol Buffers and requires descriptor.proto from developer files that could be found in protobuf-devel package. &lt;br /&gt;
&lt;br /&gt;
==== Distribution Packages ====&lt;br /&gt;
The easiest approach for most would be to install distribution packages. RPM package names: &amp;lt;code&amp;gt;protobuf-c-compiler&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;protobuf-c-devel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;protobuf-devel&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;protobuf-python&amp;lt;/code&amp;gt;. Debian package names: &amp;lt;code&amp;gt;protobuf-c-compiler&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;libprotobuf-c0-dev&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;protobuf-compiler&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;protobuf-python&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Building Protocol Buffers From Source ====&lt;br /&gt;
If you would like to build from source, you can use the following commands to obtain the source code repositories, configure, and build the code. On a Debian based system, you may have to install the following packages first: &amp;lt;code&amp;gt;autoconf curl g++ libtool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Native protobuf =====&lt;br /&gt;
 cd deps&lt;br /&gt;
 git clone https://github.com/google/protobuf.git protobuf&lt;br /&gt;
 cd protobuf&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure --prefix=`pwd`/../`uname -m`-linux-gnu&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
===== Native protobuf-c =====&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 git clone https://github.com/protobuf-c/protobuf-c.git protobuf-c&lt;br /&gt;
 cd protobuf-c&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 mkdir ../pbc-`uname -m`&lt;br /&gt;
 cd ../pbc-`uname -m`&lt;br /&gt;
 ../protobuf-c/configure --prefix=`pwd`/../`uname -m`-linux-gnu \&lt;br /&gt;
   PKG_CONFIG_PATH=`pwd`/../`uname -m`-linux-gnu/lib/pkgconfig&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
===== Cross Compiling for ARMv7 =====&lt;br /&gt;
If you would like to cross-compile for armv7:&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-arm&lt;br /&gt;
 cd pbc-arm&lt;br /&gt;
 ../protobuf-c/configure --host=arm-linux-gnueabihf --prefix=`pwd`/../arm-linux-gnueabihf --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
===== Cross Compiling for ARMv8 =====&lt;br /&gt;
If you would like to cross-compile for armv8:&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-aarch64&lt;br /&gt;
 cd pbc-aarch64&lt;br /&gt;
  ../protobuf-c/configure --host=aarch64-linux-gnu --prefix=`pwd`/../aarch64-linux-gnu --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
=== Some minor, but useful dependencies ===&lt;br /&gt;
==== libbsd ====&lt;br /&gt;
If libbsd is available, CRIU will be compiled with setproctitle() support. It allows to make process titles of service workers to be more verbose.&lt;br /&gt;
&lt;br /&gt;
== Building CRIU From Source ==&lt;br /&gt;
&lt;br /&gt;
=== Native Compilation ===&lt;br /&gt;
With the CRIU source obtained in the first step and dependencies satisfied in the second step, we are now compile CRIU. For native compilation with the dependencies met using distribution packages, simply run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the CRIU source directory.&lt;br /&gt;
&lt;br /&gt;
Here is an example of building natively specifying manually built dependencies.&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 rsync -a --exclude=.git --exclude=deps .. criu-`uname -m`&lt;br /&gt;
 cd criu-`uname -m`&lt;br /&gt;
 make \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../`uname -m`-linux-gnu/include -L`pwd`/../`uname -m`-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
 sudo LD_LIBRARY_PATH=`pwd`/../`uname -m`-linux-gnu/lib ./criu check&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
=== Cross Compilation for ARMv7 ===&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 rsync -a --exclude=.git --exclude=deps .. criu-arm&lt;br /&gt;
 cd criu-arm&lt;br /&gt;
 make \&lt;br /&gt;
   ARCH=arm \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/arm-linux-gnueabihf- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../arm-linux-gnueabihf/include -L`pwd`/../arm-linux-gnueabihf/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
=== Cross Compilation for ARMv8 ===&lt;br /&gt;
&lt;br /&gt;
  cd deps&lt;br /&gt;
  rsync -a --exclude=.git --exclude=deps .. criu-aarch64&lt;br /&gt;
  cd criu-aarch64&lt;br /&gt;
  make \&lt;br /&gt;
   ARCH=aarch64 \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/aarch64-linux-gnu- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../aarch64-linux-gnu/include -L`pwd`/../aarch64-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
  cd ../..&lt;br /&gt;
&lt;br /&gt;
=== Linux Kernel ===&lt;br /&gt;
&lt;br /&gt;
Linux kernel v3.11 or newer is required, with some specific options set. If your distribution does not provide needed kernel, you might want to compile one yourself. Note we also have our [[custom kernel]], which might contain some experimental CRIU related patches.&lt;br /&gt;
&lt;br /&gt;
Note you might have to enable&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EXPERT&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Configure standard kernel features (expert users)&lt;br /&gt;
option, which depends on&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EMBEDDED&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Embedded system&lt;br /&gt;
(welcome to Kconfig reverse chains hell).&lt;br /&gt;
&lt;br /&gt;
The following options must be enabled for CRIU to work:&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_CHECKPOINT_RESTORE&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Checkpoint/restore support&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NAMESPACES&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support &lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_UTS_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; UTS namespace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_IPC_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; IPC namespace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_PID_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; PID namespaces&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NET_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; Network namespace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_FHANDLE&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; open by fhandle syscalls&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EVENTFD&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Enable eventfd() system call&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EPOLL&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Enable eventpoll support&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_INOTIFY_USER&amp;lt;/code&amp;gt;&lt;br /&gt;
: File systems -&amp;gt; Inotify support for userspace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_IA32_EMULATION&amp;lt;/code&amp;gt;&lt;br /&gt;
: Executable file formats -&amp;gt; Emulations -&amp;gt; IA32 Emulation&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_UNIX_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Unix domain sockets -&amp;gt; UNIX: socket monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_INET_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; TCP/IP networking -&amp;gt; INET: socket monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_INET_UDP_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; TCP/IP networking -&amp;gt; INET: socket monitoring interface -&amp;gt; UDP: socket monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_PACKET_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Packet socket -&amp;gt; Packet: sockets monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NETLINK_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Netlink socket -&amp;gt; Netlink: sockets monitoring interface&lt;br /&gt;
&lt;br /&gt;
For some [[usage scenarios]] there is an ability to track memory changes and produce [[incremental dumps]]. Need to enable&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_MEM_SOFT_DIRTY&amp;lt;/code&amp;gt;&lt;br /&gt;
: Processor type and features -&amp;gt; Track memory changes&lt;br /&gt;
&lt;br /&gt;
At the moment it's known that CRIU will '''NOT''' work if packet generator module is loaded. Thus make sure&lt;br /&gt;
that either module is unloaded or not compiled at all.&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NET_PKTGEN&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Network testing -&amp;gt; Packet generator&lt;br /&gt;
&lt;br /&gt;
=== iproute2 ===&lt;br /&gt;
The iproute2 tool version 3.5.0 or higher is needed for dumping network namespaces.&lt;br /&gt;
The latest one can be cloned from [http://git.kernel.org/?p=linux/kernel/git/shemminger/iproute2.git;a=summary iproute2]. It should be compiled and a path to ip written in the environment variable &amp;lt;code&amp;gt;CR_IP_TOOL&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Checking That It Works ==&lt;br /&gt;
&lt;br /&gt;
First thing to do is to run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# criu check --ms&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end it should say &amp;quot;Looks OK&amp;quot;, if it doesn't the messages on the screen explain what functionality is missing.&lt;br /&gt;
If you're using our custom kernel, then the &amp;lt;code&amp;gt;--ms&amp;lt;/code&amp;gt; option should not be used, in this case CRIU would&lt;br /&gt;
check for ''all'' the kernel features to work.&lt;br /&gt;
&lt;br /&gt;
You can then try running the [[ZDTM Test Suite]] which sits in the &amp;lt;code&amp;gt;tests/zdtm/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
{{Out|There's a known issue with BTRFS spoiling dev_t values for files and sockets! Not all tests will work on it.}}&lt;br /&gt;
&lt;br /&gt;
== Using CR tools ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Usage]] and [[Advanced usage]], as well as [[:Category:HOWTO]].&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Images&amp;diff=1942</id>
		<title>Images</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Images&amp;diff=1942"/>
		<updated>2015-01-19T10:38:02Z</updated>

		<summary type="html">&lt;p&gt;Efiop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The criu utility dumps the state of processes/containers into a set of image files. This article describes the format of them.&lt;br /&gt;
&lt;br /&gt;
{{Note| You might also want to checkout our image tool called [[CRIT]]}}&lt;br /&gt;
&lt;br /&gt;
== Types of image files ==&lt;br /&gt;
&lt;br /&gt;
CRIU images can be in one of formats&lt;br /&gt;
&lt;br /&gt;
* criu specific images in google protocol buffer format (PB format)&lt;br /&gt;
* criu specific images with binary data in it&lt;br /&gt;
* image files in 3rd party format (a.k.a. raw images)&lt;br /&gt;
&lt;br /&gt;
== Images in criu-specific format ==&lt;br /&gt;
&lt;br /&gt;
All criu-specific image files begin with 32-bit magic cookie. Images in PB format are followed by zero or more entries of the same type (not size!), each entry is preceded with 32-bit entry size value (not including this 32-bit value itself). Optionally each entry may be followed by extra payload which depends on the entry type.&lt;br /&gt;
&lt;br /&gt;
IOW protocol-buffers image files look like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IMAGE_FILE ::= MAGIC { ENTRY }&lt;br /&gt;
ENTRY      ::= SIZE PAYLOAD [ EXTRA ]&lt;br /&gt;
PAYLOAD    ::= &amp;quot;message encoded in ProtocolBuffer format&amp;quot;&lt;br /&gt;
EXTRA      ::= &amp;quot;arbitrary blob, depends on the PAYLOAD contents&amp;quot;&lt;br /&gt;
&lt;br /&gt;
MAGIC      ::= &amp;quot;32 bit integer&amp;quot;&lt;br /&gt;
SIZE       ::= &amp;quot;32 bit integer, equals the PAYLOAD length&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or, you can visualize it like&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Size(bytes)&lt;br /&gt;
|-&lt;br /&gt;
| Magic || 4&lt;br /&gt;
|-&lt;br /&gt;
| Size0 || 4&lt;br /&gt;
|-&lt;br /&gt;
| Message0 || Size0&lt;br /&gt;
|-&lt;br /&gt;
| ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| SizeN || 4&lt;br /&gt;
|-&lt;br /&gt;
| MessageN || SizeN&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The amount of entries in a image file depends on the type of file.&lt;br /&gt;
&lt;br /&gt;
=== Images with PB data  ===&lt;br /&gt;
&lt;br /&gt;
Such images can be one of&lt;br /&gt;
&lt;br /&gt;
; Array image files&lt;br /&gt;
: In these files the amount of entries can be any. You should read the image file up to the EOF to find out the exact number.&lt;br /&gt;
; Single-entry image files&lt;br /&gt;
: In these files exactly one entry is stored.&lt;br /&gt;
&lt;br /&gt;
A file type can be guessed by the magic. The description of the entries in ProtocolBuffers language are in respective .proto files which reside in &amp;lt;code&amp;gt;protobuf/&amp;lt;/code&amp;gt; directory in the source tree.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! name&lt;br /&gt;
 ! type&lt;br /&gt;
 ! description&lt;br /&gt;
 ! extra payload&lt;br /&gt;
 ! describing proto file&lt;br /&gt;
 |-&lt;br /&gt;
 | inventory || single-entry || Top level description of images || - || inventory.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fdinfo || array || Open file descriptors || - || fdinfo.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | reg-files || array || Paths to files opened with &amp;lt;code&amp;gt;open(2)&amp;lt;/code&amp;gt; syscall || - || regfile.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventfd || array || Eventfd file information || - || eventfd.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventpoll || array || Eventpoll file information || - || eventpoll.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventpoll-tfd || array || Target file descriptors of eventpoll fds || - || eventpoll.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inotify || array || Inotify file information || - || intotify.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inotify-wd || array || Watch descriptors of inotify fds || - || inotify.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | signalfd || array || signalfd info || - || signalfd.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | core || single-entry || Arch-dependent information (registers, etc.) || - || core.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | mm || single-entry ||  Address space generic information (segments, exe file, etc.) || - || mm.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | vmas || array || Virtual mappings (&amp;lt;code&amp;gt;mmap(2)&amp;lt;/code&amp;gt;) || - || vma.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pipes || array || Pipes information || - || pipe.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pipes-data || array || Contents of pipes || &amp;lt;code&amp;gt;entry.bytes&amp;lt;/code&amp;gt; bytes of data sitting in a pipe || pipe-data.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fifo || array || FIFO information || - || fifo.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fifo-data || array || Contents of FIFOs || same as in pipes-data || pipe-data.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pstree || array || Process tree linkage and IDs || - || pstree.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | sigacts || array || Signal handling map || - || sa.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | unixsk || array || Unix domain sockets || - || sk-unix.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inetsk || array || PF_INET sockets, both IPv4 and IPv6 || - || sk-inet.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | sk-queues || array || Contents of socket queues || &amp;lt;code&amp;gt;entry.length&amp;lt;/code&amp;gt; bytes of data, one entry per packet || sk-packet.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | itimers || array || Interval timers state || - || itimer.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | creds || single-entry || Task credentials: uids, gids, caps, etc. || - || creds.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fs || single-entry || Chroot and chdir information || - || fs.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | remap-fpath || array || File paths remaps || - || remap-file-path.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | ghost-file || single-entry || Ghost files (those, not visible from FS, but still used by tasks) || Right after the entry up to the EOF goes the contents of the file || ghost-file.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tcp-stream || single-entry || TCP connection state (including data in queues) || - || tcp-stream.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | mountpoints || array || Mountpoints information || - || mnt.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | utsns || single-entry || Uname nodename and domainname of a UTS namespace || - || utsns.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tty || array || Information about opened tty-s || - || tty.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tty-info || array || Termios and similar stuff about tty-s || - || tty.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | packetsk || array || Info about PF_PACKET sockets || - || packet-sock.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | netdev || array || Info about network devices || - || netdev.proto&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Images with memory dumps ===&lt;br /&gt;
&lt;br /&gt;
Memory info is stored in two types of images&lt;br /&gt;
&lt;br /&gt;
; Pagemap files&lt;br /&gt;
: These files contain info about which virtual regions are populated with data. The file is a set of protobuf messages.&lt;br /&gt;
{{Note| Even though, pagemap is an array kind of image(and can be included to the previous type), first pb message is of type pagemap_head and all the following ones are of type pagemap_entry. }}&lt;br /&gt;
&lt;br /&gt;
; Pages files&lt;br /&gt;
: These contain 4k pages that are to be put into the memory according to the pagemap.&lt;br /&gt;
&lt;br /&gt;
== Raw images ==&lt;br /&gt;
&lt;br /&gt;
These images contain data that were collected by criu with the help of some external tools. These are&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! name&lt;br /&gt;
 ! tool that understand this format&lt;br /&gt;
 ! description&lt;br /&gt;
 |-&lt;br /&gt;
 | ifaddr || iproute2's ip || Contains info about IP addresses on network devices&lt;br /&gt;
 |-&lt;br /&gt;
 | route || iproute2's ip || Contains routing tables&lt;br /&gt;
 |-&lt;br /&gt;
 | tmpfs || tar + gzip || Contains contents of tmpfs filesystem&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== Notes about protobuf ==&lt;br /&gt;
We have a registered field number(1018) for [https://developers.google.com/protocol-buffers/docs/proto#options custom options] of all kinds. See protobuf/opts.proto for more info.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[What's bad with V1 images]]&lt;br /&gt;
* [[ImageFieldMerging | Image field merging]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Images]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Images&amp;diff=1941</id>
		<title>Images</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Images&amp;diff=1941"/>
		<updated>2015-01-19T10:37:03Z</updated>

		<summary type="html">&lt;p&gt;Efiop: protobuf custom options field number&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The criu utility dumps the state of processes/containers into a set of image files. This article describes the format of them.&lt;br /&gt;
&lt;br /&gt;
{{Note| You might also want to checkout our image tool called [[CRIT]]}}&lt;br /&gt;
&lt;br /&gt;
== Types of image files ==&lt;br /&gt;
&lt;br /&gt;
CRIU images can be in one of formats&lt;br /&gt;
&lt;br /&gt;
* criu specific images in google protocol buffer format (PB format)&lt;br /&gt;
* criu specific images with binary data in it&lt;br /&gt;
* image files in 3rd party format (a.k.a. raw images)&lt;br /&gt;
&lt;br /&gt;
== Images in criu-specific format ==&lt;br /&gt;
&lt;br /&gt;
All criu-specific image files begin with 32-bit magic cookie. Images in PB format are followed by zero or more entries of the same type (not size!), each entry is preceded with 32-bit entry size value (not including this 32-bit value itself). Optionally each entry may be followed by extra payload which depends on the entry type.&lt;br /&gt;
&lt;br /&gt;
IOW protocol-buffers image files look like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IMAGE_FILE ::= MAGIC { ENTRY }&lt;br /&gt;
ENTRY      ::= SIZE PAYLOAD [ EXTRA ]&lt;br /&gt;
PAYLOAD    ::= &amp;quot;message encoded in ProtocolBuffer format&amp;quot;&lt;br /&gt;
EXTRA      ::= &amp;quot;arbitrary blob, depends on the PAYLOAD contents&amp;quot;&lt;br /&gt;
&lt;br /&gt;
MAGIC      ::= &amp;quot;32 bit integer&amp;quot;&lt;br /&gt;
SIZE       ::= &amp;quot;32 bit integer, equals the PAYLOAD length&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or, you can visualize it like&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Size(bytes)&lt;br /&gt;
|-&lt;br /&gt;
| Magic || 4&lt;br /&gt;
|-&lt;br /&gt;
| Size0 || 4&lt;br /&gt;
|-&lt;br /&gt;
| Message0 || Size0&lt;br /&gt;
|-&lt;br /&gt;
| ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| SizeN || 4&lt;br /&gt;
|-&lt;br /&gt;
| MessageN || SizeN&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The amount of entries in a image file depends on the type of file.&lt;br /&gt;
&lt;br /&gt;
=== Images with PB data  ===&lt;br /&gt;
&lt;br /&gt;
Such images can be one of&lt;br /&gt;
&lt;br /&gt;
; Array image files&lt;br /&gt;
: In these files the amount of entries can be any. You should read the image file up to the EOF to find out the exact number.&lt;br /&gt;
; Single-entry image files&lt;br /&gt;
: In these files exactly one entry is stored.&lt;br /&gt;
&lt;br /&gt;
A file type can be guessed by the magic. The description of the entries in ProtocolBuffers language are in respective .proto files which reside in &amp;lt;code&amp;gt;protobuf/&amp;lt;/code&amp;gt; directory in the source tree.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! name&lt;br /&gt;
 ! type&lt;br /&gt;
 ! description&lt;br /&gt;
 ! extra payload&lt;br /&gt;
 ! describing proto file&lt;br /&gt;
 |-&lt;br /&gt;
 | inventory || single-entry || Top level description of images || - || inventory.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fdinfo || array || Open file descriptors || - || fdinfo.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | reg-files || array || Paths to files opened with &amp;lt;code&amp;gt;open(2)&amp;lt;/code&amp;gt; syscall || - || regfile.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventfd || array || Eventfd file information || - || eventfd.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventpoll || array || Eventpoll file information || - || eventpoll.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventpoll-tfd || array || Target file descriptors of eventpoll fds || - || eventpoll.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inotify || array || Inotify file information || - || intotify.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inotify-wd || array || Watch descriptors of inotify fds || - || inotify.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | signalfd || array || signalfd info || - || signalfd.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | core || single-entry || Arch-dependent information (registers, etc.) || - || core.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | mm || single-entry ||  Address space generic information (segments, exe file, etc.) || - || mm.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | vmas || array || Virtual mappings (&amp;lt;code&amp;gt;mmap(2)&amp;lt;/code&amp;gt;) || - || vma.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pipes || array || Pipes information || - || pipe.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pipes-data || array || Contents of pipes || &amp;lt;code&amp;gt;entry.bytes&amp;lt;/code&amp;gt; bytes of data sitting in a pipe || pipe-data.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fifo || array || FIFO information || - || fifo.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fifo-data || array || Contents of FIFOs || same as in pipes-data || pipe-data.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pstree || array || Process tree linkage and IDs || - || pstree.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | sigacts || array || Signal handling map || - || sa.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | unixsk || array || Unix domain sockets || - || sk-unix.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inetsk || array || PF_INET sockets, both IPv4 and IPv6 || - || sk-inet.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | sk-queues || array || Contents of socket queues || &amp;lt;code&amp;gt;entry.length&amp;lt;/code&amp;gt; bytes of data, one entry per packet || sk-packet.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | itimers || array || Interval timers state || - || itimer.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | creds || single-entry || Task credentials: uids, gids, caps, etc. || - || creds.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fs || single-entry || Chroot and chdir information || - || fs.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | remap-fpath || array || File paths remaps || - || remap-file-path.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | ghost-file || single-entry || Ghost files (those, not visible from FS, but still used by tasks) || Right after the entry up to the EOF goes the contents of the file || ghost-file.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tcp-stream || single-entry || TCP connection state (including data in queues) || - || tcp-stream.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | mountpoints || array || Mountpoints information || - || mnt.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | utsns || single-entry || Uname nodename and domainname of a UTS namespace || - || utsns.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tty || array || Information about opened tty-s || - || tty.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tty-info || array || Termios and similar stuff about tty-s || - || tty.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | packetsk || array || Info about PF_PACKET sockets || - || packet-sock.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | netdev || array || Info about network devices || - || netdev.proto&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Images with memory dumps ===&lt;br /&gt;
&lt;br /&gt;
Memory info is stored in two types of images&lt;br /&gt;
&lt;br /&gt;
; Pagemap files&lt;br /&gt;
: These files contain info about which virtual regions are populated with data. The file is a set of protobuf messages.&lt;br /&gt;
{{Note| Even though, pagemap is an array kind of image(and can be included to the previous type), first pb message is of type pagemap_head and all the following ones are of type pagemap_entry. }}&lt;br /&gt;
&lt;br /&gt;
; Pages files&lt;br /&gt;
: These contain 4k pages that are to be put into the memory according to the pagemap.&lt;br /&gt;
&lt;br /&gt;
== Raw images ==&lt;br /&gt;
&lt;br /&gt;
These images contain data that were collected by criu with the help of some external tools. These are&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! name&lt;br /&gt;
 ! tool that understand this format&lt;br /&gt;
 ! description&lt;br /&gt;
 |-&lt;br /&gt;
 | ifaddr || iproute2's ip || Contains info about IP addresses on network devices&lt;br /&gt;
 |-&lt;br /&gt;
 | route || iproute2's ip || Contains routing tables&lt;br /&gt;
 |-&lt;br /&gt;
 | tmpfs || tar + gzip || Contains contents of tmpfs filesystem&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== Notes about protobuf ==&lt;br /&gt;
;We have a registered field number(1018) for [https://developers.google.com/protocol-buffers/docs/proto#options custom options] of all kinds. See protobuf/opts.proto for more info.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[What's bad with V1 images]]&lt;br /&gt;
* [[ImageFieldMerging | Image field merging]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Images]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Comparison_to_other_CR_projects&amp;diff=1939</id>
		<title>Comparison to other CR projects</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Comparison_to_other_CR_projects&amp;diff=1939"/>
		<updated>2015-01-16T15:39:51Z</updated>

		<summary type="html">&lt;p&gt;Efiop: say &amp;quot;manipulate&amp;quot; instead of &amp;quot;dump&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This pages tries to explain differences between CRIU and other C/R solutions.&lt;br /&gt;
&lt;br /&gt;
== [http://dmtcp.sourceforge.net DMTCP] ==&lt;br /&gt;
&lt;br /&gt;
{{:DMTCP}}&lt;br /&gt;
&lt;br /&gt;
== [https://ftg.lbl.gov/projects/CheckpointRestart BLCR] ==&lt;br /&gt;
&lt;br /&gt;
Berkeley Lab Checkpoint/Restart (BLCR) is a part of the Scalable Systems Software Suite , &lt;br /&gt;
developed by the Future Technologies Group at Lawrence Berkeley National Lab under SciDAC &lt;br /&gt;
funding from the United States Department of Energy. It is an Open Source, system-level &lt;br /&gt;
checkpointer designed with High Performance Computing (HPC) applications in mind: in particular &lt;br /&gt;
CPU and memory intensive batch-scheduled MPI jobs. BLCR is implemented as a GPL-licensed &lt;br /&gt;
loadable kernel module for Linux 2.4.x and 2.6.x kernels on the x86, x86_64, PPC/PPC64, ARM architectures, and a &lt;br /&gt;
small LGPL-licensed library.&lt;br /&gt;
&lt;br /&gt;
== [http://criu.org CRIU], [http://dmtcp.sourceforge.net DMTCP], [https://ftg.lbl.gov/projects/CheckpointRestart BLCR], [https://openvz.org OpenVZ] ==&lt;br /&gt;
 &lt;br /&gt;
“looks\seems like yes/no” - i found only unproved message(s) saying “yes”/“no”&lt;br /&gt;
&lt;br /&gt;
“not yet” - it is officially planned or i found no reasons, why it can’t be done.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! CRIU&lt;br /&gt;
! DMTCP&lt;br /&gt;
! BLCR&lt;br /&gt;
! OpenVZ&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Arch&lt;br /&gt;
| x86_64, ARM&lt;br /&gt;
| x86, x86_64, ARM&lt;br /&gt;
| x86, x86_64, PPC/PPC64, ARM&lt;br /&gt;
| x86, x86_64&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| OS&lt;br /&gt;
| Linux&lt;br /&gt;
| Linux&lt;br /&gt;
| Linux&lt;br /&gt;
| Linux&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Need in modified kernel&lt;br /&gt;
| No, provided it's 3.11 and above&lt;br /&gt;
| No&lt;br /&gt;
| No, just need to load module. May be problems with installation on new kernels&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| App need to pre-load special libraries&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Requires root privileges&lt;br /&gt;
| No, but user can only manipulate tasks belonging to him&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Need to modify programs to C/R&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes. There are some difficulties with statically linked applications, and with LinuxThreads (it does not support them at all)&lt;br /&gt;
| No&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Need to prepare tasks&lt;br /&gt;
| No&lt;br /&gt;
| Yes. It preloadsthe DMTCP library. That library runs before the routinemain(). It creates a second thread. Thecheckpoint thread then creates a socket to the DMTCP coordinator andregisters itself. The checkpoint thread also creates a signal handler.&lt;br /&gt;
| Yes. CR shall notify processes when a checkpoint is to occur (before the kernel takes a checkpoint) to allow the processes to prepare itself accordingly.&lt;br /&gt;
| No&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Does it change behavior of the c/r-ed programs?&lt;br /&gt;
| No&lt;br /&gt;
| Yes, because of wrappers on system calls&lt;br /&gt;
| Yes, because of wrappers on system calls&lt;br /&gt;
| No&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Live migration&lt;br /&gt;
| Yes, even if kernel, libs, etc are newer. Can use Memory Changes Tracking to decrease freeze time&lt;br /&gt;
| Yes, if both kernels are recent&lt;br /&gt;
| Yes, but if all components are the same. Even if prelinked addresses are different,it will not restore, but it can save the whole used libs and localization files to restore program on the different machine&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Containers&lt;br /&gt;
| Yes, LXC and OpenVZ containers&lt;br /&gt;
| No. It doesn't support namespaces, so it probably can’t dump containers &lt;br /&gt;
| Looks like no&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Parallel/distributed computations libraries&lt;br /&gt;
| No (in plans)&lt;br /&gt;
| Yes. OpenMPI, MPICH2, OpenMP, Cilk are alredy supported and Infiniband is in progress&lt;br /&gt;
| Yes. Cray MPI, Intel MPI, LAM/MPI, MPICH-V, MPICH2, MVAPICH, Open MPI, SGI MPT&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| C/R gdb with debugging app&lt;br /&gt;
| No, because they are using the same interface&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| X-Windows apps (KDE, GNOME, etc)&lt;br /&gt;
| Yes, by using vnc&lt;br /&gt;
| Yes, by using vnc&lt;br /&gt;
| Looks like no&lt;br /&gt;
| Yes, by using vnc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Solutions for invocation in the custom software&lt;br /&gt;
| Yes. [[RPC]] and [[C API]]&lt;br /&gt;
| Yes. Plugins and API&lt;br /&gt;
| Not yet&lt;br /&gt;
| Yes. via ioctl calls&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=&amp;quot;4&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Unix sockets&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| UDP sockets&lt;br /&gt;
| Yes, both ipv4 and ipv6&lt;br /&gt;
| Not yet. Developers of dmtcp had no request for this&lt;br /&gt;
| Not yet&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| TCP sockets&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Not yet&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Established tcp connection&lt;br /&gt;
| Yes&lt;br /&gt;
| No, but you can write a simple DMTCP plugin that tells DMTCP how you want to reconnect on restart&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Infiniband&lt;br /&gt;
| No&lt;br /&gt;
| Not yet, developing is on the half-way&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Multithread support&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Multiprocess&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Process groups and sessions&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Not yet&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Zombies&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Namespaces&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Ptraced programs&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| System V IPC&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Memory mappings&lt;br /&gt;
| Yes, all kinds&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes, partially &lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Pipes&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Not yet&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Terminals&lt;br /&gt;
| Yes, but only Unix98 PTYs&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Non-posix files (inotify, signalfd, eventfd, etc)&lt;br /&gt;
| Yes, inotify, fanotify, epoll, signalfd, eventfd&lt;br /&gt;
| Yes, epoll, eventfd, signalfd are already supported and inotify will be supported in future&lt;br /&gt;
| Looks like no&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Timers&lt;br /&gt;
| Yes&lt;br /&gt;
| No. Any counter or timer active since the beginning of a process will consider the restarted process to be a new process.&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Shared resources (files, mm, etc.)&lt;br /&gt;
| Yes. SysVIPC, files, fd table and memory&lt;br /&gt;
| Yes. System V shared memory(shmget, etc.), mmap-based shared memory, shared sockets, pipes, file descriptors&lt;br /&gt;
| No, but it is planned to suppord shared mmap regions&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Block devices&lt;br /&gt;
| No&lt;br /&gt;
| Looks like yes&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Character devices&lt;br /&gt;
| Yes, only /dev/null, /dev/zero, etc. are supported&lt;br /&gt;
| Yes, looks like null and zero are supported&lt;br /&gt;
| Yes, /dev/null and /dev/zero&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Capture the contents of open files&lt;br /&gt;
| Yes, if file is unlinked&lt;br /&gt;
| Looks like no&lt;br /&gt;
| Not yet&lt;br /&gt;
| Yes&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
DMTCP:&lt;br /&gt;
*http://dmtcp.sourceforge.net/&lt;br /&gt;
*http://dmtcp.sourceforge.net/papers/dmtcp.pdf&lt;br /&gt;
*http://www.ccs.neu.edu/home/gene/papers/ccgrid06.pdf&lt;br /&gt;
*http://research.cs.wisc.edu/htcondor/CondorWeek2010/condor-presentations/cooperman-dmtcp.pdf&lt;br /&gt;
*http://dmtcp.sourceforge.net/papers/mtcp.pdf&lt;br /&gt;
&lt;br /&gt;
BLCR:&lt;br /&gt;
*https://upc-bugs.lbl.gov/blcr/doc/html/&lt;br /&gt;
*https://ftg.lbl.gov/assets/projects/CheckpointRestart/Pubs/LBNL-49659.pdf&lt;br /&gt;
*https://ftg.lbl.gov/assets/projects/CheckpointRestart/Pubs/blcr.pdf&lt;br /&gt;
*https://ftg.lbl.gov/assets/projects/CheckpointRestart/Pubs/checkpointSurvey-020724b.pdf&lt;br /&gt;
*https://ftg.lbl.gov/assets/projects/CheckpointRestart/Pubs/lacsi-2003.pdf&lt;br /&gt;
*https://ftg.lbl.gov/assets/projects/CheckpointRestart/Pubs/LBNL-60520.pdf&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://dmtcp.sourceforge.net/FAQ.html#Internals How does DMTCP work?]&lt;br /&gt;
&lt;br /&gt;
[[Category:Under the hood]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT&amp;diff=1938</id>
		<title>CRIT</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT&amp;diff=1938"/>
		<updated>2015-01-15T16:29:40Z</updated>

		<summary type="html">&lt;p&gt;Efiop: Add example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the CRiu Image Tool.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: crit [-h] [-i IN] [-o OUT] [-f {raw,nice}] {decode,encode}&lt;br /&gt;
&lt;br /&gt;
CRiu Image Tool&lt;br /&gt;
&lt;br /&gt;
positional arguments:&lt;br /&gt;
  {decode,encode}       decode/encode - convert criu image from/to binary type&lt;br /&gt;
                        to/from json&lt;br /&gt;
&lt;br /&gt;
optional arguments:&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
  -i IN, --in IN        input file (stdin by default)&lt;br /&gt;
  -o OUT, --out OUT     output file (stdout by default)&lt;br /&gt;
  -f {raw,nice}, --format {raw,nice}&lt;br /&gt;
                        well-formated output (by default: raw for files and&lt;br /&gt;
                        nice for stdout)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
&lt;br /&gt;
=== Convert images to JSON and back ===&lt;br /&gt;
&lt;br /&gt;
{{Status|ready}}&lt;br /&gt;
&lt;br /&gt;
This is the replacement for (rather nasty) criu show code. Also this is the way to edit the images before restoring from them.&lt;br /&gt;
&lt;br /&gt;
It uses [https://developers.google.com/protocol-buffers/docs/reference/python/google.protobuf.text_format-module text_format] as a human-readable format for protobuf messages.&lt;br /&gt;
&lt;br /&gt;
The output file is structured in the following way.&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;--format raw&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;, &amp;quot;entries&amp;quot; : [{&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot;: &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot;: &amp;quot;abc&amp;quot;}, {&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;} ]}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;--format nice&amp;quot;(default for stdout):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;,&lt;br /&gt;
    &amp;quot;entries&amp;quot; : [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;Example(&amp;quot;crit decode -i core-20700.img&amp;quot;)&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;amp;quot;magic&amp;amp;quot;: &amp;amp;quot;CORE&amp;amp;quot;, &lt;br /&gt;
    &amp;amp;quot;entries&amp;amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;amp;quot;mtype&amp;amp;quot;: &amp;amp;quot;X86_64&amp;amp;quot;, &lt;br /&gt;
            &amp;amp;quot;thread_core&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;futex_rla_len&amp;amp;quot;: 24, &lt;br /&gt;
                &amp;amp;quot;sched_policy&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;sched_nice&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;futex_rla&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;signals_p&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;sas&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;ss_size&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_sp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss_flags&amp;amp;quot;: 2&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;thread_info&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;fpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;st_space&amp;amp;quot;: [&lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;fop&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rdp&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;twd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr&amp;amp;quot;: 8064, &lt;br /&gt;
                    &amp;amp;quot;swd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;rip&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;xsave&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;ymmh_space&amp;amp;quot;: [&lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0, &lt;br /&gt;
                            0&lt;br /&gt;
                        ], &lt;br /&gt;
                        &amp;amp;quot;xstate_bv&amp;amp;quot;: 2&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;xmm_space&amp;amp;quot;: [&lt;br /&gt;
                        1953064751, &lt;br /&gt;
                        1769104175, &lt;br /&gt;
                        1702113141, &lt;br /&gt;
                        1664054387, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4294901760, &lt;br /&gt;
                        255, &lt;br /&gt;
                        0, &lt;br /&gt;
                        792358505, &lt;br /&gt;
                        1953460082, &lt;br /&gt;
                        1852400175, &lt;br /&gt;
                        0, &lt;br /&gt;
                        942882145, &lt;br /&gt;
                        876295483, &lt;br /&gt;
                        774519349, &lt;br /&gt;
                        1031303283, &lt;br /&gt;
                        893073459, &lt;br /&gt;
                        976565307, &lt;br /&gt;
                        1937255978, &lt;br /&gt;
                        859661936, &lt;br /&gt;
                        993344312, &lt;br /&gt;
                        3814708, &lt;br /&gt;
                        65, &lt;br /&gt;
                        0, &lt;br /&gt;
                        21771440, &lt;br /&gt;
                        0, &lt;br /&gt;
                        21771552, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4278190080, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        4294967040, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        4278190080, &lt;br /&gt;
                        4294967040, &lt;br /&gt;
                        4294967295, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0, &lt;br /&gt;
                        0&lt;br /&gt;
                    ], &lt;br /&gt;
                    &amp;amp;quot;cwd&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;mxcsr_mask&amp;amp;quot;: 65535&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;clear_tid_addr&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;gpregs&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;gs&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ip&amp;amp;quot;: 140137968588056, &lt;br /&gt;
                    &amp;amp;quot;cx&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                    &amp;amp;quot;cs&amp;amp;quot;: 51, &lt;br /&gt;
                    &amp;amp;quot;ax&amp;amp;quot;: 61, &lt;br /&gt;
                    &amp;amp;quot;orig_ax&amp;amp;quot;: 61, &lt;br /&gt;
                    &amp;amp;quot;di&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                    &amp;amp;quot;es&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;gs_base&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r14&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r15&amp;amp;quot;: 4294967295, &lt;br /&gt;
                    &amp;amp;quot;r12&amp;amp;quot;: 21789168, &lt;br /&gt;
                    &amp;amp;quot;r13&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r10&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;r11&amp;amp;quot;: 582, &lt;br /&gt;
                    &amp;amp;quot;fs_base&amp;amp;quot;: 140137978173184, &lt;br /&gt;
                    &amp;amp;quot;bp&amp;amp;quot;: 2560, &lt;br /&gt;
                    &amp;amp;quot;dx&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;bx&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ds&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;ss&amp;amp;quot;: 43, &lt;br /&gt;
                    &amp;amp;quot;sp&amp;amp;quot;: 140736135950616, &lt;br /&gt;
                    &amp;amp;quot;r8&amp;amp;quot;: 21789168, &lt;br /&gt;
                    &amp;amp;quot;r9&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;fs&amp;amp;quot;: 0, &lt;br /&gt;
                    &amp;amp;quot;si&amp;amp;quot;: 140736135950656, &lt;br /&gt;
                    &amp;amp;quot;flags&amp;amp;quot;: 582&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;amp;quot;tc&amp;amp;quot;: {&lt;br /&gt;
                &amp;amp;quot;timers&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;real&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;virt&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }, &lt;br /&gt;
                    &amp;amp;quot;prof&amp;amp;quot;: {&lt;br /&gt;
                        &amp;amp;quot;isec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;iusec&amp;amp;quot;: 0, &lt;br /&gt;
                        &amp;amp;quot;vsec&amp;amp;quot;: 0&lt;br /&gt;
                    }&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;cg_set&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;signals_s&amp;amp;quot;: {}, &lt;br /&gt;
                &amp;amp;quot;blk_sigset&amp;amp;quot;: 65536, &lt;br /&gt;
                &amp;amp;quot;exit_code&amp;amp;quot;: 0, &lt;br /&gt;
                &amp;amp;quot;rlimits&amp;amp;quot;: {&lt;br /&gt;
                    &amp;amp;quot;rlimits&amp;amp;quot;: [&lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 8388608&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62845, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62845&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 4096, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 1024&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 65536, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 65536&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 62845, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 62845&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 819200, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 819200&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 0, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 0&lt;br /&gt;
                        }, &lt;br /&gt;
                        {&lt;br /&gt;
                            &amp;amp;quot;max&amp;amp;quot;: 18446744073709551615, &lt;br /&gt;
                            &amp;amp;quot;cur&amp;amp;quot;: 18446744073709551615&lt;br /&gt;
                        }&lt;br /&gt;
                    ]&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;amp;quot;comm&amp;amp;quot;: &amp;amp;quot;loop.sh&amp;amp;quot;, &lt;br /&gt;
                &amp;amp;quot;flags&amp;amp;quot;: 1077960704, &lt;br /&gt;
                &amp;amp;quot;task_state&amp;amp;quot;: 1, &lt;br /&gt;
                &amp;amp;quot;personality&amp;amp;quot;: 0&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Generate core files out of task images ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
All the needed information is in core-$pid.img and pagemap-$pid.img&lt;br /&gt;
&lt;br /&gt;
=== On-the-fly conversion ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
There's an idea to make CRIU spawn CRIT and read images &amp;quot;through&amp;quot; it, to allow for at-the-restore-time modifications&lt;br /&gt;
&lt;br /&gt;
=== Convert between different image versions ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
Right now we store the images version in inventory.img and collect info about [[what's bad with V1 images]]. If some day we have v2, CRIT will convert from v1. And for backward compatibility we'll use on-the-fly conversion when restoring from old images.&lt;br /&gt;
&lt;br /&gt;
=== Show images statistics ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
E.g. -- total number of processes, files, memory, sockets, etc.&lt;br /&gt;
&lt;br /&gt;
=== Check/validate images ===&lt;br /&gt;
&lt;br /&gt;
{{Status|not ready}}&lt;br /&gt;
&lt;br /&gt;
Check that&lt;br /&gt;
* all images are present&lt;br /&gt;
* the inter-images IDs are in consistent state&lt;br /&gt;
&lt;br /&gt;
[[Category:Images]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT&amp;diff=1933</id>
		<title>CRIT</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT&amp;diff=1933"/>
		<updated>2015-01-14T19:16:06Z</updated>

		<summary type="html">&lt;p&gt;Efiop: fix examples&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the CRiu Image Tool.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: crit [-h] [-i IN] [-o OUT] [-f {raw,nice}] {decode,encode}&lt;br /&gt;
&lt;br /&gt;
CRiu Image Tool&lt;br /&gt;
&lt;br /&gt;
positional arguments:&lt;br /&gt;
  {decode,encode}       decode/encode - convert criu image from/to binary type&lt;br /&gt;
                        to/from json&lt;br /&gt;
&lt;br /&gt;
optional arguments:&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
  -i IN, --in IN        input file (stdin by default)&lt;br /&gt;
  -o OUT, --out OUT     output file (stdout by default)&lt;br /&gt;
  -f {raw,nice}, --format {raw,nice}&lt;br /&gt;
                        well-formated output (by default: raw for files and&lt;br /&gt;
                        nice for stdout)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
&lt;br /&gt;
=== Convert images to JSON and back ===&lt;br /&gt;
This is the replacement for (rather nasty) criu show code. Also this is the way to edit the images before restoring from them.&lt;br /&gt;
&lt;br /&gt;
'''Status: Ready'''&lt;br /&gt;
&lt;br /&gt;
It uses [https://developers.google.com/protocol-buffers/docs/reference/python/google.protobuf.text_format-module text_format] as a human-readable format for protobuf messages.&lt;br /&gt;
&lt;br /&gt;
The output file is structured in the following way.&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;--format raw&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{ &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;, &amp;quot;entries&amp;quot; : [{&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot;: &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot;: &amp;quot;abc&amp;quot;}, {&amp;quot;foo&amp;quot;: &amp;quot;bar&amp;quot;, &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;, &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;} ]}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With &amp;quot;--format nice&amp;quot;(default for stdout):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;magic&amp;quot; : &amp;quot;FOO&amp;quot;,&lt;br /&gt;
    &amp;quot;entries&amp;quot; : [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;foo&amp;quot; : &amp;quot;bar&amp;quot;,&lt;br /&gt;
            &amp;quot;bar&amp;quot; : &amp;quot;foo&amp;quot;,&lt;br /&gt;
            &amp;quot;extra&amp;quot; : &amp;quot;abc&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Generate core files out of task images ===&lt;br /&gt;
&lt;br /&gt;
All the needed information is in core-$pid.img and pagemap-$pid.img&lt;br /&gt;
&lt;br /&gt;
'''Status: Not ready'''&lt;br /&gt;
&lt;br /&gt;
=== On-the-fly conversion ===&lt;br /&gt;
&lt;br /&gt;
There's an idea to make CRIU spawn CRIT and read images &amp;quot;through&amp;quot; it, to allow for at-the-restore-time modifications&lt;br /&gt;
&lt;br /&gt;
'''Status: Not ready'''&lt;br /&gt;
&lt;br /&gt;
=== Convert between different image versions ===&lt;br /&gt;
&lt;br /&gt;
Right now we store the images version in inventory.img and collect info about [[what's bad with V1 images]]. If some day we have v2, CRIT will convert from v1. And for backward compatibility we'll use on-the-fly conversion when restoring from old images.&lt;br /&gt;
&lt;br /&gt;
'''Status: Not ready'''&lt;br /&gt;
&lt;br /&gt;
=== Show images statistics ===&lt;br /&gt;
&lt;br /&gt;
E.g. -- total number of processes, files, memory, sockets, etc.&lt;br /&gt;
&lt;br /&gt;
Status: Not ready&lt;br /&gt;
&lt;br /&gt;
=== Check/validate images ===&lt;br /&gt;
&lt;br /&gt;
Check that&lt;br /&gt;
* all images are present&lt;br /&gt;
* the inter-images IDs are in consistent state&lt;br /&gt;
&lt;br /&gt;
'''Status: Not ready'''&lt;br /&gt;
&lt;br /&gt;
[[Category:Images]]&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=C_API&amp;diff=1915</id>
		<title>C API</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=C_API&amp;diff=1915"/>
		<updated>2015-01-04T21:27:49Z</updated>

		<summary type="html">&lt;p&gt;Efiop: /* Return values */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''libcriu''' is a C API for CRIU, which is a simple wrapper around our [[RPC]]. Although you can use [[RPC]] directly, libcriu is a wrapper providing the interface that is much easier to use from C code. Note that [[RPC]] is supported in the first place, and if you want the most recent set of features you should probably use [[RPC]] directly.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
libcriu functions are defined in &amp;lt;code&amp;gt;lib/criu.h&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To create a library &amp;lt;code&amp;gt;lib/libcriu.so&amp;lt;/code&amp;gt;, run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the main directory.&lt;br /&gt;
&lt;br /&gt;
The library is not thread- and fork- safe.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
&lt;br /&gt;
=== init options ===&lt;br /&gt;
&lt;br /&gt;
Call &amp;lt;code&amp;gt;int criu_init_opts(void)&amp;lt;/code&amp;gt; to initialize request options.&lt;br /&gt;
&lt;br /&gt;
Note: it should be called before using any other functions from libcriu, except &amp;lt;code&amp;gt;criu_check()&amp;lt;/code&amp;gt;. Also you should use it to reinitialize options. It returns 0 on success and -1 on fail.&lt;br /&gt;
&lt;br /&gt;
=== set service address ===&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;void criu_set_service_address(char *address)&amp;lt;/code&amp;gt; to specify path to a CRIU service socket. Call it with NULL to make libcriu use the default address (currently &amp;lt;code&amp;gt;/var/run/criu_service.socket&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== set dump/restore options ===&lt;br /&gt;
Use &amp;lt;code&amp;gt;criu_set_*&amp;lt;/code&amp;gt; functions to setup dump/restore options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
void criu_set_pid(int pid);&lt;br /&gt;
void criu_set_images_dir_fd(int fd); /* must be set for dump/restore */&lt;br /&gt;
void criu_set_leave_running(bool leave_running);&lt;br /&gt;
void criu_set_ext_unix_sk(bool ext_unix_sk);&lt;br /&gt;
void criu_set_tcp_established(bool tcp_established);&lt;br /&gt;
void criu_set_evasive_devices(bool evasive_devices);&lt;br /&gt;
void criu_set_shell_job(bool shell_job);&lt;br /&gt;
void criu_set_file_locks(bool file_locks);&lt;br /&gt;
void criu_set_log_level(int log_level);&lt;br /&gt;
void criu_set_log_file(char *log_file);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no pid is set on dump, CRIU will dump the calling process itself.&lt;br /&gt;
{{Note|If a calling process is not run as root, the whole process tree to be dumped must have the same uid, otherwise CRIU refuses to dump. See [[Usage#Security]].}}&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;lt;code&amp;gt;images_dir_fd&amp;lt;/code&amp;gt; is '''required''' at dump/restore, all other options might be left unset.&lt;br /&gt;
The client must open directory for/with images by itself and set &amp;lt;code&amp;gt;images_dir_fd&amp;lt;/code&amp;gt; to the opened directory fd.&lt;br /&gt;
CRIU will open /proc/&amp;lt;client's_pid&amp;gt;/fd/&amp;lt;images_dir_fd&amp;gt;, so it will work even if the client is in another namespace.}}&lt;br /&gt;
&lt;br /&gt;
The logic of setting request is the same as when setting options in console. Here is an example:&lt;br /&gt;
&lt;br /&gt;
 #criu restore -D /path/to/imgs_dir -v4 -o restore.log&lt;br /&gt;
&lt;br /&gt;
is equal to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
criu_init_opts();&lt;br /&gt;
criu_set_service_address(&amp;quot;/path/to/criu/service/socket&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
int fd = open(&amp;quot;/path/to/imgs_dir&amp;quot;, O_DIRECTORY);&lt;br /&gt;
criu_set_images_dir_fd(fd);&lt;br /&gt;
&lt;br /&gt;
criu_set_log_file(&amp;quot;restore.log&amp;quot;);&lt;br /&gt;
criu_set_log_level(4);&lt;br /&gt;
&lt;br /&gt;
criu_restore();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Operations ==&lt;br /&gt;
&lt;br /&gt;
Use the following functions to perform CRIU actions.&lt;br /&gt;
&lt;br /&gt;
=== check ===&lt;br /&gt;
&lt;br /&gt;
 int criu_check(void);&lt;br /&gt;
&lt;br /&gt;
=== dump ===&lt;br /&gt;
&lt;br /&gt;
 int criu_dump(void);&lt;br /&gt;
&lt;br /&gt;
=== restore ===&lt;br /&gt;
&lt;br /&gt;
 int criu_restore(void);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Return values ===&lt;br /&gt;
&lt;br /&gt;
Here is a table of return and errno values of the above functions:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Return value&lt;br /&gt;
! errno&lt;br /&gt;
! Description&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 0&lt;br /&gt;
| undefined&lt;br /&gt;
| Success&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;0&lt;br /&gt;
| undefined&lt;br /&gt;
| Success (&amp;lt;code&amp;gt;criu_restore()&amp;lt;/code&amp;gt; only)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| -EBADE&lt;br /&gt;
| RPC error (if provided(see [https://github.com/xemul/criu/blob/master/include/cr-errno.h#L8 include/cr-errno.h]), 0 otherwise)&lt;br /&gt;
| RPC has returned fail.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| -ECONNREFUSED&lt;br /&gt;
| errno&lt;br /&gt;
| Unable to connect to CRIU.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| -ECOMM&lt;br /&gt;
| errno&lt;br /&gt;
| Unable to send/recv msg to/from CRIU.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| -EINVAL&lt;br /&gt;
| undefined&lt;br /&gt;
| CRIU doesn't support this type of request. You should probably update CRIU.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| -EBADMSG&lt;br /&gt;
| undefined&lt;br /&gt;
| Unexpected response from CRIU. You should probably update CRIU.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
You could find example of using libcriu at [http://git.criu.org/?p=criu.git;a=tree;f=test/libcriu test/libcriu].&lt;br /&gt;
&lt;br /&gt;
[[Category: API]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=RPC&amp;diff=1914</id>
		<title>RPC</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=RPC&amp;diff=1914"/>
		<updated>2015-01-04T21:26:19Z</updated>

		<summary type="html">&lt;p&gt;Efiop: Mention cr_errno field.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CRIU-RPC is a remote procedure call (RPC) protocol which uses Google Protocol Buffers to encode its calls. The requests are served by CRIU service launched with &amp;lt;code&amp;gt;criu service&amp;lt;/code&amp;gt; command. It uses a SEQPACKET Unix domain socket listening at &amp;lt;code&amp;gt;/var/run/criu-service.socket&amp;lt;/code&amp;gt; as a transport.&lt;br /&gt;
&lt;br /&gt;
The criu_req/criu_resp are two main messages for requests/responses. They are to be used for transferring messages and needed to provide compatibility with an older versions of rpc. Field type in them ''must'' be set accordingly to type of request/response that is stored. Types of request/response are defined in enum criu_req_type. See the [[API compliance]] page for information what each option might mean.&lt;br /&gt;
&lt;br /&gt;
== Protocol ==&lt;br /&gt;
&lt;br /&gt;
The protocol is simple -- client connect to service, send a ''criu_req'' message to server, server responds back with ''criu_resp'' and closes the socket. There are three exceptions from this rule, see below.&lt;br /&gt;
&lt;br /&gt;
== Request ==&lt;br /&gt;
&lt;br /&gt;
This is the header of the request. It defines the operation requested and options.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_req {&lt;br /&gt;
	required criu_req_type type	= 1;&lt;br /&gt;
	optional criu_opts opts		= 2;&lt;br /&gt;
	optional notify_success         = 3; /* see Notifications below */&lt;br /&gt;
	optional keep_open              = 4; /* for multi-req, below */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are 8 request/response types for now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;enum criu_req_type {&lt;br /&gt;
	EMPTY		= 0;&lt;br /&gt;
	DUMP		= 1; /* criu dump */&lt;br /&gt;
	RESTORE		= 2; /* criu restore */&lt;br /&gt;
	CHECK		= 3; /* criu check */&lt;br /&gt;
	PRE_DUMP	= 4; /* criu pre-dump */&lt;br /&gt;
	PAGE_SERVER	= 5; /* criu page-server */&lt;br /&gt;
	NOTIFY          = 6; /* see Notifications below */&lt;br /&gt;
	CPUINFO_DUMP	= 7; /* criu cpuinfo dump */&lt;br /&gt;
	CPUINFO_CHECK	= 8; /* criu cpuinfo check */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;message criu_opts {&lt;br /&gt;
	required int32			images_dir_fd	= 1;&lt;br /&gt;
	optional int32			pid		= 2; /* if not set on dump, will dump requesting process */&lt;br /&gt;
&lt;br /&gt;
	optional bool			leave_running	= 3;&lt;br /&gt;
	optional bool			ext_unix_sk	= 4;&lt;br /&gt;
	optional bool			tcp_established	= 5;&lt;br /&gt;
	optional bool			evasive_devices	= 6;&lt;br /&gt;
	optional bool			shell_job	= 7;&lt;br /&gt;
	optional bool			file_locks	= 8;&lt;br /&gt;
	optional int32			log_level	= 9 [default = 2];&lt;br /&gt;
	optional string			log_file	= 10; /* No subdirs are allowed. Consider using work-dir */&lt;br /&gt;
&lt;br /&gt;
	optional criu_page_server_info	ps		= 11;&lt;br /&gt;
&lt;br /&gt;
	optional bool			notify_scripts	= 12;&lt;br /&gt;
&lt;br /&gt;
	optional string			root		= 13;&lt;br /&gt;
	optional string			parent_img	= 14;&lt;br /&gt;
	optional bool			track_mem	= 15;&lt;br /&gt;
	optional bool			auto_dedup	= 16;&lt;br /&gt;
&lt;br /&gt;
	optional int32			work_dir_fd	= 17;&lt;br /&gt;
	optional bool			link_remap	= 18;&lt;br /&gt;
	repeated criu_veth_pair		veths		= 19;&lt;br /&gt;
&lt;br /&gt;
	optional uint32			cpu_cap		= 20 [default = 0xffffffff];&lt;br /&gt;
	optional bool			force_irmap	= 21;&lt;br /&gt;
	repeated string			exec_cmd	= 22;&lt;br /&gt;
&lt;br /&gt;
	repeated ext_mount_map		ext_mnt		= 23;&lt;br /&gt;
	optional bool			manage_cgroups	= 24;&lt;br /&gt;
	repeated cgroup_root		cg_root		= 25;&lt;br /&gt;
&lt;br /&gt;
	optional bool			rst_sibling	= 26; /* swrk only */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Comments and examples ===&lt;br /&gt;
&lt;br /&gt;
* If no pid is set and type is DUMP, CRIU will dump client process by default.&lt;br /&gt;
* All processes in the subtree starting with &amp;lt;pid&amp;gt; must have the same uid, as a client, or client's uid must be root (uid == 0), otherwise CRIU will return error.&lt;br /&gt;
* Only the images_dir_fd is required, all other fields are optional. Client must open directory for/with images by himself and set images_dir_fd to it's fd. CRIU will open /proc/&amp;lt;client's_pid&amp;gt;/fd/&amp;lt;images_dir_fd&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The logic of setting request is the same as when setting options in console. Here is an example:&lt;br /&gt;
&amp;lt;pre&amp;gt;#criu restore -D /path/to/imgs_dir -v4 -o restore.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
is equal to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
request.type = RESTORE;&lt;br /&gt;
&lt;br /&gt;
request.opts.imgs_dir_fd	= open(&amp;quot;/path/to/imgs_dir&amp;quot;)&lt;br /&gt;
request.opts.log_level		= 4&lt;br /&gt;
request.opts.log_file		= &amp;quot;restore.log&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sub-messages for options ===&lt;br /&gt;
; Info about page-server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_page_server_info {&lt;br /&gt;
	optional string		address	= 1; /* bind address -- if not set 0.0.0.0 is used */&lt;br /&gt;
	optional int32		port	= 2; /* bind port -- if not set on request, autobind is used and port is returned in response */&lt;br /&gt;
	optional int32		pid	= 3; /* page-server pid -- returned in response */&lt;br /&gt;
	optional int32		fd	= 4; /* could be used to inherit fd by page-server */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If ''port'' is 0 server will auto-bind and the port will be returned back in responce.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_veth_pair {&lt;br /&gt;
	required string		if_in	= 1; /* inside veth device name */&lt;br /&gt;
	required string		if_out	= 2; /* outside veth device name */&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Info about veth mappings (--ext-mount-map analogue)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message ext_mount_map {&lt;br /&gt;
	required string		key	= 1;&lt;br /&gt;
	required string		val	= 2;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Specifying where cgroup root should be (--cgroup-root analogue)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message cgroup_root {&lt;br /&gt;
	optional string		ctrl	= 1;&lt;br /&gt;
	required string		path	= 2;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Response ==&lt;br /&gt;
&lt;br /&gt;
This message is sent after (un)successful execution of the request.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_resp {&lt;br /&gt;
	required criu_req_type		type		= 1;&lt;br /&gt;
	required bool			success		= 2;&lt;br /&gt;
&lt;br /&gt;
	optional criu_dump_resp		dump		= 3;&lt;br /&gt;
	optional criu_restore_resp	restore		= 4;&lt;br /&gt;
	optional criu_notify		notify		= 5;&lt;br /&gt;
	optional criu_page_server_info	ps		= 6;&lt;br /&gt;
&lt;br /&gt;
        optional int32			cr_errno	= 7;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Field &amp;quot;success&amp;quot; reports result of processing request, while criu_***_resp store some request-specific information. The response type is set to the corresponding request type or to &amp;lt;code&amp;gt;EMPTY&amp;lt;/code&amp;gt; to report a &amp;quot;generic&amp;quot; error. If success == false one should check cr_errno field to get a more detailed error code(see [https://github.com/xemul/criu/blob/master/include/cr-errno.h#L8 include/cr-errno.h]).&lt;br /&gt;
&lt;br /&gt;
;The criu_dump_resp is used to store response from DUMP request.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_dump_resp {&lt;br /&gt;
	optional bool restored		= 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This message can be sent twice -- one for the process that calls DUMP and the other for the same process again if it requested a self-dump. In the latter case the ''restored'' field would be true.&lt;br /&gt;
&lt;br /&gt;
;The response on RESTORE request.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_restore_resp {&lt;br /&gt;
	required int32 pid		= 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Field &amp;quot;pid&amp;quot; is set to the PID of the newly restored process.&lt;br /&gt;
&lt;br /&gt;
;Info about page server&lt;br /&gt;
The ''criu_page_server_info'' from requests will be sent back on PAGE_SERVER request. The ''port'' field will contain the port to which server is bound.&lt;br /&gt;
&lt;br /&gt;
=== Notifications ===&lt;br /&gt;
If the ''opts.notify_scripts'' in the request is set to TRUE CRIU would report back resp messages with type set to NOTIFY and this field present. The notifications are the way [[action scripts]] work for RPC mode.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_notify {&lt;br /&gt;
	optional string script		= 1;&lt;br /&gt;
	optional int32	pid		= 2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After handling the notification the client must response with the request again with the type set to NOTIFY and the ''notify_success'' set to the successfulness of the notification. In case of successful notification acknowledge the server doesn't close the socket and continues to work.&lt;br /&gt;
&lt;br /&gt;
== Pre-dumps ==&lt;br /&gt;
&lt;br /&gt;
Before issuing a DUMP request client may send one or more PRE_DUMP requests. Once the PRE_DUMP is sent and response is received, client may send one more PRE_DUMP or DUMP request. The server would only close the socket after the DUMP one.&lt;br /&gt;
&lt;br /&gt;
== Multi-request mode ==&lt;br /&gt;
&lt;br /&gt;
If the ''req.keep_open'' flag is set to true server will not close the socket after response, but will wait for more requests. This mode is supported only for the following request types:&lt;br /&gt;
&lt;br /&gt;
* PRE_DUMP (automatically)&lt;br /&gt;
* PAGE_SERVER&lt;br /&gt;
* CPUINFO_DUMP and CPUINFO_CHECK&lt;br /&gt;
&lt;br /&gt;
== Run ==&lt;br /&gt;
=== Server ===&lt;br /&gt;
On a server side, CRIU creates SOCK_SEQPACKET Unix socket and listens for connections on it. After receiving criu_req, CRIU processes it, do what is requested and sends criu_resp with set request-specific criu_***_resp field back.&lt;br /&gt;
If CRIU gets unknown type of request, it will return criu_resp with type == EMPTY and success == false.&lt;br /&gt;
&lt;br /&gt;
To launch service server, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#criu service [options]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Options accepted by service are&lt;br /&gt;
&lt;br /&gt;
; --address &amp;lt;path&amp;gt;&lt;br /&gt;
: is where to put listening socket&lt;br /&gt;
&lt;br /&gt;
; --pid-file &amp;lt;path&amp;gt;&lt;br /&gt;
: is where to write pid of service process&lt;br /&gt;
&lt;br /&gt;
; --daemon&lt;br /&gt;
: tells service to daemonize&lt;br /&gt;
&lt;br /&gt;
; -o &amp;lt;file&amp;gt;&lt;br /&gt;
: says where to write logs&lt;br /&gt;
&lt;br /&gt;
; -v[N]&lt;br /&gt;
: sets the log-level&lt;br /&gt;
&lt;br /&gt;
====systemd====&lt;br /&gt;
If you are running systemd you can make service start and operate automatically. First do&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to make files &amp;lt;code&amp;gt;criu.service&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;criu.socket&amp;lt;/code&amp;gt; appear in systemd configs (&amp;lt;code&amp;gt;/lib/systemd/system/&amp;lt;/code&amp;gt;). Then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl start criu.socket&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to get /var/run/criu-service.socket, and&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl enable criu.socket&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to make /var/run/criu-service.socket available at boot.&lt;br /&gt;
&lt;br /&gt;
=== Client ===&lt;br /&gt;
Client, in its turn, must connect to service socket, send criu_req with request in it, and wait for a criu_resp with response.&lt;br /&gt;
You can find examples of client programs in C and Python in test/rpc/.&lt;br /&gt;
&lt;br /&gt;
With RPC facilities one can perform a [[self dump]].&lt;br /&gt;
&lt;br /&gt;
There's a [[C_API|library]] that implements simple wrappers on top of RPC.&lt;br /&gt;
&lt;br /&gt;
[[Category: API]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Todo&amp;diff=1908</id>
		<title>Todo</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Todo&amp;diff=1908"/>
		<updated>2015-01-01T09:35:22Z</updated>

		<summary type="html">&lt;p&gt;Efiop: note that we have cr-errno with 3 typical errors and we need to expand that list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! component&lt;br /&gt;
! task&lt;br /&gt;
! complexity&lt;br /&gt;
! assignee&lt;br /&gt;
! comments&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Rollback tree state || medium || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || AIO with pending events || medium || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || restore  mountpoints || hard || - || -&lt;br /&gt;
|-&lt;br /&gt;
| crtools || lazy migration using userfaultd || medium || - || -&lt;br /&gt;
|-&lt;br /&gt;
| crtools || dump tasks from cgroup || easy || - || Currently criu dumps a subtree from given pid&lt;br /&gt;
|-&lt;br /&gt;
| crtools || speed up logging || medium || - || Synchronous writes to log files slow things down&lt;br /&gt;
|-&lt;br /&gt;
| crtools || sanitize logging messages || hard || - || Currently log messages are placed w/o any logic. Need to improve that ... somehow.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || support OFD posix locks || easy || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || optimize kcmp calls || medium || - || For fs/fdt/vm/etc we can pre-generate ID based on objects that live on them. If pre-ID matches, then call kcmp.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shmem changes tracking || medium || - || &lt;br /&gt;
|-&lt;br /&gt;
| crtools || Page transfer filters || medium || Ruslan Kuprieiev || Packing or encrypting the data would be nice. Maybe it's purely for [[P.Haul]]?&lt;br /&gt;
|-&lt;br /&gt;
| crtools || FUSE || hard || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || 32-bit tasks || hard || Cyrill || &lt;br /&gt;
|-&lt;br /&gt;
| crtools || Support one of MPI implementations || hard || Adrian Reber || worth starting with OpenMPI&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Generate task's core file out of images || medium || - || [[CRIT]]&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Convert images to JSON and back || easy || - || [[CRIT]]&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Modify restored resources run-time || medium || - || [[CRIT]] Need (probably) some way to alter what is being restored. Usage example -- change the IP address of sockets from task above.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || TCP socket migration with changed IP || medium || - ||  [[CRIT]] it might make sense to migrate a tcp connection on a box with changed IP address _if_ both boxes are NAT-ed to the destination. We will then have to go to NAT box and fix the conntracks, but this might make sense.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || [[Applying images]] || hard || xemul@ w/ students || Think about ability to take images and apply them to a living task(s). E.g. -- repopulate fdtable according to data from image. Another use-case -- when doing partial migration we'll need to modify one part to switch from pipes to sockets&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Partial migration || hard || - || migrate some tasks while proxying IPC to existing others (pipes-&amp;gt;sockets, etc.)&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Shared objects (mm/fs) support || medium || - || Now we have the kcmp syscall and can do it. The first candidate is mm sharing, as we do know, that MySQL does so sometimes.&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Smart paths resolution || hard || - || Need a way to resolve paths to overmounted files. There are two ways: 1. Move mounts, that overlap the desired path temprarily. 2. When creating a new mount pre-open an fd keeping the mountpoint. Later, do accurate path resolve and call openat() on proper mountpoint fd&lt;br /&gt;
|-&lt;br /&gt;
| kernel/crtools || TCP repair fixes || hard || - || [[TCP repair TODO]]&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Bridges in container || medium || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || VLANs in containers || medium || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools || PPP support || medium || - ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || DelayFS for NFS/Fuse migration || hard || - ||&lt;br /&gt;
|-&lt;br /&gt;
| kernel || Seamless kernel upgrade || hard || Vladimir Davydov ||&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || NFS || hard || - || Probably depends on DelayFS&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Validate .img files || easy || - || [[CRIT]] For a given set of image files check, that they are in &amp;quot;restorable&amp;quot; shape&lt;br /&gt;
|-&lt;br /&gt;
| crtools || Restore a process tree || hard ||  - || Need to restore any process tree, which could be created with help PR_SET_CHILD_SUBREAPER and CLONE_PARENT. Processes can share other resources [http://man7.org/linux/man-pages/man2/clone2.2.html clone(2)]. Look at [http://git.criu.org/?p=crtools.git;a=blob;f=test/zdtm/live/static/session02.c;hb=HEAD session02]&lt;br /&gt;
|-&lt;br /&gt;
| crtools || X app || hard || - || Dump/restore of graphical applications&lt;br /&gt;
|-&lt;br /&gt;
| crtools/kernel || Undo semaphores || medium || Cyrill Gorcunov || Require mods from both sides -- criu and kernel&lt;br /&gt;
|-&lt;br /&gt;
| crtools || More detailed RPC fail codes || easy || - || Currently only 3 typical errors are reported(see [https://github.com/xemul/criu/blob/master/include/cr-errno.h#L8 include/cr-errno.h])&lt;br /&gt;
|-&lt;br /&gt;
| kernel/criu || fsnotify queues || hard || - || [[Fsnotify]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Plans]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Images&amp;diff=1883</id>
		<title>Images</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Images&amp;diff=1883"/>
		<updated>2014-12-24T11:04:32Z</updated>

		<summary type="html">&lt;p&gt;Efiop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The criu utility dumps the state of processes/containers into a set of image files. This article describes the format of them.&lt;br /&gt;
&lt;br /&gt;
{{Note| You might also want to checkout our image tool called [[CRIT]]}}&lt;br /&gt;
&lt;br /&gt;
== Types of image files ==&lt;br /&gt;
&lt;br /&gt;
CRIU images can be in one of formats&lt;br /&gt;
&lt;br /&gt;
* criu specific images in google protocol buffer format (PB format)&lt;br /&gt;
* criu specific images with binary data in it&lt;br /&gt;
* image files in 3rd party format (a.k.a. raw images)&lt;br /&gt;
&lt;br /&gt;
== Images in criu-specific format ==&lt;br /&gt;
&lt;br /&gt;
All criu-specific image files begin with 32-bit magic cookie. Images in PB format are followed by zero or more entries of the same type (not size!), each entry is preceded with 32-bit entry size value (not including this 32-bit value itself). Optionally each entry may be followed by extra payload which depends on the entry type.&lt;br /&gt;
&lt;br /&gt;
IOW protocol-buffers image files look like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IMAGE_FILE ::= MAGIC { ENTRY }&lt;br /&gt;
ENTRY      ::= SIZE PAYLOAD [ EXTRA ]&lt;br /&gt;
PAYLOAD    ::= &amp;quot;message encoded in ProtocolBuffer format&amp;quot;&lt;br /&gt;
EXTRA      ::= &amp;quot;arbitrary blob, depends on the PAYLOAD contents&amp;quot;&lt;br /&gt;
&lt;br /&gt;
MAGIC      ::= &amp;quot;32 bit integer&amp;quot;&lt;br /&gt;
SIZE       ::= &amp;quot;32 bit integer, equals the PAYLOAD length&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The amount of entries in a image file depends on the type of file.&lt;br /&gt;
&lt;br /&gt;
=== Images with PB data  ===&lt;br /&gt;
&lt;br /&gt;
Such images can be one of&lt;br /&gt;
&lt;br /&gt;
; Array image files&lt;br /&gt;
: In these files the amount of entries can be any. You should read the image file up to the EOF to find out the exact number.&lt;br /&gt;
; Single-entry image files&lt;br /&gt;
: In these files exactly one entry is stored.&lt;br /&gt;
&lt;br /&gt;
A file type can be guessed by the magic. The description of the entries in ProtocolBuffers language are in respective .proto files which reside in &amp;lt;code&amp;gt;protobuf/&amp;lt;/code&amp;gt; directory in the source tree.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! name&lt;br /&gt;
 ! type&lt;br /&gt;
 ! description&lt;br /&gt;
 ! extra payload&lt;br /&gt;
 ! describing proto file&lt;br /&gt;
 |-&lt;br /&gt;
 | inventory || single-entry || Top level description of images || - || inventory.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fdinfo || array || Open file descriptors || - || fdinfo.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | reg-files || array || Paths to files opened with &amp;lt;code&amp;gt;open(2)&amp;lt;/code&amp;gt; syscall || - || regfile.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventfd || array || Eventfd file information || - || eventfd.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventpoll || array || Eventpoll file information || - || eventpoll.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventpoll-tfd || array || Target file descriptors of eventpoll fds || - || eventpoll.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inotify || array || Inotify file information || - || intotify.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inotify-wd || array || Watch descriptors of inotify fds || - || inotify.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | signalfd || array || signalfd info || - || signalfd.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | core || single-entry || Arch-dependent information (registers, etc.) || - || core.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | mm || single-entry ||  Address space generic information (segments, exe file, etc.) || - || mm.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | vmas || array || Virtual mappings (&amp;lt;code&amp;gt;mmap(2)&amp;lt;/code&amp;gt;) || - || vma.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pipes || array || Pipes information || - || pipe.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pipes-data || array || Contents of pipes || &amp;lt;code&amp;gt;entry.bytes&amp;lt;/code&amp;gt; bytes of data sitting in a pipe || pipe-data.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fifo || array || FIFO information || - || fifo.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fifo-data || array || Contents of FIFOs || same as in pipes-data || pipe-data.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pstree || array || Process tree linkage and IDs || - || pstree.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | sigacts || array || Signal handling map || - || sa.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | unixsk || array || Unix domain sockets || - || sk-unix.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inetsk || array || PF_INET sockets, both IPv4 and IPv6 || - || sk-inet.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | sk-queues || array || Contents of socket queues || &amp;lt;code&amp;gt;entry.length&amp;lt;/code&amp;gt; bytes of data, one entry per packet || sk-packet.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | itimers || array || Interval timers state || - || itimer.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | creds || single-entry || Task credentials: uids, gids, caps, etc. || - || creds.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fs || single-entry || Chroot and chdir information || - || fs.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | remap-fpath || array || File paths remaps || - || remap-file-path.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | ghost-file || single-entry || Ghost files (those, not visible from FS, but still used by tasks) || Right after the entry up to the EOF goes the contents of the file || ghost-file.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tcp-stream || single-entry || TCP connection state (including data in queues) || - || tcp-stream.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | mountpoints || array || Mountpoints information || - || mnt.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | utsns || single-entry || Uname nodename and domainname of a UTS namespace || - || utsns.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tty || array || Information about opened tty-s || - || tty.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tty-info || array || Termios and similar stuff about tty-s || - || tty.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | packetsk || array || Info about PF_PACKET sockets || - || packet-sock.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | netdev || array || Info about network devices || - || netdev.proto&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Images with memory dumps ===&lt;br /&gt;
&lt;br /&gt;
Memory info is stored in two types of images&lt;br /&gt;
&lt;br /&gt;
; Pagemap files&lt;br /&gt;
: These files contain info about which virtual regions are populated with data. The file is a set of protobuf messages.&lt;br /&gt;
{{Note| Even though, pagemap is an array kind of image(and can be included to the previous type), first pb message is of type pagemap_head and all the following ones are of type pagemap_entry. }}&lt;br /&gt;
&lt;br /&gt;
; Pages files&lt;br /&gt;
: These contain 4k pages that are to be put into the memory according to the pagemap.&lt;br /&gt;
&lt;br /&gt;
== Raw images ==&lt;br /&gt;
&lt;br /&gt;
These images contain data that were collected by criu with the help of some external tools. These are&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! name&lt;br /&gt;
 ! tool that understand this format&lt;br /&gt;
 ! description&lt;br /&gt;
 |-&lt;br /&gt;
 | ifaddr || iproute2's ip || Contains info about IP addresses on network devices&lt;br /&gt;
 |-&lt;br /&gt;
 | route || iproute2's ip || Contains routing tables&lt;br /&gt;
 |-&lt;br /&gt;
 | tmpfs || tar + gzip || Contains contents of tmpfs filesystem&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[What's bad with V1 images]]&lt;br /&gt;
* [[ImageFieldMerging | Image field merging]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Images]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=What%27s_bad_with_V1_images&amp;diff=1882</id>
		<title>What's bad with V1 images</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=What%27s_bad_with_V1_images&amp;diff=1882"/>
		<updated>2014-12-18T17:44:25Z</updated>

		<summary type="html">&lt;p&gt;Efiop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Current [[images]] format is great, but sometimes we find problems with it. This page collects all we don't like about them and would like to change some time in the future (once we change this, image format version will be changed as well).&lt;br /&gt;
&lt;br /&gt;
* vma.proto vma_entry-&amp;gt;fd is unused&lt;br /&gt;
* ipc-msg.proto ipc_msg/ipc_msg_entry names mess&lt;br /&gt;
* sk-packet.proto vs packet-sock.proto names mess (all sockets .proto files are sk-&amp;lt;something&amp;gt;)&lt;br /&gt;
* core.proto blk_sigset for master thread is on task_core_entry, but should be in respective thread_core_entry&lt;br /&gt;
* pstree.proto: sid and pgid should NOT be there, but in core image&lt;br /&gt;
* core.proto -- padding for fpu is not used&lt;br /&gt;
* what to do with absent image files? Backward compatibility requires we still restore, common sense -- abort. Flooding inventory with every single new image doesn't sound that great.&lt;br /&gt;
* core.proto -- unused (though optional) ids field&lt;br /&gt;
* clear_thread_info in per-arch members&lt;br /&gt;
* it would be great to unify inotify and fanotify images into one fsnotify file&lt;br /&gt;
* currently we write checkpoint files with '''*.img''' extension, which might be confusing since this extension is a way overloaded by meaning and quite widespreaded, thus it might be worth to change extension to '''*.criu'''&lt;br /&gt;
* mnt_entry::fstype (in mnt.proto) should have enum fstype type&lt;br /&gt;
* all IDs in image should be in uint64 format (not uint32, like in reg_file_entry), this allows us to use unified ID generator over all images&lt;br /&gt;
* IPC mqueue sysctls are required, while in kernel they  can be missing&lt;br /&gt;
* In proto files for registers (and more) it's better to use fixed- types, rather than plain&lt;br /&gt;
* use fixed32 and fixed64 where approiate instead of uint32 and uint64 https://developers.google.com/protocol-buffers/docs/proto&lt;br /&gt;
* flock's flag and type fields is actually too much for what is stored there&lt;br /&gt;
* remap image uses older bit od ID to distinguish one remap type from another, while it should be a typed field&lt;br /&gt;
* evenpoll's tfd ID field is always zero&lt;br /&gt;
* Images structure is not natural. Some contain pb entries of a same type, some have a header of one pb type and then an array of another type or some raw data.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Images]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Packages&amp;diff=1872</id>
		<title>Packages</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Packages&amp;diff=1872"/>
		<updated>2014-12-14T15:45:45Z</updated>

		<summary type="html">&lt;p&gt;Efiop: add link for arch people to vote for enabling CONFIG_CHECKPOINT_RESTORE&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page summarizes our knowledge about CRIU packages in various Linux distributions.&lt;br /&gt;
&amp;lt;big&amp;gt;&lt;br /&gt;
* '''Debian''': http://packages.qa.debian.org/c/criu.html&lt;br /&gt;
&lt;br /&gt;
* '''Fedora''': https://apps.fedoraproject.org/packages/criu&lt;br /&gt;
&lt;br /&gt;
* '''Ubuntu''': https://bugs.launchpad.net/ubuntu/+source/crtools/+bug/1256675 (currently just a request for updating)&lt;br /&gt;
&lt;br /&gt;
* '''Arch''': https://aur.archlinux.org/packages/crtools-git/ ([https://lists.archlinux.org/pipermail/arch-dev-public/2014-April/026102.html CONFIG_CHECKPOINT_RESTORE is disabled since v3.14], vote [https://bugs.archlinux.org/task/43088 here] for enabling it again)&lt;br /&gt;
&lt;br /&gt;
* '''OpenSUSE''': https://build.opensuse.org/package/show/openSUSE:Factory/criu#&lt;br /&gt;
&lt;br /&gt;
* '''Gentoo''': http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-process/criu/&lt;br /&gt;
&lt;br /&gt;
* '''CoreOS''': https://github.com/coreos/coreos-overlay/tree/master/sys-process/criu&lt;br /&gt;
&lt;br /&gt;
* '''AltLinux''': http://packages.altlinux.org/crtools&lt;br /&gt;
&amp;lt;/big&amp;gt;&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=RPC&amp;diff=1792</id>
		<title>RPC</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=RPC&amp;diff=1792"/>
		<updated>2014-12-01T14:01:25Z</updated>

		<summary type="html">&lt;p&gt;Efiop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CRIU-RPC is a remote procedure call (RPC) protocol which uses Google Protocol Buffers to encode its calls. The requests are served by CRIU service launched with &amp;lt;code&amp;gt;criu service&amp;lt;/code&amp;gt; command. It uses a SEQPACKET Unix domain socket listening at &amp;lt;code&amp;gt;/var/run/criu-service.socket&amp;lt;/code&amp;gt; as a transport.&lt;br /&gt;
&lt;br /&gt;
== Protobuf messages ==&lt;br /&gt;
criu_req/criu_resp -- wrappers for requests/responses. They are to be used for transferring messages and needed to provide compatibility with an older versions of rpc. Field type in them _must_ be set accordingly to type of request/response that is stored. Types of request/response are defined in enum criu_req_type.&lt;br /&gt;
&lt;br /&gt;
=== Request ===&lt;br /&gt;
==== criu_req ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_req {&lt;br /&gt;
	required criu_req_type type	= 1;&lt;br /&gt;
&lt;br /&gt;
	optional criu_opts opts		= 2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== criu_req_type ====&lt;br /&gt;
There are 8 request/response types for now. Comments show cmdline analogs.&lt;br /&gt;
&amp;lt;pre&amp;gt;enum criu_req_type {&lt;br /&gt;
	EMPTY		= 0;&lt;br /&gt;
	DUMP		= 1; /* criu dump */&lt;br /&gt;
	RESTORE		= 2; /* criu restore */&lt;br /&gt;
	CHECK		= 3; /* criu check */&lt;br /&gt;
	PRE_DUMP	= 4; /* criu pre-dump */&lt;br /&gt;
	PAGE_SERVER	= 5; /* criu page-server */&lt;br /&gt;
&lt;br /&gt;
	NOTIFY		= 6;&lt;br /&gt;
&lt;br /&gt;
	CPUINFO_DUMP	= 7; /* criu cpuinfo dump */&lt;br /&gt;
	CPUINFO_CHECK	= 8; /* criu cpuinfo check */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== criu_opts ====&lt;br /&gt;
It is used to store options.&lt;br /&gt;
&amp;lt;pre&amp;gt;message criu_opts {&lt;br /&gt;
	required int32			images_dir_fd	= 1;&lt;br /&gt;
	optional int32			pid		= 2; /* if not set on dump, will dump requesting process */&lt;br /&gt;
&lt;br /&gt;
	optional bool			leave_running	= 3;&lt;br /&gt;
	optional bool			ext_unix_sk	= 4;&lt;br /&gt;
	optional bool			tcp_established	= 5;&lt;br /&gt;
	optional bool			evasive_devices	= 6;&lt;br /&gt;
	optional bool			shell_job	= 7;&lt;br /&gt;
	optional bool			file_locks	= 8;&lt;br /&gt;
	optional int32			log_level	= 9 [default = 2];&lt;br /&gt;
	optional string			log_file	= 10; /* No subdirs are allowed. Consider using work-dir */&lt;br /&gt;
&lt;br /&gt;
	optional criu_page_server_info	ps		= 11;&lt;br /&gt;
&lt;br /&gt;
	optional bool			notify_scripts	= 12;&lt;br /&gt;
&lt;br /&gt;
	optional string			root		= 13;&lt;br /&gt;
	optional string			parent_img	= 14;&lt;br /&gt;
	optional bool			track_mem	= 15;&lt;br /&gt;
	optional bool			auto_dedup	= 16;&lt;br /&gt;
&lt;br /&gt;
	optional int32			work_dir_fd	= 17;&lt;br /&gt;
	optional bool			link_remap	= 18;&lt;br /&gt;
	repeated criu_veth_pair		veths		= 19;&lt;br /&gt;
&lt;br /&gt;
	optional uint32			cpu_cap		= 20 [default = 0xffffffff];&lt;br /&gt;
	optional bool			force_irmap	= 21;&lt;br /&gt;
	repeated string			exec_cmd	= 22;&lt;br /&gt;
&lt;br /&gt;
	repeated ext_mount_map		ext_mnt		= 23;&lt;br /&gt;
	optional bool			manage_cgroups	= 24;&lt;br /&gt;
	repeated cgroup_root		cg_root		= 25;&lt;br /&gt;
&lt;br /&gt;
	optional bool			rst_sibling	= 26; /* swrk only */&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no pid is set and type is DUMP, CRIU will dump client process by default.&lt;br /&gt;
Note: Whole tree &amp;lt;pid&amp;gt; must have the same uid, as a client, or client's uid must be == 0, otherwise CRIU won't dump nothing at all.&lt;br /&gt;
&lt;br /&gt;
Only images_dir_fd is required, all other fields may not be set.&lt;br /&gt;
Client must open directory for/with images by himself and set images_dir_fd to it's fd.&lt;br /&gt;
CRIU will open /proc/&amp;lt;client's_pid&amp;gt;/fd/&amp;lt;images_dir_fd&amp;gt;, so it will work, if client is in another namespace.&lt;br /&gt;
&lt;br /&gt;
The logic of setting request is the same as when setting options in console. Here is an example:&lt;br /&gt;
&amp;lt;pre&amp;gt;#criu restore -D /path/to/imgs_dir -v4 -o restore.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
is equal to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
request.type = RESTORE;&lt;br /&gt;
&lt;br /&gt;
request.opts.imgs_dir_fd	= open(&amp;quot;/path/to/imgs_dir&amp;quot;)&lt;br /&gt;
request.opts.log_level		= 4&lt;br /&gt;
request.opts.log_file		= &amp;quot;restore.log&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== criu_page_server_info =====&lt;br /&gt;
Stores info about page-server.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_page_server_info {&lt;br /&gt;
	optional string		address	= 1; /* bind address -- if not set 0.0.0.0 is used */&lt;br /&gt;
	optional int32		port	= 2; /* bind port -- if not set on request, autobind is used and port is returned in response */&lt;br /&gt;
	optional int32		pid	= 3; /* page-server pid -- returned in response */&lt;br /&gt;
	optional int32		fd	= 4; /* could be used to inherit fd by page-server */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== criu_veth_pair =====&lt;br /&gt;
--veth-pair analog.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_veth_pair {&lt;br /&gt;
	required string		if_in	= 1; /* inside veth device name */&lt;br /&gt;
	required string		if_out	= 2; /* outside veth device name */&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== ext_mount_map =====&lt;br /&gt;
--ext-mount-map analog.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message ext_mount_map {&lt;br /&gt;
	required string		key	= 1;&lt;br /&gt;
	required string		val	= 2;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== cgroup_root =====&lt;br /&gt;
--cgroup-root analog.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message cgroup_root {&lt;br /&gt;
	optional string		ctrl	= 1;&lt;br /&gt;
	required string		path	= 2;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Response ===&lt;br /&gt;
==== criu_resp ====&lt;br /&gt;
&amp;lt;pre&amp;gt;message criu_resp {&lt;br /&gt;
	required criu_req_type		type		= 1;&lt;br /&gt;
	required bool			success		= 2;&lt;br /&gt;
&lt;br /&gt;
	optional criu_dump_resp		dump		= 3;&lt;br /&gt;
	optional criu_restore_resp	restore		= 4;&lt;br /&gt;
	optional criu_notify		notify		= 5;&lt;br /&gt;
	optional criu_page_server_info	ps		= 6;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Field &amp;quot;success&amp;quot; reports result of processing request, while criu_***_resp store some request-specific information. The response type is set to the corresponding request type or to &amp;lt;code&amp;gt;EMPTY&amp;lt;/code&amp;gt; to report a &amp;quot;generic&amp;quot; error.&lt;br /&gt;
==== criu_dump_resp ====&lt;br /&gt;
criu_dump_resp is used to store dump response from CRIU.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_dump_resp {&lt;br /&gt;
	optional bool restored		= 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Field &amp;quot;restored&amp;quot; is set to &amp;quot;true&amp;quot; if process was restored.&lt;br /&gt;
&lt;br /&gt;
==== criu_restore_resp ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_restore_resp {&lt;br /&gt;
	required int32 pid		= 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Field &amp;quot;pid&amp;quot; is set to the PID of the restored process.&lt;br /&gt;
&lt;br /&gt;
==== criu_notify ====&lt;br /&gt;
--action-script analog.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_notify {&lt;br /&gt;
	optional string script		= 1;&lt;br /&gt;
	optional int32	pid		= 2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Run ==&lt;br /&gt;
=== Server ===&lt;br /&gt;
On a server side, CRIU creates SOCK_SEQPACKET Unix socket and listens for connections on it. After receiving criu_req, CRIU processes it, do what is requested and sends criu_resp with set request-specific criu_***_resp field back.&lt;br /&gt;
If CRIU gets unknown type of request, it will return criu_resp with type == EMPTY and success == false.&lt;br /&gt;
&lt;br /&gt;
To launch service server, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#criu service [options]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Options accepted by service are&lt;br /&gt;
&lt;br /&gt;
; --address &amp;lt;path&amp;gt;&lt;br /&gt;
: is where to put listening socket&lt;br /&gt;
&lt;br /&gt;
; --pid-file &amp;lt;path&amp;gt;&lt;br /&gt;
: is where to write pid of service process&lt;br /&gt;
&lt;br /&gt;
; --daemon&lt;br /&gt;
: tells service to daemonize&lt;br /&gt;
&lt;br /&gt;
; -o &amp;lt;file&amp;gt;&lt;br /&gt;
: says where to write logs&lt;br /&gt;
&lt;br /&gt;
; -v[N]&lt;br /&gt;
: sets the log-level&lt;br /&gt;
&lt;br /&gt;
====systemd====&lt;br /&gt;
If you are running systemd you can make service start and operate automatically. First do&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to make files &amp;lt;code&amp;gt;criu.service&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;criu.socket&amp;lt;/code&amp;gt; appear in systemd configs (&amp;lt;code&amp;gt;/lib/systemd/system/&amp;lt;/code&amp;gt;). Then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl start criu.socket&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to get /var/run/criu-service.socket, and&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl enable criu.socket&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to make /var/run/criu-service.socket available at boot.&lt;br /&gt;
&lt;br /&gt;
=== Client ===&lt;br /&gt;
Client, in its turn, must connect to service socket, send criu_req with request in it, and wait for a criu_resp with response.&lt;br /&gt;
You can find examples of client programs in C and Python in test/rpc/.&lt;br /&gt;
&lt;br /&gt;
With RPC facilities one can perform a [[self dump]].&lt;br /&gt;
&lt;br /&gt;
There's a [[C_API|library]] that implements simple wrappers on top of RPC.&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
&lt;br /&gt;
See [[Security]].&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=RPC&amp;diff=1784</id>
		<title>RPC</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=RPC&amp;diff=1784"/>
		<updated>2014-12-01T12:17:03Z</updated>

		<summary type="html">&lt;p&gt;Efiop: Add cmdline analogs.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CRIU-RPC is a remote procedure call (RPC) protocol which uses Google Protocol Buffers to encode its calls. The requests are served by CRIU service launched with &amp;lt;code&amp;gt;criu service&amp;lt;/code&amp;gt; command. It uses a SEQPACKET Unix domain socket listening at &amp;lt;code&amp;gt;/var/run/criu-service.socket&amp;lt;/code&amp;gt; as a transport.&lt;br /&gt;
&lt;br /&gt;
== Protobuf messages ==&lt;br /&gt;
criu_req/criu_resp -- wrappers for requests/responses. They are to be used for transferring messages and needed to provide compatibility with an older versions of rpc. Field type in them _must_ be set accordingly to type of request/response that is stored. Types of request/response are defined in enum criu_req_type.&lt;br /&gt;
&lt;br /&gt;
=== Request ===&lt;br /&gt;
==== criu_req ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_req {&lt;br /&gt;
	required criu_req_type type	= 1;&lt;br /&gt;
&lt;br /&gt;
	optional criu_opts opts		= 2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== criu_req_type ====&lt;br /&gt;
There are 8 request/response types for now. Comments show cmdline analogs.&lt;br /&gt;
&amp;lt;pre&amp;gt;enum criu_req_type {&lt;br /&gt;
	EMPTY		= 0;&lt;br /&gt;
	DUMP		= 1; /* criu dump */&lt;br /&gt;
	RESTORE		= 2; /* criu restore */&lt;br /&gt;
	CHECK		= 3; /* criu check */&lt;br /&gt;
	PRE_DUMP	= 4; /* criu pre-dump */&lt;br /&gt;
	PAGE_SERVER	= 5; /* criu page-server */&lt;br /&gt;
&lt;br /&gt;
	NOTIFY		= 6;&lt;br /&gt;
&lt;br /&gt;
	CPUINFO_DUMP	= 7; /* criu cpuinfo dump */&lt;br /&gt;
	CPUINFO_CHECK	= 8; /* criu cpuinfo check */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== criu_opts ====&lt;br /&gt;
It is used to store options.&lt;br /&gt;
&amp;lt;pre&amp;gt;message criu_opts {&lt;br /&gt;
	required int32			images_dir_fd	= 1;&lt;br /&gt;
	optional int32			pid		= 2; /* if not set on dump, will dump requesting process */&lt;br /&gt;
&lt;br /&gt;
	optional bool			leave_running	= 3;&lt;br /&gt;
	optional bool			ext_unix_sk	= 4;&lt;br /&gt;
	optional bool			tcp_established	= 5;&lt;br /&gt;
	optional bool			evasive_devices	= 6;&lt;br /&gt;
	optional bool			shell_job	= 7;&lt;br /&gt;
	optional bool			file_locks	= 8;&lt;br /&gt;
	optional int32			log_level	= 9 [default = 2];&lt;br /&gt;
	optional string			log_file	= 10; /* No subdirs are allowed. Consider using work-dir */&lt;br /&gt;
&lt;br /&gt;
	optional criu_page_server_info	ps		= 11;&lt;br /&gt;
&lt;br /&gt;
	optional bool			notify_scripts	= 12;&lt;br /&gt;
&lt;br /&gt;
	optional string			root		= 13;&lt;br /&gt;
	optional string			parent_img	= 14;&lt;br /&gt;
	optional bool			track_mem	= 15;&lt;br /&gt;
	optional bool			auto_dedup	= 16;&lt;br /&gt;
&lt;br /&gt;
	optional int32			work_dir_fd	= 17;&lt;br /&gt;
	optional bool			link_remap	= 18;&lt;br /&gt;
	repeated criu_veth_pair		veths		= 19;&lt;br /&gt;
&lt;br /&gt;
	optional uint32			cpu_cap		= 20 [default = 0xffffffff];&lt;br /&gt;
	optional bool			force_irmap	= 21;&lt;br /&gt;
	repeated string			exec_cmd	= 22;&lt;br /&gt;
&lt;br /&gt;
	repeated ext_mount_map		ext_mnt		= 23;&lt;br /&gt;
	optional bool			manage_cgroups	= 24;&lt;br /&gt;
	repeated cgroup_root		cg_root		= 25;&lt;br /&gt;
&lt;br /&gt;
	optional bool			rst_sibling	= 26; /* swrk only */&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no pid is set and type is DUMP, CRIU will dump client process by default.&lt;br /&gt;
Note: Whole tree &amp;lt;pid&amp;gt; must have the same uid, as a client, or client's uid must be == 0, otherwise CRIU won't dump nothing at all.&lt;br /&gt;
&lt;br /&gt;
Only images_dir_fd is required, all other fields may not be set.&lt;br /&gt;
Client must open directory for/with images by himself and set images_dir_fd to it's fd.&lt;br /&gt;
CRIU will open /proc/&amp;lt;client's_pid&amp;gt;/fd/&amp;lt;images_dir_fd&amp;gt;, so it will work, if client is in another namespace.&lt;br /&gt;
&lt;br /&gt;
The logic of setting request is the same as when setting options in console. Here is an example:&lt;br /&gt;
&amp;lt;pre&amp;gt;#criu restore -D /path/to/imgs_dir -v4 -o restore.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
is equal to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
request.type = RESTORE;&lt;br /&gt;
&lt;br /&gt;
request.opts.imgs_dir_fd	= open(&amp;quot;/path/to/imgs_dir&amp;quot;)&lt;br /&gt;
request.opts.log_level		= 4&lt;br /&gt;
request.opts.log_file		= &amp;quot;restore.log&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== criu_page_server_info =====&lt;br /&gt;
Stores info about page-server.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_page_server_info {&lt;br /&gt;
	optional string		address	= 1; /* bind address -- if not set 0.0.0.0 is used */&lt;br /&gt;
	optional int32		port	= 2; /* bind port -- if not set on request, autobind is used and port is returned in response */&lt;br /&gt;
	optional int32		pid	= 3; /* page-server pid -- returned in response */&lt;br /&gt;
	optional int32		fd	= 4; /* could be used to inherit fd by page-server */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== criu_veth_pair =====&lt;br /&gt;
--veth-pair analog.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_veth_pair {&lt;br /&gt;
	required string		if_in	= 1; /* inside veth device name */&lt;br /&gt;
	required string		if_out	= 2; /* outside veth device name */&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== ext_mount_map =====&lt;br /&gt;
--ext-mount-map analog.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message ext_mount_map {&lt;br /&gt;
	required string		key	= 1;&lt;br /&gt;
	required string		val	= 2;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== cgroup_root =====&lt;br /&gt;
--cgroup-root analog.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message cgroup_root {&lt;br /&gt;
	optional string		ctrl	= 1;&lt;br /&gt;
	required string		path	= 2;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Response ===&lt;br /&gt;
==== criu_resp ====&lt;br /&gt;
&amp;lt;pre&amp;gt;message criu_resp {&lt;br /&gt;
	required criu_req_type		type		= 1;&lt;br /&gt;
	required bool			success		= 2;&lt;br /&gt;
&lt;br /&gt;
	optional criu_dump_resp		dump		= 3;&lt;br /&gt;
	optional criu_restore_resp	restore		= 4;&lt;br /&gt;
	optional criu_notify		notify		= 5;&lt;br /&gt;
	optional criu_page_server_info	ps		= 6;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Field &amp;quot;success&amp;quot; reports result of processing request, while criu_***_resp store some request-specific information. The response type is set to the corresponding request type or to &amp;lt;code&amp;gt;EMPTY&amp;lt;/code&amp;gt; to report a &amp;quot;generic&amp;quot; error.&lt;br /&gt;
==== criu_dump_resp ====&lt;br /&gt;
criu_dump_resp is used to store dump response from CRIU.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_dump_resp {&lt;br /&gt;
	optional bool restored		= 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Field &amp;quot;restored&amp;quot; is set to &amp;quot;true&amp;quot; if process was restored.&lt;br /&gt;
&lt;br /&gt;
==== criu_restore_resp ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_restore_resp {&lt;br /&gt;
	required int32 pid		= 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Field &amp;quot;pid&amp;quot; is set to the PID of the restored process.&lt;br /&gt;
&lt;br /&gt;
==== criu_notify ====&lt;br /&gt;
TODO&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_notify {&lt;br /&gt;
	optional string script		= 1;&lt;br /&gt;
	optional int32	pid		= 2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Run ==&lt;br /&gt;
=== Server ===&lt;br /&gt;
On a server side, CRIU creates SOCK_SEQPACKET Unix socket and listens for connections on it. After receiving criu_req, CRIU processes it, do what is requested and sends criu_resp with set request-specific criu_***_resp field back.&lt;br /&gt;
If CRIU gets unknown type of request, it will return criu_resp with type == EMPTY and success == false.&lt;br /&gt;
&lt;br /&gt;
To launch service server, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#criu service [options]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Options accepted by service are&lt;br /&gt;
&lt;br /&gt;
; --address &amp;lt;path&amp;gt;&lt;br /&gt;
: is where to put listening socket&lt;br /&gt;
&lt;br /&gt;
; --pid-file &amp;lt;path&amp;gt;&lt;br /&gt;
: is where to write pid of service process&lt;br /&gt;
&lt;br /&gt;
; --daemon&lt;br /&gt;
: tells service to daemonize&lt;br /&gt;
&lt;br /&gt;
; -o &amp;lt;file&amp;gt;&lt;br /&gt;
: says where to write logs&lt;br /&gt;
&lt;br /&gt;
; -v[N]&lt;br /&gt;
: sets the log-level&lt;br /&gt;
&lt;br /&gt;
====systemd====&lt;br /&gt;
If you are running systemd you can make service start and operate automatically. First do&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to make files &amp;lt;code&amp;gt;criu.service&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;criu.socket&amp;lt;/code&amp;gt; appear in systemd configs (&amp;lt;code&amp;gt;/lib/systemd/system/&amp;lt;/code&amp;gt;). Then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl start criu.socket&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to get /var/run/criu-service.socket, and&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl enable criu.socket&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to make /var/run/criu-service.socket available at boot.&lt;br /&gt;
&lt;br /&gt;
=== Client ===&lt;br /&gt;
Client, in its turn, must connect to service socket, send criu_req with request in it, and wait for a criu_resp with response.&lt;br /&gt;
You can find examples of client programs in C and Python in test/rpc/.&lt;br /&gt;
&lt;br /&gt;
With RPC facilities one can perform a [[self dump]].&lt;br /&gt;
&lt;br /&gt;
There's a [[C_API|library]] that implements simple wrappers on top of RPC.&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
&lt;br /&gt;
See [[Security]].&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=RPC&amp;diff=1779</id>
		<title>RPC</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=RPC&amp;diff=1779"/>
		<updated>2014-12-01T12:00:22Z</updated>

		<summary type="html">&lt;p&gt;Efiop: Refresh info.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CRIU-RPC is a remote procedure call (RPC) protocol which uses Google Protocol Buffers to encode its calls. The requests are served by CRIU service launched with &amp;lt;code&amp;gt;criu service&amp;lt;/code&amp;gt; command. It uses a SEQPACKET Unix domain socket listening at &amp;lt;code&amp;gt;/var/run/criu-service.socket&amp;lt;/code&amp;gt; as a transport.&lt;br /&gt;
&lt;br /&gt;
== Protobuf messages ==&lt;br /&gt;
criu_req/criu_resp -- wrappers for requests/responses. They are to be used for transferring messages and needed to provide compatibility with an older versions of rpc. Field type in them _must_ be set accordingly to type of request/response that is stored. Types of request/response are defined in enum criu_req_type.&lt;br /&gt;
&lt;br /&gt;
=== Request ===&lt;br /&gt;
==== criu_req ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_req {&lt;br /&gt;
	required criu_req_type type	= 1;&lt;br /&gt;
&lt;br /&gt;
	optional criu_opts opts		= 2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== criu_req_type ====&lt;br /&gt;
There are 8 request/response types for now. Comments show cmdline analogs.&lt;br /&gt;
&amp;lt;pre&amp;gt;enum criu_req_type {&lt;br /&gt;
	EMPTY		= 0;&lt;br /&gt;
	DUMP		= 1; /* criu dump */&lt;br /&gt;
	RESTORE		= 2; /* criu restore */&lt;br /&gt;
	CHECK		= 3; /* criu check */&lt;br /&gt;
	PRE_DUMP	= 4; /* criu pre-dump */&lt;br /&gt;
	PAGE_SERVER	= 5; /* criu page-server */&lt;br /&gt;
&lt;br /&gt;
	NOTIFY		= 6;&lt;br /&gt;
&lt;br /&gt;
	CPUINFO_DUMP	= 7; /* criu cpuinfo dump */&lt;br /&gt;
	CPUINFO_CHECK	= 8; /* criu cpuinfo check */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== criu_opts ====&lt;br /&gt;
It is used to store options.&lt;br /&gt;
&amp;lt;pre&amp;gt;message criu_opts {&lt;br /&gt;
	required int32			images_dir_fd	= 1;&lt;br /&gt;
	optional int32			pid		= 2; /* if not set on dump, will dump requesting process */&lt;br /&gt;
&lt;br /&gt;
	optional bool			leave_running	= 3;&lt;br /&gt;
	optional bool			ext_unix_sk	= 4;&lt;br /&gt;
	optional bool			tcp_established	= 5;&lt;br /&gt;
	optional bool			evasive_devices	= 6;&lt;br /&gt;
	optional bool			shell_job	= 7;&lt;br /&gt;
	optional bool			file_locks	= 8;&lt;br /&gt;
	optional int32			log_level	= 9 [default = 2];&lt;br /&gt;
	optional string			log_file	= 10; /* No subdirs are allowed. Consider using work-dir */&lt;br /&gt;
&lt;br /&gt;
	optional criu_page_server_info	ps		= 11;&lt;br /&gt;
&lt;br /&gt;
	optional bool			notify_scripts	= 12;&lt;br /&gt;
&lt;br /&gt;
	optional string			root		= 13;&lt;br /&gt;
	optional string			parent_img	= 14;&lt;br /&gt;
	optional bool			track_mem	= 15;&lt;br /&gt;
	optional bool			auto_dedup	= 16;&lt;br /&gt;
&lt;br /&gt;
	optional int32			work_dir_fd	= 17;&lt;br /&gt;
	optional bool			link_remap	= 18;&lt;br /&gt;
	repeated criu_veth_pair		veths		= 19;&lt;br /&gt;
&lt;br /&gt;
	optional uint32			cpu_cap		= 20 [default = 0xffffffff];&lt;br /&gt;
	optional bool			force_irmap	= 21;&lt;br /&gt;
	repeated string			exec_cmd	= 22;&lt;br /&gt;
&lt;br /&gt;
	repeated ext_mount_map		ext_mnt		= 23;&lt;br /&gt;
	optional bool			manage_cgroups	= 24;&lt;br /&gt;
	repeated cgroup_root		cg_root		= 25;&lt;br /&gt;
&lt;br /&gt;
	optional bool			rst_sibling	= 26; /* swrk only */&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If no pid is set and type is DUMP, CRIU will dump client process by default.&lt;br /&gt;
Note: Whole tree &amp;lt;pid&amp;gt; must have the same uid, as a client, or client's uid must be == 0, otherwise CRIU won't dump nothing at all.&lt;br /&gt;
&lt;br /&gt;
Only images_dir_fd is required, all other fields may not be set.&lt;br /&gt;
Client must open directory for/with images by himself and set images_dir_fd to it's fd.&lt;br /&gt;
CRIU will open /proc/&amp;lt;client's_pid&amp;gt;/fd/&amp;lt;images_dir_fd&amp;gt;, so it will work, if client is in another namespace.&lt;br /&gt;
&lt;br /&gt;
The logic of setting request is the same as when setting options in console. Here is an example:&lt;br /&gt;
&amp;lt;pre&amp;gt;#criu restore -D /path/to/imgs_dir -v4 -o restore.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
is equal to:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
request.type = RESTORE;&lt;br /&gt;
&lt;br /&gt;
request.opts.imgs_dir_fd	= open(&amp;quot;/path/to/imgs_dir&amp;quot;)&lt;br /&gt;
request.opts.log_level		= 4&lt;br /&gt;
request.opts.log_file		= &amp;quot;restore.log&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== criu_page_server_info =====&lt;br /&gt;
Stores info about page-server.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_page_server_info {&lt;br /&gt;
	optional string		address	= 1; /* bind address -- if not set 0.0.0.0 is used */&lt;br /&gt;
	optional int32		port	= 2; /* bind port -- if not set on request, autobind is used and port is returned in response */&lt;br /&gt;
	optional int32		pid	= 3; /* page-server pid -- returned in response */&lt;br /&gt;
	optional int32		fd	= 4; /* could be used to inherit fd by page-server */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== criu_veth_pair =====&lt;br /&gt;
TODO&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_veth_pair {&lt;br /&gt;
	required string		if_in	= 1;&lt;br /&gt;
	required string		if_out	= 2;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== ext_mount_map =====&lt;br /&gt;
TODO&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message ext_mount_map {&lt;br /&gt;
	required string		key	= 1;&lt;br /&gt;
	required string		val	= 2;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
===== cgroup_root =====&lt;br /&gt;
TODO&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message cgroup_root {&lt;br /&gt;
	optional string		ctrl	= 1;&lt;br /&gt;
	required string		path	= 2;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Response ===&lt;br /&gt;
==== criu_resp ====&lt;br /&gt;
&amp;lt;pre&amp;gt;message criu_resp {&lt;br /&gt;
	required criu_req_type		type		= 1;&lt;br /&gt;
	required bool			success		= 2;&lt;br /&gt;
&lt;br /&gt;
	optional criu_dump_resp		dump		= 3;&lt;br /&gt;
	optional criu_restore_resp	restore		= 4;&lt;br /&gt;
	optional criu_notify		notify		= 5;&lt;br /&gt;
	optional criu_page_server_info	ps		= 6;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Field &amp;quot;success&amp;quot; reports result of processing request, while criu_***_resp store some request-specific information. The response type is set to the corresponding request type or to &amp;lt;code&amp;gt;EMPTY&amp;lt;/code&amp;gt; to report a &amp;quot;generic&amp;quot; error.&lt;br /&gt;
==== criu_dump_resp ====&lt;br /&gt;
criu_dump_resp is used to store dump response from CRIU.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_dump_resp {&lt;br /&gt;
	optional bool restored		= 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Field &amp;quot;restored&amp;quot; is set to &amp;quot;true&amp;quot; if process was restored.&lt;br /&gt;
&lt;br /&gt;
==== criu_restore_resp ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_restore_resp {&lt;br /&gt;
	required int32 pid		= 1;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Field &amp;quot;pid&amp;quot; is set to the PID of the restored process.&lt;br /&gt;
&lt;br /&gt;
==== criu_notify ====&lt;br /&gt;
TODO&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
message criu_notify {&lt;br /&gt;
	optional string script		= 1;&lt;br /&gt;
	optional int32	pid		= 2;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Run ==&lt;br /&gt;
=== Server ===&lt;br /&gt;
On a server side, CRIU creates SOCK_SEQPACKET Unix socket and listens for connections on it. After receiving criu_req, CRIU processes it, do what is requested and sends criu_resp with set request-specific criu_***_resp field back.&lt;br /&gt;
If CRIU gets unknown type of request, it will return criu_resp with type == EMPTY and success == false.&lt;br /&gt;
&lt;br /&gt;
To launch service server, run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#criu service [options]&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Options accepted by service are&lt;br /&gt;
&lt;br /&gt;
; --address &amp;lt;path&amp;gt;&lt;br /&gt;
: is where to put listening socket&lt;br /&gt;
&lt;br /&gt;
; --pid-file &amp;lt;path&amp;gt;&lt;br /&gt;
: is where to write pid of service process&lt;br /&gt;
&lt;br /&gt;
; --daemon&lt;br /&gt;
: tells service to daemonize&lt;br /&gt;
&lt;br /&gt;
; -o &amp;lt;file&amp;gt;&lt;br /&gt;
: says where to write logs&lt;br /&gt;
&lt;br /&gt;
; -v[N]&lt;br /&gt;
: sets the log-level&lt;br /&gt;
&lt;br /&gt;
====systemd====&lt;br /&gt;
If you are running systemd you can make service start and operate automatically. First do&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to make files &amp;lt;code&amp;gt;criu.service&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;criu.socket&amp;lt;/code&amp;gt; appear in systemd configs (&amp;lt;code&amp;gt;/lib/systemd/system/&amp;lt;/code&amp;gt;). Then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl start criu.socket&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to get /var/run/criu-service.socket, and&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
systemctl enable criu.socket&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to make /var/run/criu-service.socket available at boot.&lt;br /&gt;
&lt;br /&gt;
=== Client ===&lt;br /&gt;
Client, in its turn, must connect to service socket, send criu_req with request in it, and wait for a criu_resp with response.&lt;br /&gt;
You can find examples of client programs in C and Python in test/rpc/.&lt;br /&gt;
&lt;br /&gt;
With RPC facilities one can perform a [[self dump]].&lt;br /&gt;
&lt;br /&gt;
There's a [[C_API|library]] that implements simple wrappers on top of RPC.&lt;br /&gt;
&lt;br /&gt;
== Security ==&lt;br /&gt;
&lt;br /&gt;
See [[Security]].&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Images&amp;diff=1763</id>
		<title>Images</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Images&amp;diff=1763"/>
		<updated>2014-11-26T19:37:57Z</updated>

		<summary type="html">&lt;p&gt;Efiop: Mention CRIT&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The criu utility dumps the state of processes/containers into a set of image files. This article describes the format of them.&lt;br /&gt;
&lt;br /&gt;
{{Note| You might also want to checkout our image tool called [[CRIT]]}}&lt;br /&gt;
&lt;br /&gt;
== Types of image files ==&lt;br /&gt;
&lt;br /&gt;
CRIU images can be in one of formats&lt;br /&gt;
&lt;br /&gt;
* criu specific images in google protocol buffer format (PB format)&lt;br /&gt;
* criu specific images with binary data in it&lt;br /&gt;
* image files in 3rd party format (a.k.a. raw images)&lt;br /&gt;
&lt;br /&gt;
== Images in criu-specific format ==&lt;br /&gt;
&lt;br /&gt;
All criu-specific image files begin with 32-bit magic cookie. Images in PB format are followed by zero or more entries of the same type (not size!), each entry is preceded with 32-bit entry size value (not including this 32-bit value itself). Optionally each entry may be followed by extra payload which depends on the entry type.&lt;br /&gt;
&lt;br /&gt;
IOW protocol-buffers image files look like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IMAGE_FILE ::= MAGIC { ENTRY }&lt;br /&gt;
ENTRY      ::= SIZE PAYLOAD [ EXTRA ]&lt;br /&gt;
PAYLOAD    ::= &amp;quot;message encoded in ProtocolBuffer format&amp;quot;&lt;br /&gt;
EXTRA      ::= &amp;quot;arbitrary blob, depends on the PAYLOAD contents&amp;quot;&lt;br /&gt;
&lt;br /&gt;
MAGIC      ::= &amp;quot;32 bit integer&amp;quot;&lt;br /&gt;
SIZE       ::= &amp;quot;32 bit integer, equals the PAYLOAD length&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or, you can visualize it like&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Size(bytes)&lt;br /&gt;
|-&lt;br /&gt;
| Magic || 4&lt;br /&gt;
|-&lt;br /&gt;
| Size0 || 4&lt;br /&gt;
|-&lt;br /&gt;
| Message0 || Size0&lt;br /&gt;
|-&lt;br /&gt;
| ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| SizeN || 4&lt;br /&gt;
|-&lt;br /&gt;
| MessageN || SizeN&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The amount of entries in a image file depends on the type of file.&lt;br /&gt;
&lt;br /&gt;
=== Images with PB data  ===&lt;br /&gt;
&lt;br /&gt;
Such images can be one of&lt;br /&gt;
&lt;br /&gt;
; Array image files&lt;br /&gt;
: In these files the amount of entries can be any. You should read the image file up to the EOF to find out the exact number.&lt;br /&gt;
; Single-entry image files&lt;br /&gt;
: In these files exactly one entry is stored.&lt;br /&gt;
&lt;br /&gt;
A file type can be guessed by the magic. The description of the entries in ProtocolBuffers language are in respective .proto files which reside in &amp;lt;code&amp;gt;protobuf/&amp;lt;/code&amp;gt; directory in the source tree.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! name&lt;br /&gt;
 ! type&lt;br /&gt;
 ! description&lt;br /&gt;
 ! extra payload&lt;br /&gt;
 ! describing proto file&lt;br /&gt;
 |-&lt;br /&gt;
 | inventory || single-entry || Top level description of images || - || inventory.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fdinfo || array || Open file descriptors || - || fdinfo.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | reg-files || array || Paths to files opened with &amp;lt;code&amp;gt;open(2)&amp;lt;/code&amp;gt; syscall || - || regfile.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventfd || array || Eventfd file information || - || eventfd.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventpoll || array || Eventpoll file information || - || eventpoll.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventpoll-tfd || array || Target file descriptors of eventpoll fds || - || eventpoll.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inotify || array || Inotify file information || - || intotify.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inotify-wd || array || Watch descriptors of inotify fds || - || inotify.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | signalfd || array || signalfd info || - || signalfd.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | core || single-entry || Arch-dependent information (registers, etc.) || - || core.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | mm || single-entry ||  Address space generic information (segments, exe file, etc.) || - || mm.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | vmas || array || Virtual mappings (&amp;lt;code&amp;gt;mmap(2)&amp;lt;/code&amp;gt;) || - || vma.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pipes || array || Pipes information || - || pipe.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pipes-data || array || Contents of pipes || &amp;lt;code&amp;gt;entry.bytes&amp;lt;/code&amp;gt; bytes of data sitting in a pipe || pipe-data.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fifo || array || FIFO information || - || fifo.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fifo-data || array || Contents of FIFOs || same as in pipes-data || pipe-data.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pstree || array || Process tree linkage and IDs || - || pstree.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | sigacts || array || Signal handling map || - || sa.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | unixsk || array || Unix domain sockets || - || sk-unix.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inetsk || array || PF_INET sockets, both IPv4 and IPv6 || - || sk-inet.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | sk-queues || array || Contents of socket queues || &amp;lt;code&amp;gt;entry.length&amp;lt;/code&amp;gt; bytes of data, one entry per packet || sk-packet.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | itimers || array || Interval timers state || - || itimer.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | creds || single-entry || Task credentials: uids, gids, caps, etc. || - || creds.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fs || single-entry || Chroot and chdir information || - || fs.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | remap-fpath || array || File paths remaps || - || remap-file-path.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | ghost-file || single-entry || Ghost files (those, not visible from FS, but still used by tasks) || Right after the entry up to the EOF goes the contents of the file || ghost-file.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tcp-stream || single-entry || TCP connection state (including data in queues) || - || tcp-stream.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | mountpoints || array || Mountpoints information || - || mnt.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | utsns || single-entry || Uname nodename and domainname of a UTS namespace || - || utsns.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tty || array || Information about opened tty-s || - || tty.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tty-info || array || Termios and similar stuff about tty-s || - || tty.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | packetsk || array || Info about PF_PACKET sockets || - || packet-sock.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | netdev || array || Info about network devices || - || netdev.proto&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Images with memory dumps ===&lt;br /&gt;
&lt;br /&gt;
Memory info is stored in two types of images&lt;br /&gt;
&lt;br /&gt;
; Pagemap files&lt;br /&gt;
: These files contain info about which virtual regions are populated with data. The file is a set of protobuf messages.&lt;br /&gt;
{{Note| Even though, pagemap is an array kind of image(and can be included to the previous type), first pb message is of type pagemap_head and all the following ones are of type pagemap_entry. }}&lt;br /&gt;
&lt;br /&gt;
; Pages files&lt;br /&gt;
: These contain 4k pages that are to be put into the memory according to the pagemap.&lt;br /&gt;
&lt;br /&gt;
== Raw images ==&lt;br /&gt;
&lt;br /&gt;
These images contain data that were collected by criu with the help of some external tools. These are&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! name&lt;br /&gt;
 ! tool that understand this format&lt;br /&gt;
 ! description&lt;br /&gt;
 |-&lt;br /&gt;
 | ifaddr || iproute2's ip || Contains info about IP addresses on network devices&lt;br /&gt;
 |-&lt;br /&gt;
 | route || iproute2's ip || Contains routing tables&lt;br /&gt;
 |-&lt;br /&gt;
 | tmpfs || tar + gzip || Contains contents of tmpfs filesystem&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[What's bad with V1 images]]&lt;br /&gt;
* [[ImageFieldMerging | Image field merging]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT&amp;diff=1758</id>
		<title>CRIT</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT&amp;diff=1758"/>
		<updated>2014-11-24T19:27:10Z</updated>

		<summary type="html">&lt;p&gt;Efiop: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the CRiu Image Tool.&lt;br /&gt;
{{Note|As for now(24 Nov 2014) it is not added to the official repo, but you could checkout it [https://github.com/efiop/criu/tree/crit-test here].}}&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;Usage: crit [-h] [-i IN] [-o OUT] [-f {raw,nice}] [-t {json}] {convert}&lt;br /&gt;
&lt;br /&gt;
CRiu Image Tool&lt;br /&gt;
&lt;br /&gt;
positional arguments:&lt;br /&gt;
  {convert}             use &amp;quot;covert&amp;quot; to convert CRIU image to/from human-&lt;br /&gt;
                        readable format&lt;br /&gt;
&lt;br /&gt;
optional arguments:&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
  -i IN, --in IN        input file (stdin by default)&lt;br /&gt;
  -o OUT, --out OUT     output file (stdout by default&lt;br /&gt;
  -f {raw,nice}, --format {raw,nice}&lt;br /&gt;
                        well-formated output (by default: raw for files and&lt;br /&gt;
                        nice for stdout)&lt;br /&gt;
  -t {json}, --type {json}&lt;br /&gt;
                        Type of output file (by default img is converted to&lt;br /&gt;
                        txt and vice versa)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
&lt;br /&gt;
=== Convert images to human-readable and back ===&lt;br /&gt;
This is the replacement for (rather nasty) criu show code. Also this is the way to edit the images before restoring from them.&lt;br /&gt;
&lt;br /&gt;
'''Status: Ready'''&amp;lt;br&amp;gt;&lt;br /&gt;
It uses [https://developers.google.com/protocol-buffers/docs/reference/python/google.protobuf.text_format-module text_format] as a human-readable format for protobuf messages.&lt;br /&gt;
Output file is structured like:&lt;br /&gt;
With &amp;quot;--format raw&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&amp;lt;magic value&amp;gt;&lt;br /&gt;
#0&lt;br /&gt;
&amp;lt;pb entry in text_format&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
#N&lt;br /&gt;
&amp;lt;pb entry in text_format&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With &amp;quot;--format nice&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&amp;lt;magic name&amp;gt;&lt;br /&gt;
#0 &amp;lt;pb entry name&amp;gt;&lt;br /&gt;
&amp;lt;pb entry in text_format with tabs&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
#N &amp;lt;pb entry name&amp;gt;&lt;br /&gt;
&amp;lt;pb entry in text_format with tabs&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, here is how core file will look like with --format nice:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#CORE&lt;br /&gt;
#0 core_entry&lt;br /&gt;
    mtype: X86_64&lt;br /&gt;
    thread_info {&lt;br /&gt;
      clear_tid_addr: 0&lt;br /&gt;
      gpregs {&lt;br /&gt;
        r15: 0&lt;br /&gt;
        r14: 19884608&lt;br /&gt;
        r13: 1&lt;br /&gt;
        r12: 0&lt;br /&gt;
        bp: 19879232&lt;br /&gt;
        bx: 0&lt;br /&gt;
        r11: 582&lt;br /&gt;
        r10: 0&lt;br /&gt;
        r9: 0&lt;br /&gt;
        r8: 19879232&lt;br /&gt;
        ax: 61&lt;br /&gt;
        cx: 18446744073709551615&lt;br /&gt;
        dx: 0&lt;br /&gt;
        si: 140733241187376&lt;br /&gt;
        di: 18446744073709551615&lt;br /&gt;
        orig_ax: 61&lt;br /&gt;
        ip: 213251769082&lt;br /&gt;
        cs: 51&lt;br /&gt;
        flags: 582&lt;br /&gt;
        sp: 140733241187336&lt;br /&gt;
        ss: 43&lt;br /&gt;
        fs_base: 140140334651200&lt;br /&gt;
        gs_base: 0&lt;br /&gt;
        ds: 0&lt;br /&gt;
        es: 0&lt;br /&gt;
        fs: 0&lt;br /&gt;
        gs: 0&lt;br /&gt;
      }&lt;br /&gt;
      fpregs {&lt;br /&gt;
        cwd: 895&lt;br /&gt;
        swd: 0&lt;br /&gt;
        twd: 0&lt;br /&gt;
        fop: 0&lt;br /&gt;
        rip: 0&lt;br /&gt;
        rdp: 0&lt;br /&gt;
        mxcsr: 8064&lt;br /&gt;
        mxcsr_mask: 65535&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 4294967295&lt;br /&gt;
        xmm_space: 4294967295&lt;br /&gt;
        xmm_space: 16777215&lt;br /&gt;
        xmm_space: 16843009&lt;br /&gt;
        xmm_space: 16843009&lt;br /&gt;
        xmm_space: 16843009&lt;br /&gt;
        xmm_space: 4478800&lt;br /&gt;
        xmm_space: 661857632&lt;br /&gt;
        xmm_space: 1869488186&lt;br /&gt;
        xmm_space: 543236212&lt;br /&gt;
        xmm_space: 1970037624&lt;br /&gt;
        xmm_space: 1680696676&lt;br /&gt;
        xmm_space: 775778921&lt;br /&gt;
        xmm_space: 544500071&lt;br /&gt;
        xmm_space: 2019896621&lt;br /&gt;
        xmm_space: 1685417059&lt;br /&gt;
        xmm_space: 1768172901&lt;br /&gt;
        xmm_space: 1747860850&lt;br /&gt;
        xmm_space: 809328999&lt;br /&gt;
        xmm_space: 909327153&lt;br /&gt;
        xmm_space: 1932405306&lt;br /&gt;
        xmm_space: 809334896&lt;br /&gt;
        xmm_space: 909327153&lt;br /&gt;
        xmm_space: 2016291386&lt;br /&gt;
        xmm_space: 1030123635&lt;br /&gt;
        xmm_space: 859517232&lt;br /&gt;
        xmm_space: 14902&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 65&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 4294967295&lt;br /&gt;
        xmm_space: 4294967295&lt;br /&gt;
        xmm_space: 4294967295&lt;br /&gt;
        xmm_space: 4294967295&lt;br /&gt;
        xmm_space: 4294967040&lt;br /&gt;
        xmm_space: 4294967295&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    tc {&lt;br /&gt;
      task_state: 1&lt;br /&gt;
      exit_code: 0&lt;br /&gt;
      personality: 0&lt;br /&gt;
      flags: 1077960704&lt;br /&gt;
      blk_sigset: 65536&lt;br /&gt;
      comm: &amp;quot;loop.sh&amp;quot;&lt;br /&gt;
      timers {&lt;br /&gt;
        real {&lt;br /&gt;
          isec: 0&lt;br /&gt;
          iusec: 0&lt;br /&gt;
          vsec: 0&lt;br /&gt;
          vusec: 0&lt;br /&gt;
        }&lt;br /&gt;
        virt {&lt;br /&gt;
          isec: 0&lt;br /&gt;
          iusec: 0&lt;br /&gt;
          vsec: 0&lt;br /&gt;
          vusec: 0&lt;br /&gt;
        }&lt;br /&gt;
        prof {&lt;br /&gt;
          isec: 0&lt;br /&gt;
          iusec: 0&lt;br /&gt;
          vsec: 0&lt;br /&gt;
          vusec: 0&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      rlimits {&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 18446744073709551615&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 18446744073709551615&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 18446744073709551615&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 8388608&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 0&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 18446744073709551615&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 3898&lt;br /&gt;
          max: 3898&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 1024&lt;br /&gt;
          max: 4096&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 65536&lt;br /&gt;
          max: 65536&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 18446744073709551615&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 18446744073709551615&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 3898&lt;br /&gt;
          max: 3898&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 819200&lt;br /&gt;
          max: 819200&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 0&lt;br /&gt;
          max: 0&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 0&lt;br /&gt;
          max: 0&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 18446744073709551615&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      cg_set: 1&lt;br /&gt;
      signals_s {&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    thread_core {&lt;br /&gt;
      futex_rla: 0&lt;br /&gt;
      futex_rla_len: 24&lt;br /&gt;
      sched_nice: 0&lt;br /&gt;
      sched_policy: 0&lt;br /&gt;
      sas {&lt;br /&gt;
        ss_sp: 0&lt;br /&gt;
        ss_size: 0&lt;br /&gt;
        ss_flags: 2&lt;br /&gt;
      }&lt;br /&gt;
      signals_p {&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Convert to json (and back) ===&lt;br /&gt;
&lt;br /&gt;
Same as before, but the human-readable format is JSON&lt;br /&gt;
&lt;br /&gt;
'''Status: Ready'''&amp;lt;br&amp;gt;&lt;br /&gt;
For now, it does it in a dumb way, by just wrapping text_format in brackets and adding commas where needed.&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;magic&amp;quot;: &amp;quot;CORE&amp;quot;,&lt;br /&gt;
    &amp;quot;0&amp;quot;: {&lt;br /&gt;
        &amp;quot;mtype&amp;quot;: &amp;quot;X86_64&amp;quot;, &lt;br /&gt;
        &amp;quot;thread_core&amp;quot;: {&lt;br /&gt;
            &amp;quot;futex_rla_len&amp;quot;: &amp;quot;24&amp;quot;, &lt;br /&gt;
            &amp;quot;sched_policy&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
            &amp;quot;sched_nice&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
            &amp;quot;futex_rla&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
            &amp;quot;signals_p&amp;quot;: {}, &lt;br /&gt;
            &amp;quot;sas&amp;quot;: {&lt;br /&gt;
                &amp;quot;ss_size&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;ss_sp&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;ss_flags&amp;quot;: &amp;quot;2&amp;quot;&lt;br /&gt;
            }&lt;br /&gt;
        }, &lt;br /&gt;
        &amp;quot;pbtype&amp;quot;: &amp;quot;core_entry&amp;quot;, &lt;br /&gt;
        &amp;quot;thread_info&amp;quot;: {&lt;br /&gt;
            &amp;quot;fpregs&amp;quot;: {&lt;br /&gt;
                &amp;quot;st_space&amp;quot;: [&lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;&lt;br /&gt;
                ], &lt;br /&gt;
                &amp;quot;fop&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;rdp&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;twd&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;mxcsr&amp;quot;: &amp;quot;8064&amp;quot;, &lt;br /&gt;
                &amp;quot;swd&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;rip&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;xmm_space&amp;quot;: [&lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967295&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967295&amp;quot;, &lt;br /&gt;
                    &amp;quot;16777215&amp;quot;, &lt;br /&gt;
                    &amp;quot;16843009&amp;quot;, &lt;br /&gt;
                    &amp;quot;16843009&amp;quot;, &lt;br /&gt;
                    &amp;quot;16843009&amp;quot;, &lt;br /&gt;
                    &amp;quot;4478800&amp;quot;, &lt;br /&gt;
                    &amp;quot;661857632&amp;quot;, &lt;br /&gt;
                    &amp;quot;1869488186&amp;quot;, &lt;br /&gt;
                    &amp;quot;543236212&amp;quot;, &lt;br /&gt;
                    &amp;quot;1970037624&amp;quot;, &lt;br /&gt;
                    &amp;quot;1680696676&amp;quot;, &lt;br /&gt;
                    &amp;quot;775778921&amp;quot;, &lt;br /&gt;
                    &amp;quot;544500071&amp;quot;, &lt;br /&gt;
                    &amp;quot;2019896621&amp;quot;, &lt;br /&gt;
                    &amp;quot;1685417059&amp;quot;, &lt;br /&gt;
                    &amp;quot;1768172901&amp;quot;, &lt;br /&gt;
                    &amp;quot;1747860850&amp;quot;, &lt;br /&gt;
                    &amp;quot;809328999&amp;quot;, &lt;br /&gt;
                    &amp;quot;909327153&amp;quot;, &lt;br /&gt;
                    &amp;quot;1932405306&amp;quot;, &lt;br /&gt;
                    &amp;quot;809334896&amp;quot;, &lt;br /&gt;
                    &amp;quot;909327153&amp;quot;, &lt;br /&gt;
                    &amp;quot;2016291386&amp;quot;, &lt;br /&gt;
                    &amp;quot;1030123635&amp;quot;, &lt;br /&gt;
                    &amp;quot;859517232&amp;quot;, &lt;br /&gt;
                    &amp;quot;14902&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;65&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967295&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967295&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967295&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967295&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967040&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967295&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;&lt;br /&gt;
                ], &lt;br /&gt;
                &amp;quot;cwd&amp;quot;: &amp;quot;895&amp;quot;, &lt;br /&gt;
                &amp;quot;mxcsr_mask&amp;quot;: &amp;quot;65535&amp;quot;&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;quot;clear_tid_addr&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
            &amp;quot;gpregs&amp;quot;: {&lt;br /&gt;
                &amp;quot;gs&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;ip&amp;quot;: &amp;quot;213251769082&amp;quot;, &lt;br /&gt;
                &amp;quot;cx&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                &amp;quot;cs&amp;quot;: &amp;quot;51&amp;quot;, &lt;br /&gt;
                &amp;quot;ax&amp;quot;: &amp;quot;61&amp;quot;, &lt;br /&gt;
                &amp;quot;orig_ax&amp;quot;: &amp;quot;61&amp;quot;, &lt;br /&gt;
                &amp;quot;di&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                &amp;quot;es&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;gs_base&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;r14&amp;quot;: &amp;quot;19884608&amp;quot;, &lt;br /&gt;
                &amp;quot;r15&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;r12&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;r13&amp;quot;: &amp;quot;1&amp;quot;, &lt;br /&gt;
                &amp;quot;r10&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;r11&amp;quot;: &amp;quot;582&amp;quot;, &lt;br /&gt;
                &amp;quot;fs_base&amp;quot;: &amp;quot;140140334651200&amp;quot;, &lt;br /&gt;
                &amp;quot;bp&amp;quot;: &amp;quot;19879232&amp;quot;, &lt;br /&gt;
                &amp;quot;dx&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;bx&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;ds&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;ss&amp;quot;: &amp;quot;43&amp;quot;, &lt;br /&gt;
                &amp;quot;sp&amp;quot;: &amp;quot;140733241187336&amp;quot;, &lt;br /&gt;
                &amp;quot;r8&amp;quot;: &amp;quot;19879232&amp;quot;, &lt;br /&gt;
                &amp;quot;r9&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;fs&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;si&amp;quot;: &amp;quot;140733241187376&amp;quot;, &lt;br /&gt;
                &amp;quot;flags&amp;quot;: &amp;quot;582&amp;quot;&lt;br /&gt;
            }&lt;br /&gt;
        }, &lt;br /&gt;
        &amp;quot;tc&amp;quot;: {&lt;br /&gt;
            &amp;quot;timers&amp;quot;: {&lt;br /&gt;
                &amp;quot;real&amp;quot;: {&lt;br /&gt;
                    &amp;quot;isec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;vusec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;iusec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;vsec&amp;quot;: &amp;quot;0&amp;quot;&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;quot;virt&amp;quot;: {&lt;br /&gt;
                    &amp;quot;isec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;vusec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;iusec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;vsec&amp;quot;: &amp;quot;0&amp;quot;&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;quot;prof&amp;quot;: {&lt;br /&gt;
                    &amp;quot;isec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;vusec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;iusec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;vsec&amp;quot;: &amp;quot;0&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;quot;cg_set&amp;quot;: &amp;quot;1&amp;quot;, &lt;br /&gt;
            &amp;quot;signals_s&amp;quot;: {}, &lt;br /&gt;
            &amp;quot;blk_sigset&amp;quot;: &amp;quot;65536&amp;quot;, &lt;br /&gt;
            &amp;quot;exit_code&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
            &amp;quot;rlimits&amp;quot;: {&lt;br /&gt;
                &amp;quot;rlimits&amp;quot;: [&lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;18446744073709551615&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;18446744073709551615&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;18446744073709551615&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;8388608&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;0&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;18446744073709551615&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;3898&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;3898&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;4096&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;1024&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;65536&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;65536&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;18446744073709551615&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;18446744073709551615&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;3898&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;3898&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;819200&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;819200&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;0&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;0&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;18446744073709551615&amp;quot;&lt;br /&gt;
                    }&lt;br /&gt;
                ]&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;quot;comm&amp;quot;: &amp;quot;\&amp;quot;loop.sh\&amp;quot;&amp;quot;, &lt;br /&gt;
            &amp;quot;flags&amp;quot;: &amp;quot;1077960704&amp;quot;, &lt;br /&gt;
            &amp;quot;task_state&amp;quot;: &amp;quot;1&amp;quot;, &lt;br /&gt;
            &amp;quot;personality&amp;quot;: &amp;quot;0&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Generate core files out of task images ===&lt;br /&gt;
&lt;br /&gt;
All the needed information is in core-$pid.img and pagemap-$pid.img&lt;br /&gt;
&lt;br /&gt;
'''Status: Not ready'''&lt;br /&gt;
&lt;br /&gt;
=== On-the-fly conversion ===&lt;br /&gt;
&lt;br /&gt;
There's an idea to make CRIU spawn CRIT and read images &amp;quot;through&amp;quot; it, to allow for at-the-restore-time modifications&lt;br /&gt;
&lt;br /&gt;
'''Status: Not ready'''&lt;br /&gt;
&lt;br /&gt;
=== Convert between different image versions ===&lt;br /&gt;
&lt;br /&gt;
Right now we store the images version in inventory.img and collect info about [[what's bad with V1 images]]. If some day we have v2, CRIT will convert from v1. And for backward compatibility we'll use on-the-fly conversion when restoring from old images.&lt;br /&gt;
&lt;br /&gt;
'''Status: Not ready'''&lt;br /&gt;
&lt;br /&gt;
=== Show images statistics ===&lt;br /&gt;
&lt;br /&gt;
E.g. -- total number of processes, files, memory, sockets, etc.&lt;br /&gt;
&lt;br /&gt;
Status: Not ready&lt;br /&gt;
&lt;br /&gt;
=== Check/validate images ===&lt;br /&gt;
&lt;br /&gt;
Check that&lt;br /&gt;
* all images are present&lt;br /&gt;
* the inter-images IDs are in consistent state&lt;br /&gt;
&lt;br /&gt;
'''Status: Not ready'''&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=CRIT&amp;diff=1757</id>
		<title>CRIT</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=CRIT&amp;diff=1757"/>
		<updated>2014-11-24T19:26:13Z</updated>

		<summary type="html">&lt;p&gt;Efiop: Show what we have for now&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the CRiu Image Tool.&lt;br /&gt;
{{Note|As for now(24 Nov 2014) it is not added to the official repo, but you could checkout it [https://github.com/efiop/criu/tree/crit-test here].}}&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;Usage: crit [-h] [-i IN] [-o OUT] [-f {raw,nice}] [-t {json}] {convert}&lt;br /&gt;
&lt;br /&gt;
CRiu Image Tool&lt;br /&gt;
&lt;br /&gt;
positional arguments:&lt;br /&gt;
  {convert}             use &amp;quot;covert&amp;quot; to convert CRIU image to/from human-&lt;br /&gt;
                        readable format&lt;br /&gt;
&lt;br /&gt;
optional arguments:&lt;br /&gt;
  -h, --help            show this help message and exit&lt;br /&gt;
  -i IN, --in IN        input file (stdin by default)&lt;br /&gt;
  -o OUT, --out OUT     output file (stdout by default&lt;br /&gt;
  -f {raw,nice}, --format {raw,nice}&lt;br /&gt;
                        well-formated output (by default: raw for files and&lt;br /&gt;
                        nice for stdout)&lt;br /&gt;
  -t {json}, --type {json}&lt;br /&gt;
                        Type of output file (by default img is converted to&lt;br /&gt;
                        txt and vice versa)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functionality ==&lt;br /&gt;
&lt;br /&gt;
=== Convert images to human-readable and back ===&lt;br /&gt;
This is the replacement for (rather nasty) criu show code. Also this is the way to edit the images before restoring from them.&lt;br /&gt;
&lt;br /&gt;
'''Status: Ready'''&amp;lt;br&amp;gt;&lt;br /&gt;
It uses [https://developers.google.com/protocol-buffers/docs/reference/python/google.protobuf.text_format-module text_format] as a human-readable format for protobuf messages.&lt;br /&gt;
Output file is structured like:&lt;br /&gt;
With &amp;quot;--format raw&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&amp;lt;magic value&amp;gt;&lt;br /&gt;
#0&lt;br /&gt;
&amp;lt;pb entry in text_format&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
#N&lt;br /&gt;
&amp;lt;pb entry in text_format&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With &amp;quot;--format nice&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&amp;lt;magic name&amp;gt;&lt;br /&gt;
#0 &amp;lt;pb entry name&amp;gt;&lt;br /&gt;
&amp;lt;pb entry in text_format with tabs&amp;gt;&lt;br /&gt;
....&lt;br /&gt;
#N &amp;lt;pb entry name&amp;gt;&lt;br /&gt;
&amp;lt;pb entry in text_format with tabs&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, here is how core file will look like with --format nice:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#CORE&lt;br /&gt;
#0 core_entry&lt;br /&gt;
    mtype: X86_64&lt;br /&gt;
    thread_info {&lt;br /&gt;
      clear_tid_addr: 0&lt;br /&gt;
      gpregs {&lt;br /&gt;
        r15: 0&lt;br /&gt;
        r14: 19884608&lt;br /&gt;
        r13: 1&lt;br /&gt;
        r12: 0&lt;br /&gt;
        bp: 19879232&lt;br /&gt;
        bx: 0&lt;br /&gt;
        r11: 582&lt;br /&gt;
        r10: 0&lt;br /&gt;
        r9: 0&lt;br /&gt;
        r8: 19879232&lt;br /&gt;
        ax: 61&lt;br /&gt;
        cx: 18446744073709551615&lt;br /&gt;
        dx: 0&lt;br /&gt;
        si: 140733241187376&lt;br /&gt;
        di: 18446744073709551615&lt;br /&gt;
        orig_ax: 61&lt;br /&gt;
        ip: 213251769082&lt;br /&gt;
        cs: 51&lt;br /&gt;
        flags: 582&lt;br /&gt;
        sp: 140733241187336&lt;br /&gt;
        ss: 43&lt;br /&gt;
        fs_base: 140140334651200&lt;br /&gt;
        gs_base: 0&lt;br /&gt;
        ds: 0&lt;br /&gt;
        es: 0&lt;br /&gt;
        fs: 0&lt;br /&gt;
        gs: 0&lt;br /&gt;
      }&lt;br /&gt;
      fpregs {&lt;br /&gt;
        cwd: 895&lt;br /&gt;
        swd: 0&lt;br /&gt;
        twd: 0&lt;br /&gt;
        fop: 0&lt;br /&gt;
        rip: 0&lt;br /&gt;
        rdp: 0&lt;br /&gt;
        mxcsr: 8064&lt;br /&gt;
        mxcsr_mask: 65535&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        st_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 4294967295&lt;br /&gt;
        xmm_space: 4294967295&lt;br /&gt;
        xmm_space: 16777215&lt;br /&gt;
        xmm_space: 16843009&lt;br /&gt;
        xmm_space: 16843009&lt;br /&gt;
        xmm_space: 16843009&lt;br /&gt;
        xmm_space: 4478800&lt;br /&gt;
        xmm_space: 661857632&lt;br /&gt;
        xmm_space: 1869488186&lt;br /&gt;
        xmm_space: 543236212&lt;br /&gt;
        xmm_space: 1970037624&lt;br /&gt;
        xmm_space: 1680696676&lt;br /&gt;
        xmm_space: 775778921&lt;br /&gt;
        xmm_space: 544500071&lt;br /&gt;
        xmm_space: 2019896621&lt;br /&gt;
        xmm_space: 1685417059&lt;br /&gt;
        xmm_space: 1768172901&lt;br /&gt;
        xmm_space: 1747860850&lt;br /&gt;
        xmm_space: 809328999&lt;br /&gt;
        xmm_space: 909327153&lt;br /&gt;
        xmm_space: 1932405306&lt;br /&gt;
        xmm_space: 809334896&lt;br /&gt;
        xmm_space: 909327153&lt;br /&gt;
        xmm_space: 2016291386&lt;br /&gt;
        xmm_space: 1030123635&lt;br /&gt;
        xmm_space: 859517232&lt;br /&gt;
        xmm_space: 14902&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 65&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 4294967295&lt;br /&gt;
        xmm_space: 4294967295&lt;br /&gt;
        xmm_space: 4294967295&lt;br /&gt;
        xmm_space: 4294967295&lt;br /&gt;
        xmm_space: 4294967040&lt;br /&gt;
        xmm_space: 4294967295&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
        xmm_space: 0&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    tc {&lt;br /&gt;
      task_state: 1&lt;br /&gt;
      exit_code: 0&lt;br /&gt;
      personality: 0&lt;br /&gt;
      flags: 1077960704&lt;br /&gt;
      blk_sigset: 65536&lt;br /&gt;
      comm: &amp;quot;loop.sh&amp;quot;&lt;br /&gt;
      timers {&lt;br /&gt;
        real {&lt;br /&gt;
          isec: 0&lt;br /&gt;
          iusec: 0&lt;br /&gt;
          vsec: 0&lt;br /&gt;
          vusec: 0&lt;br /&gt;
        }&lt;br /&gt;
        virt {&lt;br /&gt;
          isec: 0&lt;br /&gt;
          iusec: 0&lt;br /&gt;
          vsec: 0&lt;br /&gt;
          vusec: 0&lt;br /&gt;
        }&lt;br /&gt;
        prof {&lt;br /&gt;
          isec: 0&lt;br /&gt;
          iusec: 0&lt;br /&gt;
          vsec: 0&lt;br /&gt;
          vusec: 0&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      rlimits {&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 18446744073709551615&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 18446744073709551615&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 18446744073709551615&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 8388608&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 0&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 18446744073709551615&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 3898&lt;br /&gt;
          max: 3898&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 1024&lt;br /&gt;
          max: 4096&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 65536&lt;br /&gt;
          max: 65536&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 18446744073709551615&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 18446744073709551615&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 3898&lt;br /&gt;
          max: 3898&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 819200&lt;br /&gt;
          max: 819200&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 0&lt;br /&gt;
          max: 0&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 0&lt;br /&gt;
          max: 0&lt;br /&gt;
        }&lt;br /&gt;
        rlimits {&lt;br /&gt;
          cur: 18446744073709551615&lt;br /&gt;
          max: 18446744073709551615&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
      cg_set: 1&lt;br /&gt;
      signals_s {&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    thread_core {&lt;br /&gt;
      futex_rla: 0&lt;br /&gt;
      futex_rla_len: 24&lt;br /&gt;
      sched_nice: 0&lt;br /&gt;
      sched_policy: 0&lt;br /&gt;
      sas {&lt;br /&gt;
        ss_sp: 0&lt;br /&gt;
        ss_size: 0&lt;br /&gt;
        ss_flags: 2&lt;br /&gt;
      }&lt;br /&gt;
      signals_p {&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Convert to json (and back) ===&lt;br /&gt;
&lt;br /&gt;
Same as before, but the human-readable format is JSON&lt;br /&gt;
&lt;br /&gt;
'''Status: Ready'''&amp;lt;br&amp;gt;&lt;br /&gt;
For now, it does it in a dumb way, by just wrapping text_format in brackets and adding &amp;quot;;&amp;quot; where needed.&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;magic&amp;quot;: &amp;quot;CORE&amp;quot;,&lt;br /&gt;
    &amp;quot;0&amp;quot;: {&lt;br /&gt;
        &amp;quot;mtype&amp;quot;: &amp;quot;X86_64&amp;quot;, &lt;br /&gt;
        &amp;quot;thread_core&amp;quot;: {&lt;br /&gt;
            &amp;quot;futex_rla_len&amp;quot;: &amp;quot;24&amp;quot;, &lt;br /&gt;
            &amp;quot;sched_policy&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
            &amp;quot;sched_nice&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
            &amp;quot;futex_rla&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
            &amp;quot;signals_p&amp;quot;: {}, &lt;br /&gt;
            &amp;quot;sas&amp;quot;: {&lt;br /&gt;
                &amp;quot;ss_size&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;ss_sp&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;ss_flags&amp;quot;: &amp;quot;2&amp;quot;&lt;br /&gt;
            }&lt;br /&gt;
        }, &lt;br /&gt;
        &amp;quot;pbtype&amp;quot;: &amp;quot;core_entry&amp;quot;, &lt;br /&gt;
        &amp;quot;thread_info&amp;quot;: {&lt;br /&gt;
            &amp;quot;fpregs&amp;quot;: {&lt;br /&gt;
                &amp;quot;st_space&amp;quot;: [&lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;&lt;br /&gt;
                ], &lt;br /&gt;
                &amp;quot;fop&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;rdp&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;twd&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;mxcsr&amp;quot;: &amp;quot;8064&amp;quot;, &lt;br /&gt;
                &amp;quot;swd&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;rip&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;xmm_space&amp;quot;: [&lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967295&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967295&amp;quot;, &lt;br /&gt;
                    &amp;quot;16777215&amp;quot;, &lt;br /&gt;
                    &amp;quot;16843009&amp;quot;, &lt;br /&gt;
                    &amp;quot;16843009&amp;quot;, &lt;br /&gt;
                    &amp;quot;16843009&amp;quot;, &lt;br /&gt;
                    &amp;quot;4478800&amp;quot;, &lt;br /&gt;
                    &amp;quot;661857632&amp;quot;, &lt;br /&gt;
                    &amp;quot;1869488186&amp;quot;, &lt;br /&gt;
                    &amp;quot;543236212&amp;quot;, &lt;br /&gt;
                    &amp;quot;1970037624&amp;quot;, &lt;br /&gt;
                    &amp;quot;1680696676&amp;quot;, &lt;br /&gt;
                    &amp;quot;775778921&amp;quot;, &lt;br /&gt;
                    &amp;quot;544500071&amp;quot;, &lt;br /&gt;
                    &amp;quot;2019896621&amp;quot;, &lt;br /&gt;
                    &amp;quot;1685417059&amp;quot;, &lt;br /&gt;
                    &amp;quot;1768172901&amp;quot;, &lt;br /&gt;
                    &amp;quot;1747860850&amp;quot;, &lt;br /&gt;
                    &amp;quot;809328999&amp;quot;, &lt;br /&gt;
                    &amp;quot;909327153&amp;quot;, &lt;br /&gt;
                    &amp;quot;1932405306&amp;quot;, &lt;br /&gt;
                    &amp;quot;809334896&amp;quot;, &lt;br /&gt;
                    &amp;quot;909327153&amp;quot;, &lt;br /&gt;
                    &amp;quot;2016291386&amp;quot;, &lt;br /&gt;
                    &amp;quot;1030123635&amp;quot;, &lt;br /&gt;
                    &amp;quot;859517232&amp;quot;, &lt;br /&gt;
                    &amp;quot;14902&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;65&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967295&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967295&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967295&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967295&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967040&amp;quot;, &lt;br /&gt;
                    &amp;quot;4294967295&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;0&amp;quot;&lt;br /&gt;
                ], &lt;br /&gt;
                &amp;quot;cwd&amp;quot;: &amp;quot;895&amp;quot;, &lt;br /&gt;
                &amp;quot;mxcsr_mask&amp;quot;: &amp;quot;65535&amp;quot;&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;quot;clear_tid_addr&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
            &amp;quot;gpregs&amp;quot;: {&lt;br /&gt;
                &amp;quot;gs&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;ip&amp;quot;: &amp;quot;213251769082&amp;quot;, &lt;br /&gt;
                &amp;quot;cx&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                &amp;quot;cs&amp;quot;: &amp;quot;51&amp;quot;, &lt;br /&gt;
                &amp;quot;ax&amp;quot;: &amp;quot;61&amp;quot;, &lt;br /&gt;
                &amp;quot;orig_ax&amp;quot;: &amp;quot;61&amp;quot;, &lt;br /&gt;
                &amp;quot;di&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                &amp;quot;es&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;gs_base&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;r14&amp;quot;: &amp;quot;19884608&amp;quot;, &lt;br /&gt;
                &amp;quot;r15&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;r12&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;r13&amp;quot;: &amp;quot;1&amp;quot;, &lt;br /&gt;
                &amp;quot;r10&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;r11&amp;quot;: &amp;quot;582&amp;quot;, &lt;br /&gt;
                &amp;quot;fs_base&amp;quot;: &amp;quot;140140334651200&amp;quot;, &lt;br /&gt;
                &amp;quot;bp&amp;quot;: &amp;quot;19879232&amp;quot;, &lt;br /&gt;
                &amp;quot;dx&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;bx&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;ds&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;ss&amp;quot;: &amp;quot;43&amp;quot;, &lt;br /&gt;
                &amp;quot;sp&amp;quot;: &amp;quot;140733241187336&amp;quot;, &lt;br /&gt;
                &amp;quot;r8&amp;quot;: &amp;quot;19879232&amp;quot;, &lt;br /&gt;
                &amp;quot;r9&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;fs&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                &amp;quot;si&amp;quot;: &amp;quot;140733241187376&amp;quot;, &lt;br /&gt;
                &amp;quot;flags&amp;quot;: &amp;quot;582&amp;quot;&lt;br /&gt;
            }&lt;br /&gt;
        }, &lt;br /&gt;
        &amp;quot;tc&amp;quot;: {&lt;br /&gt;
            &amp;quot;timers&amp;quot;: {&lt;br /&gt;
                &amp;quot;real&amp;quot;: {&lt;br /&gt;
                    &amp;quot;isec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;vusec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;iusec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;vsec&amp;quot;: &amp;quot;0&amp;quot;&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;quot;virt&amp;quot;: {&lt;br /&gt;
                    &amp;quot;isec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;vusec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;iusec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;vsec&amp;quot;: &amp;quot;0&amp;quot;&lt;br /&gt;
                }, &lt;br /&gt;
                &amp;quot;prof&amp;quot;: {&lt;br /&gt;
                    &amp;quot;isec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;vusec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;iusec&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                    &amp;quot;vsec&amp;quot;: &amp;quot;0&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;quot;cg_set&amp;quot;: &amp;quot;1&amp;quot;, &lt;br /&gt;
            &amp;quot;signals_s&amp;quot;: {}, &lt;br /&gt;
            &amp;quot;blk_sigset&amp;quot;: &amp;quot;65536&amp;quot;, &lt;br /&gt;
            &amp;quot;exit_code&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
            &amp;quot;rlimits&amp;quot;: {&lt;br /&gt;
                &amp;quot;rlimits&amp;quot;: [&lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;18446744073709551615&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;18446744073709551615&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;18446744073709551615&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;8388608&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;0&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;18446744073709551615&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;3898&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;3898&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;4096&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;1024&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;65536&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;65536&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;18446744073709551615&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;18446744073709551615&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;3898&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;3898&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;819200&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;819200&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;0&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;0&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;0&amp;quot;&lt;br /&gt;
                    }, &lt;br /&gt;
                    {&lt;br /&gt;
                        &amp;quot;max&amp;quot;: &amp;quot;18446744073709551615&amp;quot;, &lt;br /&gt;
                        &amp;quot;cur&amp;quot;: &amp;quot;18446744073709551615&amp;quot;&lt;br /&gt;
                    }&lt;br /&gt;
                ]&lt;br /&gt;
            }, &lt;br /&gt;
            &amp;quot;comm&amp;quot;: &amp;quot;\&amp;quot;loop.sh\&amp;quot;&amp;quot;, &lt;br /&gt;
            &amp;quot;flags&amp;quot;: &amp;quot;1077960704&amp;quot;, &lt;br /&gt;
            &amp;quot;task_state&amp;quot;: &amp;quot;1&amp;quot;, &lt;br /&gt;
            &amp;quot;personality&amp;quot;: &amp;quot;0&amp;quot;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Generate core files out of task images ===&lt;br /&gt;
&lt;br /&gt;
All the needed information is in core-$pid.img and pagemap-$pid.img&lt;br /&gt;
&lt;br /&gt;
'''Status: Not ready'''&lt;br /&gt;
&lt;br /&gt;
=== On-the-fly conversion ===&lt;br /&gt;
&lt;br /&gt;
There's an idea to make CRIU spawn CRIT and read images &amp;quot;through&amp;quot; it, to allow for at-the-restore-time modifications&lt;br /&gt;
&lt;br /&gt;
'''Status: Not ready'''&lt;br /&gt;
&lt;br /&gt;
=== Convert between different image versions ===&lt;br /&gt;
&lt;br /&gt;
Right now we store the images version in inventory.img and collect info about [[what's bad with V1 images]]. If some day we have v2, CRIT will convert from v1. And for backward compatibility we'll use on-the-fly conversion when restoring from old images.&lt;br /&gt;
&lt;br /&gt;
'''Status: Not ready'''&lt;br /&gt;
&lt;br /&gt;
=== Show images statistics ===&lt;br /&gt;
&lt;br /&gt;
E.g. -- total number of processes, files, memory, sockets, etc.&lt;br /&gt;
&lt;br /&gt;
Status: Not ready&lt;br /&gt;
&lt;br /&gt;
=== Check/validate images ===&lt;br /&gt;
&lt;br /&gt;
Check that&lt;br /&gt;
* all images are present&lt;br /&gt;
* the inter-images IDs are in consistent state&lt;br /&gt;
&lt;br /&gt;
'''Status: Not ready'''&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Images&amp;diff=1756</id>
		<title>Images</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Images&amp;diff=1756"/>
		<updated>2014-11-24T18:35:34Z</updated>

		<summary type="html">&lt;p&gt;Efiop: fix format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The criu utility dumps the state of processes/containers into a set of image files. This article describes the format of them.&lt;br /&gt;
&lt;br /&gt;
== Types of image files ==&lt;br /&gt;
&lt;br /&gt;
CRIU images can be in one of formats&lt;br /&gt;
&lt;br /&gt;
* criu specific images in google protocol buffer format (PB format)&lt;br /&gt;
* criu specific images with binary data in it&lt;br /&gt;
* image files in 3rd party format (a.k.a. raw images)&lt;br /&gt;
&lt;br /&gt;
== Images in criu-specific format ==&lt;br /&gt;
&lt;br /&gt;
All criu-specific image files begin with 32-bit magic cookie. Images in PB format are followed by zero or more entries of the same type (not size!), each entry is preceded with 32-bit entry size value (not including this 32-bit value itself). Optionally each entry may be followed by extra payload which depends on the entry type.&lt;br /&gt;
&lt;br /&gt;
IOW protocol-buffers image files look like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IMAGE_FILE ::= MAGIC { ENTRY }&lt;br /&gt;
ENTRY      ::= SIZE PAYLOAD [ EXTRA ]&lt;br /&gt;
PAYLOAD    ::= &amp;quot;message encoded in ProtocolBuffer format&amp;quot;&lt;br /&gt;
EXTRA      ::= &amp;quot;arbitrary blob, depends on the PAYLOAD contents&amp;quot;&lt;br /&gt;
&lt;br /&gt;
MAGIC      ::= &amp;quot;32 bit integer&amp;quot;&lt;br /&gt;
SIZE       ::= &amp;quot;32 bit integer, equals the PAYLOAD length&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or, you can visualize it like&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Size(bytes)&lt;br /&gt;
|-&lt;br /&gt;
| Magic || 4&lt;br /&gt;
|-&lt;br /&gt;
| Size0 || 4&lt;br /&gt;
|-&lt;br /&gt;
| Message0 || Size0&lt;br /&gt;
|-&lt;br /&gt;
| ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| SizeN || 4&lt;br /&gt;
|-&lt;br /&gt;
| MessageN || SizeN&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The amount of entries in a image file depends on the type of file.&lt;br /&gt;
&lt;br /&gt;
=== Images with PB data  ===&lt;br /&gt;
&lt;br /&gt;
Such images can be one of&lt;br /&gt;
&lt;br /&gt;
; Array image files&lt;br /&gt;
: In these files the amount of entries can be any. You should read the image file up to the EOF to find out the exact number.&lt;br /&gt;
; Single-entry image files&lt;br /&gt;
: In these files exactly one entry is stored.&lt;br /&gt;
&lt;br /&gt;
A file type can be guessed by the magic. The description of the entries in ProtocolBuffers language are in respective .proto files which reside in &amp;lt;code&amp;gt;protobuf/&amp;lt;/code&amp;gt; directory in the source tree.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! name&lt;br /&gt;
 ! type&lt;br /&gt;
 ! description&lt;br /&gt;
 ! extra payload&lt;br /&gt;
 ! describing proto file&lt;br /&gt;
 |-&lt;br /&gt;
 | inventory || single-entry || Top level description of images || - || inventory.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fdinfo || array || Open file descriptors || - || fdinfo.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | reg-files || array || Paths to files opened with &amp;lt;code&amp;gt;open(2)&amp;lt;/code&amp;gt; syscall || - || regfile.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventfd || array || Eventfd file information || - || eventfd.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventpoll || array || Eventpoll file information || - || eventpoll.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventpoll-tfd || array || Target file descriptors of eventpoll fds || - || eventpoll.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inotify || array || Inotify file information || - || intotify.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inotify-wd || array || Watch descriptors of inotify fds || - || inotify.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | signalfd || array || signalfd info || - || signalfd.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | core || single-entry || Arch-dependent information (registers, etc.) || - || core.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | mm || single-entry ||  Address space generic information (segments, exe file, etc.) || - || mm.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | vmas || array || Virtual mappings (&amp;lt;code&amp;gt;mmap(2)&amp;lt;/code&amp;gt;) || - || vma.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pipes || array || Pipes information || - || pipe.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pipes-data || array || Contents of pipes || &amp;lt;code&amp;gt;entry.bytes&amp;lt;/code&amp;gt; bytes of data sitting in a pipe || pipe-data.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fifo || array || FIFO information || - || fifo.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fifo-data || array || Contents of FIFOs || same as in pipes-data || pipe-data.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pstree || array || Process tree linkage and IDs || - || pstree.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | sigacts || array || Signal handling map || - || sa.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | unixsk || array || Unix domain sockets || - || sk-unix.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inetsk || array || PF_INET sockets, both IPv4 and IPv6 || - || sk-inet.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | sk-queues || array || Contents of socket queues || &amp;lt;code&amp;gt;entry.length&amp;lt;/code&amp;gt; bytes of data, one entry per packet || sk-packet.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | itimers || array || Interval timers state || - || itimer.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | creds || single-entry || Task credentials: uids, gids, caps, etc. || - || creds.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fs || single-entry || Chroot and chdir information || - || fs.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | remap-fpath || array || File paths remaps || - || remap-file-path.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | ghost-file || single-entry || Ghost files (those, not visible from FS, but still used by tasks) || Right after the entry up to the EOF goes the contents of the file || ghost-file.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tcp-stream || single-entry || TCP connection state (including data in queues) || - || tcp-stream.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | mountpoints || array || Mountpoints information || - || mnt.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | utsns || single-entry || Uname nodename and domainname of a UTS namespace || - || utsns.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tty || array || Information about opened tty-s || - || tty.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tty-info || array || Termios and similar stuff about tty-s || - || tty.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | packetsk || array || Info about PF_PACKET sockets || - || packet-sock.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | netdev || array || Info about network devices || - || netdev.proto&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Images with memory dumps ===&lt;br /&gt;
&lt;br /&gt;
Memory info is stored in two types of images&lt;br /&gt;
&lt;br /&gt;
; Pagemap files&lt;br /&gt;
: These files contain info about which virtual regions are populated with data. The file is a set of protobuf messages.&lt;br /&gt;
{{Note| Even though, pagemap is an array kind of image(and can be included to the previous type), first pb message is of type pagemap_head and all the following ones are of type pagemap_entry. }}&lt;br /&gt;
&lt;br /&gt;
; Pages files&lt;br /&gt;
: These contain 4k pages that are to be put into the memory according to the pagemap.&lt;br /&gt;
&lt;br /&gt;
== Raw images ==&lt;br /&gt;
&lt;br /&gt;
These images contain data that were collected by criu with the help of some external tools. These are&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! name&lt;br /&gt;
 ! tool that understand this format&lt;br /&gt;
 ! description&lt;br /&gt;
 |-&lt;br /&gt;
 | ifaddr || iproute2's ip || Contains info about IP addresses on network devices&lt;br /&gt;
 |-&lt;br /&gt;
 | route || iproute2's ip || Contains routing tables&lt;br /&gt;
 |-&lt;br /&gt;
 | tmpfs || tar + gzip || Contains contents of tmpfs filesystem&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[What's bad with V1 images]]&lt;br /&gt;
* [[ImageFieldMerging | Image field merging]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Images&amp;diff=1755</id>
		<title>Images</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Images&amp;diff=1755"/>
		<updated>2014-11-24T18:34:00Z</updated>

		<summary type="html">&lt;p&gt;Efiop: Explain and ilustrate image structure a bit more clear&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The criu utility dumps the state of processes/containers into a set of image files. This article describes the format of them.&lt;br /&gt;
&lt;br /&gt;
== Types of image files ==&lt;br /&gt;
&lt;br /&gt;
CRIU images can be in one of formats&lt;br /&gt;
&lt;br /&gt;
* criu specific images in google protocol buffer format (PB format)&lt;br /&gt;
* criu specific images with binary data in it&lt;br /&gt;
* image files in 3rd party format (a.k.a. raw images)&lt;br /&gt;
&lt;br /&gt;
== Images in criu-specific format ==&lt;br /&gt;
&lt;br /&gt;
All criu-specific image files begin with 32-bit magic cookie. Images in PB format are followed by zero or more entries of the same type (not size!), each entry is preceded with 32-bit entry size value (not including this 32-bit value itself). Optionally each entry may be followed by extra payload which depends on the entry type.&lt;br /&gt;
&lt;br /&gt;
IOW protocol-buffers image files look like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IMAGE_FILE ::= MAGIC { ENTRY }&lt;br /&gt;
ENTRY      ::= SIZE PAYLOAD [ EXTRA ]&lt;br /&gt;
PAYLOAD    ::= &amp;quot;message encoded in ProtocolBuffer format&amp;quot;&lt;br /&gt;
EXTRA      ::= &amp;quot;arbitrary blob, depends on the PAYLOAD contents&amp;quot;&lt;br /&gt;
&lt;br /&gt;
MAGIC      ::= &amp;quot;32 bit integer&amp;quot;&lt;br /&gt;
SIZE       ::= &amp;quot;32 bit integer, equals the PAYLOAD length&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or, you can visualize it like&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type !! Size(bytes)&lt;br /&gt;
|-&lt;br /&gt;
| Magic || 4&lt;br /&gt;
|-&lt;br /&gt;
| Size0 || 4&lt;br /&gt;
|-&lt;br /&gt;
| Message0 || Size0&lt;br /&gt;
|-&lt;br /&gt;
| ... || ...&lt;br /&gt;
|-&lt;br /&gt;
| SizeN || 4&lt;br /&gt;
|-&lt;br /&gt;
| MessageN || SizeN&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The amount of entries in a image file depends on the type of file.&lt;br /&gt;
&lt;br /&gt;
=== Images with PB data  ===&lt;br /&gt;
&lt;br /&gt;
Such images can be one of&lt;br /&gt;
&lt;br /&gt;
; Array image files&lt;br /&gt;
: In these files the amount of entries can be any. You should read the image file up to the EOF to find out the exact number.&lt;br /&gt;
; Single-entry image files&lt;br /&gt;
: In these files exactly one entry is stored.&lt;br /&gt;
&lt;br /&gt;
A file type can be guessed by the magic. The description of the entries in ProtocolBuffers language are in respective .proto files which reside in &amp;lt;code&amp;gt;protobuf/&amp;lt;/code&amp;gt; directory in the source tree.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! name&lt;br /&gt;
 ! type&lt;br /&gt;
 ! description&lt;br /&gt;
 ! extra payload&lt;br /&gt;
 ! describing proto file&lt;br /&gt;
 |-&lt;br /&gt;
 | inventory || single-entry || Top level description of images || - || inventory.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fdinfo || array || Open file descriptors || - || fdinfo.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | reg-files || array || Paths to files opened with &amp;lt;code&amp;gt;open(2)&amp;lt;/code&amp;gt; syscall || - || regfile.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventfd || array || Eventfd file information || - || eventfd.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventpoll || array || Eventpoll file information || - || eventpoll.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | eventpoll-tfd || array || Target file descriptors of eventpoll fds || - || eventpoll.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inotify || array || Inotify file information || - || intotify.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inotify-wd || array || Watch descriptors of inotify fds || - || inotify.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | signalfd || array || signalfd info || - || signalfd.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | core || single-entry || Arch-dependent information (registers, etc.) || - || core.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | mm || single-entry ||  Address space generic information (segments, exe file, etc.) || - || mm.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | vmas || array || Virtual mappings (&amp;lt;code&amp;gt;mmap(2)&amp;lt;/code&amp;gt;) || - || vma.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pipes || array || Pipes information || - || pipe.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pipes-data || array || Contents of pipes || &amp;lt;code&amp;gt;entry.bytes&amp;lt;/code&amp;gt; bytes of data sitting in a pipe || pipe-data.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fifo || array || FIFO information || - || fifo.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fifo-data || array || Contents of FIFOs || same as in pipes-data || pipe-data.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | pstree || array || Process tree linkage and IDs || - || pstree.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | sigacts || array || Signal handling map || - || sa.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | unixsk || array || Unix domain sockets || - || sk-unix.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | inetsk || array || PF_INET sockets, both IPv4 and IPv6 || - || sk-inet.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | sk-queues || array || Contents of socket queues || &amp;lt;code&amp;gt;entry.length&amp;lt;/code&amp;gt; bytes of data, one entry per packet || sk-packet.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | itimers || array || Interval timers state || - || itimer.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | creds || single-entry || Task credentials: uids, gids, caps, etc. || - || creds.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | fs || single-entry || Chroot and chdir information || - || fs.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | remap-fpath || array || File paths remaps || - || remap-file-path.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | ghost-file || single-entry || Ghost files (those, not visible from FS, but still used by tasks) || Right after the entry up to the EOF goes the contents of the file || ghost-file.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tcp-stream || single-entry || TCP connection state (including data in queues) || - || tcp-stream.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | mountpoints || array || Mountpoints information || - || mnt.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | utsns || single-entry || Uname nodename and domainname of a UTS namespace || - || utsns.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tty || array || Information about opened tty-s || - || tty.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | tty-info || array || Termios and similar stuff about tty-s || - || tty.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | packetsk || array || Info about PF_PACKET sockets || - || packet-sock.proto&lt;br /&gt;
 |-&lt;br /&gt;
 | netdev || array || Info about network devices || - || netdev.proto&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
=== Images with memory dumps ===&lt;br /&gt;
&lt;br /&gt;
Memory info is stored in two types of images&lt;br /&gt;
&lt;br /&gt;
; Pagemap files&lt;br /&gt;
: These files contain info about which virtual regions are populated with data. The file is a set of protobuf messages.&lt;br /&gt;
: Note that, even though, pagemap is an array kind of image(and can be included to the previous type), first pb message is of type pagemap_head and all the following ones are of type pagemap_entry.&lt;br /&gt;
&lt;br /&gt;
; Pages files&lt;br /&gt;
: These contain 4k pages that are to be put into the memory according to the pagemap.&lt;br /&gt;
&lt;br /&gt;
== Raw images ==&lt;br /&gt;
&lt;br /&gt;
These images contain data that were collected by criu with the help of some external tools. These are&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
 |-&lt;br /&gt;
 ! name&lt;br /&gt;
 ! tool that understand this format&lt;br /&gt;
 ! description&lt;br /&gt;
 |-&lt;br /&gt;
 | ifaddr || iproute2's ip || Contains info about IP addresses on network devices&lt;br /&gt;
 |-&lt;br /&gt;
 | route || iproute2's ip || Contains routing tables&lt;br /&gt;
 |-&lt;br /&gt;
 | tmpfs || tar + gzip || Contains contents of tmpfs filesystem&lt;br /&gt;
 |}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[What's bad with V1 images]]&lt;br /&gt;
* [[ImageFieldMerging | Image field merging]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Installation&amp;diff=1720</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Installation&amp;diff=1720"/>
		<updated>2014-10-20T13:46:38Z</updated>

		<summary type="html">&lt;p&gt;Efiop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;criu&amp;lt;/code&amp;gt; is an utility to checkpoint/restore a process tree. This page describes how to manually build and install prerequisites and the tool itself.&lt;br /&gt;
&lt;br /&gt;
{{Note|Most probably you don't need manual installation, but rather [[Packages]] for your distro.}}&lt;br /&gt;
&lt;br /&gt;
== Obtaining CRIU Source ==&lt;br /&gt;
&lt;br /&gt;
You can download the source code as a release tarball or sync the [http://git.criu.org/?p=criu.git;a=summary git repository].&lt;br /&gt;
&lt;br /&gt;
{{Out|{{Latest release}}}}&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.criu.org/criu.git&lt;br /&gt;
 cd criu&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== Compiler and C Library ===&lt;br /&gt;
For native compilation on Debian based systems, install the &amp;lt;code&amp;gt;build-essential&amp;lt;/code&amp;gt; package. For cross compiling for ARM and AArch64, the Linaro prebuilt toolchains are a good choice. Installing them is described below. They are ia32 architecture binaries. On a modern Debian based x86_64 you will need to install the &amp;lt;code&amp;gt;lib32stdc++6&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;lib32z1&amp;lt;/code&amp;gt; packages.&lt;br /&gt;
&lt;br /&gt;
 mkdir -p deps/`uname -m`-linux-gnu&lt;br /&gt;
 cd deps&lt;br /&gt;
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.06_linux.tar.xz&lt;br /&gt;
 wget http://releases.linaro.org/14.09/components/toolchain/binaries/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -C `uname -m`-linux-gnu -xf gcc-linaro-aarch64-linux-gnu-4.9-2014.06-02_linux.tar.xz&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
=== Protocol Buffers with C Bindings ===&lt;br /&gt;
&lt;br /&gt;
CRIU uses the [https://github.com/protobuf-c/protobuf-c C language bindings] of [https://developers.google.com/protocol-buffers/ Google Protocol Buffers] for serialization. The &amp;lt;code&amp;gt;protoc&amp;lt;/code&amp;gt; tool is required at build time and &amp;lt;code&amp;gt;libprotobuf-c.so&amp;lt;/code&amp;gt; is required at build time and at run time, assuming dynamic linking.&lt;br /&gt;
&lt;br /&gt;
==== Distribution Packages ====&lt;br /&gt;
The easiest approach for most would be to install distribution packages. RPM package names: &amp;lt;code&amp;gt;protobuf-c-compiler&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;protobuf-c-devel&amp;lt;/code&amp;gt;. Debian package names: &amp;lt;code&amp;gt;protobuf-c-compiler&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;libprotobuf-c0-dev&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Building Protocol Buffers From Source ====&lt;br /&gt;
If you would like to build from source, you can use the following commands to obtain the source code repositories, configure, and build the code. On a Debian based system, you may have to install the following packages first: &amp;lt;code&amp;gt;autoconf curl g++ libtool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Native protobuf =====&lt;br /&gt;
 cd deps&lt;br /&gt;
 git clone https://github.com/google/protobuf.git protobuf&lt;br /&gt;
 cd protobuf&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure --prefix=`pwd`/../`uname -m`-linux-gnu&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
===== Native protobuf-c =====&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 git clone https://github.com/protobuf-c/protobuf-c.git protobuf-c&lt;br /&gt;
 cd protobuf-c&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 mkdir ../pbc-`uname -m`&lt;br /&gt;
 cd ../pbc-`uname -m`&lt;br /&gt;
 ../protobuf-c/configure --prefix=`pwd`/../`uname -m`-linux-gnu \&lt;br /&gt;
   PKG_CONFIG_PATH=`pwd`/../`uname -m`-linux-gnu/lib/pkgconfig&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
===== Cross Compiling for ARMv7 =====&lt;br /&gt;
If you would like to cross-compile for armv7:&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-arm&lt;br /&gt;
 cd pbc-arm&lt;br /&gt;
 ../protobuf-c/configure --host=arm-linux-gnueabihf --prefix=`pwd`/../arm-linux-gnueabihf --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
===== Cross Compiling for ARMv8 =====&lt;br /&gt;
If you would like to cross-compile for armv8:&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-aarch64&lt;br /&gt;
 cd pbc-aarch64&lt;br /&gt;
  ../protobuf-c/configure --host=aarch64-linux-gnu --prefix=`pwd`/../aarch64-linux-gnu --disable-protoc PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 make install PATH=`pwd`/../`uname -m`-linux-gnu/bin:$PATH&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
=== Some minor, but useful dependencies ===&lt;br /&gt;
==== libbsd ====&lt;br /&gt;
If libbsd is available, CRIU will be compiled with setproctitle() support. It allows to make process titles of service workers to be more verbose.&lt;br /&gt;
&lt;br /&gt;
== Building CRIU From Source ==&lt;br /&gt;
&lt;br /&gt;
=== Native Compilation ===&lt;br /&gt;
With the CRIU source obtained in the first step and dependencies satisfied in the second step, we are now compile CRIU. For native compilation with the dependencies met using distribution packages, simply run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the CRIU source directory.&lt;br /&gt;
&lt;br /&gt;
Here is an example of building natively specifying manually built dependencies.&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 rsync -a --exclude=.git --exclude=deps .. criu-`uname -m`&lt;br /&gt;
 cd criu-`uname -m`&lt;br /&gt;
 make \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../`uname -m`-linux-gnu/include -L`pwd`/../`uname -m`-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
 sudo LD_LIBRARY_PATH=`pwd`/../`uname -m`-linux-gnu/lib ./criu check&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
=== Cross Compilation for ARMv7 ===&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 rsync -a --exclude=.git --exclude=deps .. criu-arm&lt;br /&gt;
 cd criu-arm&lt;br /&gt;
 make \&lt;br /&gt;
   ARCH=arm \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/arm-linux-gnueabihf- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../arm-linux-gnueabihf/include -L`pwd`/../arm-linux-gnueabihf/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
=== Cross Compilation for ARMv8 ===&lt;br /&gt;
&lt;br /&gt;
  cd deps&lt;br /&gt;
  rsync -a --exclude=.git --exclude=deps .. criu-aarch64&lt;br /&gt;
  cd criu-aarch64&lt;br /&gt;
  make \&lt;br /&gt;
   ARCH=aarch64 \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/../`uname -m`-linux-gnu/bin/aarch64-linux-gnu- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/../aarch64-linux-gnu/include -L`pwd`/../aarch64-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/../`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
  cd ../..&lt;br /&gt;
&lt;br /&gt;
=== Linux Kernel ===&lt;br /&gt;
&lt;br /&gt;
Linux kernel v3.11 or newer is required, with some specific options set. If your distribution does not provide needed kernel, you might want to compile one yourself. Note we also have our [[custom kernel]], which might contain some experimental CRIU related patches.&lt;br /&gt;
&lt;br /&gt;
Note you might have to enable&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EXPERT&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Configure standard kernel features (expert users)&lt;br /&gt;
option, which depends on&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EMBEDDED&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Embedded system&lt;br /&gt;
(welcome to Kconfig reverse chains hell).&lt;br /&gt;
&lt;br /&gt;
The following options must be enabled for CRIU to work:&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_CHECKPOINT_RESTORE&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Checkpoint/restore support&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NAMESPACES&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support &lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_UTS_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; UTS namespace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_IPC_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; IPC namespace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_PID_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; PID namespaces&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NET_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; Network namespace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_FHANDLE&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; open by fhandle syscalls&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EVENTFD&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Enable eventfd() system call&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EPOLL&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Enable eventpoll support&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_INOTIFY_USER&amp;lt;/code&amp;gt;&lt;br /&gt;
: File systems -&amp;gt; Inotify support for userspace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_IA32_EMULATION&amp;lt;/code&amp;gt;&lt;br /&gt;
: Executable file formats -&amp;gt; Emulations -&amp;gt; IA32 Emulation&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_UNIX_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Unix domain sockets -&amp;gt; UNIX: socket monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_INET_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; TCP/IP networking -&amp;gt; INET: socket monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_INET_UDP_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; TCP/IP networking -&amp;gt; INET: socket monitoring interface -&amp;gt; UDP: socket monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_PACKET_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Packet socket -&amp;gt; Packet: sockets monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NETLINK_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Netlink socket -&amp;gt; Netlink: sockets monitoring interface&lt;br /&gt;
&lt;br /&gt;
For some [[usage scenarios]] there is an ability to track memory changes and produce [[incremental dumps]]. Need to enable&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_MEM_SOFT_DIRTY&amp;lt;/code&amp;gt;&lt;br /&gt;
: Processor type and features -&amp;gt; Track memory changes&lt;br /&gt;
&lt;br /&gt;
At the moment it's known that CRIU will '''NOT''' work if packet generator module is loaded. Thus make sure&lt;br /&gt;
that either module is unloaded or not compiled at all.&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NET_PKTGEN&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Network testing -&amp;gt; Packet generator&lt;br /&gt;
&lt;br /&gt;
=== iproute2 ===&lt;br /&gt;
The iproute2 tool version 3.5.0 or higher is needed for dumping network namespaces.&lt;br /&gt;
The latest one can be cloned from [http://git.kernel.org/?p=linux/kernel/git/shemminger/iproute2.git;a=summary iproute2]. It should be compiled and a path to ip written in the environment variable &amp;lt;code&amp;gt;CR_IP_TOOL&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Checking That It Works ==&lt;br /&gt;
&lt;br /&gt;
First thing to do is to run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# criu check --ms&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end it should say &amp;quot;Looks OK&amp;quot;, if it doesn't the messages on the screen explain what functionality is missing.&lt;br /&gt;
If you're using our custom kernel, then the &amp;lt;code&amp;gt;--ms&amp;lt;/code&amp;gt; option should not be used, in this case CRIU would&lt;br /&gt;
check for ''all'' the kernel features to work.&lt;br /&gt;
&lt;br /&gt;
You can then try running the [[ZDTM Test Suite]] which sits in the &amp;lt;code&amp;gt;tests/zdtm/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
{{Out|There's a known issue with BTRFS spoiling dev_t values for files and sockets! Not all tests will work on it.}}&lt;br /&gt;
&lt;br /&gt;
== Using CR tools ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Usage]] and [[Advanced usage]], as well as [[:Category:HOWTO]].&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=Installation&amp;diff=1683</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=Installation&amp;diff=1683"/>
		<updated>2014-09-11T15:02:23Z</updated>

		<summary type="html">&lt;p&gt;Efiop: mention setproctitle from libbsd&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;criu&amp;lt;/code&amp;gt; is an utility to checkpoint/restore a process tree. This page describes how to manually build and install prerequisites and the tool itself.&lt;br /&gt;
&lt;br /&gt;
{{Note|Most probably you don't need manual installation, but rather [[Packages]] for your distro.}}&lt;br /&gt;
&lt;br /&gt;
== Obtaining CRIU Source ==&lt;br /&gt;
&lt;br /&gt;
You can download the source code as a release tarball or sync the [http://git.criu.org/?p=criu.git;a=summary git repository].&lt;br /&gt;
&lt;br /&gt;
{{Out|{{Latest release}}}}&lt;br /&gt;
&lt;br /&gt;
 git clone git://git.criu.org/criu.git&lt;br /&gt;
 cd criu&lt;br /&gt;
&lt;br /&gt;
== Dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== Compiler and C Library ===&lt;br /&gt;
For native compilation on Debian based systems, install the &amp;lt;code&amp;gt;build-essential&amp;lt;/code&amp;gt; package. For cross compiling for ARM and AArch64, the Linaro prebuilt toolchains are a good choice. Installing them is described below. They are ia32 architecture binaries. On a modern Debian based x86_64 you will need to install the &amp;lt;code&amp;gt;lib32stdc++6&amp;lt;/code&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
 mkdir deps&lt;br /&gt;
 cd deps&lt;br /&gt;
 wget http://releases.linaro.org/14.06/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.9-2014.06_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -xf gcc-linaro-arm-linux-gnueabihf-4.9-2014.06_linux.tar.xz&lt;br /&gt;
 wget http://releases.linaro.org/14.06/components/toolchain/binaries/gcc-linaro-aarch64-linux-gnu-4.9-2014.06-02_linux.tar.xz&lt;br /&gt;
 tar --strip=1 -xf gcc-linaro-aarch64-linux-gnu-4.9-2014.06-02_linux.tar.xz&lt;br /&gt;
 cd ..&lt;br /&gt;
&lt;br /&gt;
=== Protocol Buffers with C Bindings ===&lt;br /&gt;
&lt;br /&gt;
CRIU uses the [http://code.google.com/p/protobuf-c/ C language bindings] of [http://code.google.com/p/protobuf/ Google Protocol Buffers] for serialization. The &amp;lt;code&amp;gt;protoc&amp;lt;/code&amp;gt; tool is required at build time and &amp;lt;code&amp;gt;libprotobuf-c.so&amp;lt;/code&amp;gt; is required at build time and at run time, assuming dynamic linking.&lt;br /&gt;
&lt;br /&gt;
==== Distribution Packages ====&lt;br /&gt;
The easiest approach for most would be to install distribution packages. RPM package names: &amp;lt;code&amp;gt;protobuf-c-compiler&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;protobuf-c-devel&amp;lt;/code&amp;gt;. Debian package names: &amp;lt;code&amp;gt;protobuf-c-compiler&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;libprotobuf-c0-dev&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Building Protocol Buffers From Source ====&lt;br /&gt;
If you would like to build from source, you can use the following commands to obtain the source code repositories, configure, and build the code. On a Debian based system, you may have to install the following packages first: &amp;lt;code&amp;gt;autoconf curl g++ libtool&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== Native protobuf =====&lt;br /&gt;
 cd deps&lt;br /&gt;
 git svn clone http://protobuf.googlecode.com/svn/trunk protobuf&lt;br /&gt;
 cd protobuf&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 ./configure --prefix=`pwd`/../`uname -m`-linux-gnu&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
===== Native protobuf-c =====&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 git svn clone http://protobuf-c.googlecode.com/svn/trunk protobuf-c&lt;br /&gt;
 cd protobuf-c&lt;br /&gt;
 ./autogen.sh&lt;br /&gt;
 mkdir ../pbc-`uname -m`&lt;br /&gt;
 cd ../pbc-`uname -m`&lt;br /&gt;
 ../protobuf-c/configure --prefix=`pwd`/../`uname -m`-linux-gnu \&lt;br /&gt;
   PKG_CONFIG_PATH=`pwd`/../`uname -m`-linux-gnu/lib/pkgconfig&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
===== Cross Compiling for ARMv7 =====&lt;br /&gt;
If you would like to cross-compile for armv7:&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-arm&lt;br /&gt;
 cd pbc-arm&lt;br /&gt;
 ../protobuf-c/configure --host=arm-linux-gnueabihf --prefix=`pwd`/../arm-linux-gnueabihf --disable-protoc CC=`pwd`/../bin/arm-linux-gnueabihf-gcc&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
===== Cross Compiling for ARMv8 =====&lt;br /&gt;
If you would like to cross-compile for armv8:&lt;br /&gt;
&lt;br /&gt;
 cd deps&lt;br /&gt;
 mkdir -p pbc-aarch64&lt;br /&gt;
 cd pbc-aarch64&lt;br /&gt;
  ../protobuf-c/configure --host=aarch64-linux-gnu --prefix=`pwd`/../aarch64-linux-gnu --disable-protoc CC=`pwd`/../bin/aarch64-linux-gnu-gcc&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
 cd ../..&lt;br /&gt;
&lt;br /&gt;
=== Some minor, but useful dependencies ===&lt;br /&gt;
==== libbsd ====&lt;br /&gt;
If libbsd is available, CRIU will be compiled with setproctitle() support. It allows to make process titles of service workers to be more verbose.&lt;br /&gt;
&lt;br /&gt;
== Building CRIU From Source ==&lt;br /&gt;
&lt;br /&gt;
=== Native Compilation ===&lt;br /&gt;
With the CRIU source obtained in the first step and dependencies satisfied in the second step, we are now compile CRIU. For native compilation with the dependencies met using distribution packages, simply run &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt; in the CRIU source directory.&lt;br /&gt;
&lt;br /&gt;
Here is an example of building natively specifying manually built dependencies.&lt;br /&gt;
&lt;br /&gt;
 make \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/deps/`uname -m`-linux-gnu/include -L`pwd`/deps/`uname -m`-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/deps/`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Cross Compilation for ARMv7 ===&lt;br /&gt;
&lt;br /&gt;
 make \&lt;br /&gt;
   ARCH=arm \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/deps/bin/arm-linux-gnueabihf- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/deps/arm-linux-gnueabihf/include -L`pwd`/deps/arm-linux-gnueabihf/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/deps/`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Cross Compilation for ARMv8 ===&lt;br /&gt;
&lt;br /&gt;
  make \&lt;br /&gt;
   ARCH=aarch64 \&lt;br /&gt;
   CROSS_COMPILE=`pwd`/deps/bin/aarch64-linux-gnu- \&lt;br /&gt;
   USERCFLAGS=&amp;quot;-I`pwd`/deps/aarch64-linux-gnu/include -L`pwd`/deps/aarch64-linux-gnu/lib&amp;quot; \&lt;br /&gt;
   PATH=&amp;quot;`pwd`/deps/`uname -m`-linux-gnu/bin:$PATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Linux Kernel ===&lt;br /&gt;
&lt;br /&gt;
Linux kernel v3.11 or newer is required, with some specific options set. If your distribution does not provide needed kernel, you might want to compile one yourself. Note we also have our [[custom kernel]], which might contain some experimental CRIU related patches.&lt;br /&gt;
&lt;br /&gt;
Note you might have to enable&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EXPERT&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Configure standard kernel features (expert users)&lt;br /&gt;
option, which depends on&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EMBEDDED&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Embedded system&lt;br /&gt;
(welcome to Kconfig reverse chains hell).&lt;br /&gt;
&lt;br /&gt;
The following options must be enabled for CRIU to work:&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_CHECKPOINT_RESTORE&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Checkpoint/restore support&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NAMESPACES&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support &lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_UTS_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; UTS namespace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_IPC_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; IPC namespace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_PID_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; PID namespaces&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NET_NS&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Namespaces support -&amp;gt; Network namespace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_FHANDLE&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; open by fhandle syscalls&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EVENTFD&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Enable eventfd() system call&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_EPOLL&amp;lt;/code&amp;gt;&lt;br /&gt;
: General setup -&amp;gt; Enable eventpoll support&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_INOTIFY_USER&amp;lt;/code&amp;gt;&lt;br /&gt;
: File systems -&amp;gt; Inotify support for userspace&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_IA32_EMULATION&amp;lt;/code&amp;gt;&lt;br /&gt;
: Executable file formats -&amp;gt; Emulations -&amp;gt; IA32 Emulation&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_UNIX_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Unix domain sockets -&amp;gt; UNIX: socket monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_INET_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; TCP/IP networking -&amp;gt; INET: socket monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_INET_UDP_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; TCP/IP networking -&amp;gt; INET: socket monitoring interface -&amp;gt; UDP: socket monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_PACKET_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Packet socket -&amp;gt; Packet: sockets monitoring interface&lt;br /&gt;
&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NETLINK_DIAG&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Netlink socket -&amp;gt; Netlink: sockets monitoring interface&lt;br /&gt;
&lt;br /&gt;
For some [[usage scenarios]] there is an ability to track memory changes and produce [[incremental dumps]]. Need to enable&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_MEM_SOFT_DIRTY&amp;lt;/code&amp;gt;&lt;br /&gt;
: Processor type and features -&amp;gt; Track memory changes&lt;br /&gt;
&lt;br /&gt;
At the moment it's known that CRIU will '''NOT''' work if packet generator module is loaded. Thus make sure&lt;br /&gt;
that either module is unloaded or not compiled at all.&lt;br /&gt;
; &amp;lt;code&amp;gt;CONFIG_NET_PKTGEN&amp;lt;/code&amp;gt;&lt;br /&gt;
: Networking support -&amp;gt; Networking options -&amp;gt; Network testing -&amp;gt; Packet generator&lt;br /&gt;
&lt;br /&gt;
=== iproute2 ===&lt;br /&gt;
The iproute2 tool version 3.5.0 or higher is needed for dumping network namespaces.&lt;br /&gt;
The latest one can be cloned from [http://git.kernel.org/?p=linux/kernel/git/shemminger/iproute2.git;a=summary iproute2]. It should be compiled and a path to ip written in the environment variable &amp;lt;code&amp;gt;CR_IP_TOOL&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Checking That It Works ==&lt;br /&gt;
&lt;br /&gt;
First thing to do is to run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# criu check --ms&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the end it should say &amp;quot;Looks OK&amp;quot;, if it doesn't the messages on the screen explain what functionality is missing.&lt;br /&gt;
If you're using our custom kernel, then the &amp;lt;code&amp;gt;--ms&amp;lt;/code&amp;gt; option should not be used, in this case CRIU would&lt;br /&gt;
check for ''all'' the kernel features to work.&lt;br /&gt;
&lt;br /&gt;
You can then try running the [[ZDTM Test Suite]] which sits in the &amp;lt;code&amp;gt;tests/zdtm/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
{{Out|There's a known issue with BTRFS spoiling dev_t values for files and sockets! Not all tests will work on it.}}&lt;br /&gt;
&lt;br /&gt;
== Using CR tools ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Usage]] and [[Advanced usage]], as well as [[:Category:HOWTO]].&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=ZDTM_test_suite&amp;diff=1682</id>
		<title>ZDTM test suite</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=ZDTM_test_suite&amp;diff=1682"/>
		<updated>2014-09-11T14:54:38Z</updated>

		<summary type="html">&lt;p&gt;Efiop: delete wrong note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
ZDTM stands for zero-down-time-migration. It's test suite developed for testing how OpenVZ live migration works. We use this test suite for checking how criu do their job. The suit consists of many small atomic tests -- each puts a process into some &amp;quot;state&amp;quot; (opens a file, maps a memory segment, puts data in a pipe, etc.), then asks to be checkpointed and restored. The in checks that the &amp;quot;state&amp;quot; was preserved (file is still open, memory is still mapped, pipe contains what was put into it).&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
=== All zdtm tests ===&lt;br /&gt;
You can run all the tests by:&lt;br /&gt;
       make test&lt;br /&gt;
or by:&lt;br /&gt;
       test/zdtm.sh&lt;br /&gt;
&lt;br /&gt;
=== Certain test ===&lt;br /&gt;
You can also run the tests manually by issuing a&lt;br /&gt;
       make &amp;lt;testname&amp;gt;.pid&lt;br /&gt;
command. After you've done c/r-ing it you should run &lt;br /&gt;
       make &amp;lt;testname&amp;gt;.out&lt;br /&gt;
and check for the &amp;lt;testname&amp;gt;.out file contents.&lt;br /&gt;
&lt;br /&gt;
If you don't want to mess with this you can use the &amp;lt;code&amp;gt;zdtm.sh&amp;lt;/code&amp;gt; script. When launched without arguments runs all the tests one-by-one. The exact test can be specified by the command line argument. The &amp;lt;code&amp;gt;-l&amp;lt;/code&amp;gt; option lists the tests it can run.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=How_to_submit_patches&amp;diff=1681</id>
		<title>How to submit patches</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=How_to_submit_patches&amp;diff=1681"/>
		<updated>2014-09-11T14:51:27Z</updated>

		<summary type="html">&lt;p&gt;Efiop: fix link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Setting up working enviroment ==&lt;br /&gt;
Although criu could be run as non-root(see [[Security]]), development is better to be done as root. For example, some tests require root. So, it would be a good idea to set up some recent Linux distro on a virtual machine.&lt;br /&gt;
&lt;br /&gt;
=== Obtaining the source code ===&lt;br /&gt;
&lt;br /&gt;
The CRIU sources are tracked by Git SCM at http://git.criu.org&lt;br /&gt;
repository. You either could download packed sources or use git&lt;br /&gt;
tool itself.&lt;br /&gt;
&lt;br /&gt;
For example to clone criu one need to type&lt;br /&gt;
&lt;br /&gt;
        git clone git://git.criu.org/criu.git&lt;br /&gt;
&lt;br /&gt;
=== Compiling the source code ===&lt;br /&gt;
{{Note|Dependencies are listed in the [Installation] article.}}&lt;br /&gt;
Run:&lt;br /&gt;
        cd criu&lt;br /&gt;
        make&lt;br /&gt;
This will produce ./criu executable.&lt;br /&gt;
As you are going to work with sources, it would come in handy to get tags by running:&lt;br /&gt;
        make tags&lt;br /&gt;
{{Note|It requires ctags to be installed.}}&lt;br /&gt;
&lt;br /&gt;
== Changing the source code ==&lt;br /&gt;
&lt;br /&gt;
When you change the source code keep in mind - we prefer tabs and&lt;br /&gt;
indentations to be 8 characters width. Consider reading [https://www.kernel.org/doc/Documentation/CodingStyle Linux kernel coding style].&lt;br /&gt;
&lt;br /&gt;
Other &amp;quot;rules&amp;quot; could be learned from the source code - just make your code&lt;br /&gt;
to look similar.&lt;br /&gt;
&lt;br /&gt;
== Producing a patch ==&lt;br /&gt;
&lt;br /&gt;
There are at least two ways to make it right.&lt;br /&gt;
&lt;br /&gt;
 1) git format-patch&lt;br /&gt;
&lt;br /&gt;
You might need to read documentation on Git SCM how to prepare patch&lt;br /&gt;
for mail submission. Take a look on http://book.git-scm.com/ and/or&lt;br /&gt;
http://git-scm.com/documentation for details. It should not be hard&lt;br /&gt;
at all.&lt;br /&gt;
&lt;br /&gt;
 2) Use &amp;quot;diff -up&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;diff -up&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;diff -uprN&amp;lt;/code&amp;gt; to create patches.&lt;br /&gt;
&lt;br /&gt;
== Signing your work ==&lt;br /&gt;
&lt;br /&gt;
To improve tracking of who did what we've introduced a &amp;quot;sign-off&amp;quot; procedure&lt;br /&gt;
on patches that are being emailed around.&lt;br /&gt;
&lt;br /&gt;
The sign-off is a simple line at the end of the explanation for the&lt;br /&gt;
patch, which certifies that you wrote it or otherwise have the right to&lt;br /&gt;
pass it on as a open-source patch.  The rules are pretty simple: if you&lt;br /&gt;
can certify the below:&lt;br /&gt;
&lt;br /&gt;
    Developer's Certificate of Origin 1.1&lt;br /&gt;
    &lt;br /&gt;
    By making a contribution to this project, I certify that:&lt;br /&gt;
    &lt;br /&gt;
    (a) The contribution was created in whole or in part by me and I&lt;br /&gt;
        have the right to submit it under the open source license&lt;br /&gt;
        indicated in the file; or&lt;br /&gt;
    &lt;br /&gt;
    (b) The contribution is based upon previous work that, to the best&lt;br /&gt;
        of my knowledge, is covered under an appropriate open source&lt;br /&gt;
        license and I have the right under that license to submit that&lt;br /&gt;
        work with modifications, whether created in whole or in part&lt;br /&gt;
        by me, under the same open source license (unless I am&lt;br /&gt;
        permitted to submit under a different license), as indicated&lt;br /&gt;
        in the file; or&lt;br /&gt;
    &lt;br /&gt;
    (c) The contribution was provided directly to me by some other&lt;br /&gt;
        person who certified (a), (b) or (c) and I have not modified&lt;br /&gt;
        it.&lt;br /&gt;
    &lt;br /&gt;
    (d) I understand and agree that this project and the contribution&lt;br /&gt;
        are public and that a record of the contribution (including all&lt;br /&gt;
        personal information I submit with it, including my sign-off) is&lt;br /&gt;
        maintained indefinitely and may be redistributed consistent with&lt;br /&gt;
        this project or the open source license(s) involved.&lt;br /&gt;
&lt;br /&gt;
then you just add a line saying&lt;br /&gt;
&lt;br /&gt;
        Signed-off-by: Random J Developer &amp;lt;random at developer.example.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using your real name (please, no pseudonyms or anonymous contributions if&lt;br /&gt;
it possible)&lt;br /&gt;
&lt;br /&gt;
== An example of patch message ==&lt;br /&gt;
&lt;br /&gt;
 From: Random J Developer &amp;lt;random at developer.example.org&amp;gt;&lt;br /&gt;
 Subject: [PATCH] Short patch description&lt;br /&gt;
 &lt;br /&gt;
 Long patch description (could be skipped if patch&lt;br /&gt;
 is trivial enough)&lt;br /&gt;
 &lt;br /&gt;
 Signed-off-by: Random J Developer &amp;lt;random at developer.example.org&amp;gt;&lt;br /&gt;
 ---&lt;br /&gt;
 Patch body here&lt;br /&gt;
&lt;br /&gt;
== Checking patches for errors ==&lt;br /&gt;
Basic style error checking is provided by scripts/checkpatch.pl script&lt;br /&gt;
from linux kernel source tree. You might have headers or complete sources&lt;br /&gt;
of linux kernel at /usr/src/. Run&lt;br /&gt;
         checkpatch.pl my_patch.patch (consider --no-tree option for headers-only)&lt;br /&gt;
It will produce detailed report on style problems in your patch.&lt;br /&gt;
Make sure to fix all _errors_(some warnings may be ignored).&lt;br /&gt;
&lt;br /&gt;
To check whether your patches don't harm anything run&lt;br /&gt;
         make test&lt;br /&gt;
It will launch [[ZDTM_Test_Suite]]. Check for error messages produced by it.&lt;br /&gt;
You may also want to run other tests(rpc, libcriu, security etc) from test/ dir.&lt;br /&gt;
&lt;br /&gt;
== Mailing patches ==&lt;br /&gt;
&lt;br /&gt;
The patches should be sent to CRIU development mailing list&lt;br /&gt;
which is located at https://openvz.org/mailman/listinfo/criu&lt;br /&gt;
&lt;br /&gt;
Please make sure the email client you're using doesn't screw&lt;br /&gt;
your patch (line wrapping and so on).&lt;br /&gt;
&lt;br /&gt;
== Wait for response ==&lt;br /&gt;
&lt;br /&gt;
Be patient. Most CRIU developers are pretty busy people so if&lt;br /&gt;
there is no immediate response on your patch - don't be surprised,&lt;br /&gt;
sometimes a patch may fly around a week(s) before it get reviewed.&lt;br /&gt;
But definitely the patches will not go to &amp;lt;code&amp;gt;/dev/null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=How_to_submit_patches&amp;diff=1672</id>
		<title>How to submit patches</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=How_to_submit_patches&amp;diff=1672"/>
		<updated>2014-09-05T09:20:43Z</updated>

		<summary type="html">&lt;p&gt;Efiop: add some hints about criu development&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Setting up working enviroment ==&lt;br /&gt;
Although criu could be run as non-root(see [Security]), development is better to be done as root. For example, some tests require root. So, it would be a good idea to set up some recent Linux distro on a virtual machine.&lt;br /&gt;
&lt;br /&gt;
=== Obtaining the source code ===&lt;br /&gt;
&lt;br /&gt;
The CRIU sources are tracked by Git SCM at http://git.criu.org&lt;br /&gt;
repository. You either could download packed sources or use git&lt;br /&gt;
tool itself.&lt;br /&gt;
&lt;br /&gt;
For example to clone criu one need to type&lt;br /&gt;
&lt;br /&gt;
        git clone git://git.criu.org/criu.git&lt;br /&gt;
&lt;br /&gt;
=== Compiling the source code ===&lt;br /&gt;
{{Note|Dependencies are listed in the [Installation] article.}}&lt;br /&gt;
Run:&lt;br /&gt;
        cd criu&lt;br /&gt;
        make&lt;br /&gt;
This will produce ./criu executable.&lt;br /&gt;
As you are going to work with sources, it would come in handy to get tags by running:&lt;br /&gt;
        make tags&lt;br /&gt;
{{Note|It requires ctags to be installed.}}&lt;br /&gt;
&lt;br /&gt;
== Changing the source code ==&lt;br /&gt;
&lt;br /&gt;
When you change the source code keep in mind - we prefer tabs and&lt;br /&gt;
indentations to be 8 characters width. Consider reading [https://www.kernel.org/doc/Documentation/CodingStyle Linux kernel coding style].&lt;br /&gt;
&lt;br /&gt;
Other &amp;quot;rules&amp;quot; could be learned from the source code - just make your code&lt;br /&gt;
to look similar.&lt;br /&gt;
&lt;br /&gt;
== Producing a patch ==&lt;br /&gt;
&lt;br /&gt;
There are at least two ways to make it right.&lt;br /&gt;
&lt;br /&gt;
 1) git format-patch&lt;br /&gt;
&lt;br /&gt;
You might need to read documentation on Git SCM how to prepare patch&lt;br /&gt;
for mail submission. Take a look on http://book.git-scm.com/ and/or&lt;br /&gt;
http://git-scm.com/documentation for details. It should not be hard&lt;br /&gt;
at all.&lt;br /&gt;
&lt;br /&gt;
 2) Use &amp;quot;diff -up&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;diff -up&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;diff -uprN&amp;lt;/code&amp;gt; to create patches.&lt;br /&gt;
&lt;br /&gt;
== Signing your work ==&lt;br /&gt;
&lt;br /&gt;
To improve tracking of who did what we've introduced a &amp;quot;sign-off&amp;quot; procedure&lt;br /&gt;
on patches that are being emailed around.&lt;br /&gt;
&lt;br /&gt;
The sign-off is a simple line at the end of the explanation for the&lt;br /&gt;
patch, which certifies that you wrote it or otherwise have the right to&lt;br /&gt;
pass it on as a open-source patch.  The rules are pretty simple: if you&lt;br /&gt;
can certify the below:&lt;br /&gt;
&lt;br /&gt;
    Developer's Certificate of Origin 1.1&lt;br /&gt;
    &lt;br /&gt;
    By making a contribution to this project, I certify that:&lt;br /&gt;
    &lt;br /&gt;
    (a) The contribution was created in whole or in part by me and I&lt;br /&gt;
        have the right to submit it under the open source license&lt;br /&gt;
        indicated in the file; or&lt;br /&gt;
    &lt;br /&gt;
    (b) The contribution is based upon previous work that, to the best&lt;br /&gt;
        of my knowledge, is covered under an appropriate open source&lt;br /&gt;
        license and I have the right under that license to submit that&lt;br /&gt;
        work with modifications, whether created in whole or in part&lt;br /&gt;
        by me, under the same open source license (unless I am&lt;br /&gt;
        permitted to submit under a different license), as indicated&lt;br /&gt;
        in the file; or&lt;br /&gt;
    &lt;br /&gt;
    (c) The contribution was provided directly to me by some other&lt;br /&gt;
        person who certified (a), (b) or (c) and I have not modified&lt;br /&gt;
        it.&lt;br /&gt;
    &lt;br /&gt;
    (d) I understand and agree that this project and the contribution&lt;br /&gt;
        are public and that a record of the contribution (including all&lt;br /&gt;
        personal information I submit with it, including my sign-off) is&lt;br /&gt;
        maintained indefinitely and may be redistributed consistent with&lt;br /&gt;
        this project or the open source license(s) involved.&lt;br /&gt;
&lt;br /&gt;
then you just add a line saying&lt;br /&gt;
&lt;br /&gt;
        Signed-off-by: Random J Developer &amp;lt;random at developer.example.org&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using your real name (please, no pseudonyms or anonymous contributions if&lt;br /&gt;
it possible)&lt;br /&gt;
&lt;br /&gt;
== An example of patch message ==&lt;br /&gt;
&lt;br /&gt;
 From: Random J Developer &amp;lt;random at developer.example.org&amp;gt;&lt;br /&gt;
 Subject: [PATCH] Short patch description&lt;br /&gt;
 &lt;br /&gt;
 Long patch description (could be skipped if patch&lt;br /&gt;
 is trivial enough)&lt;br /&gt;
 &lt;br /&gt;
 Signed-off-by: Random J Developer &amp;lt;random at developer.example.org&amp;gt;&lt;br /&gt;
 ---&lt;br /&gt;
 Patch body here&lt;br /&gt;
&lt;br /&gt;
== Checking patches for errors ==&lt;br /&gt;
Basic style error checking is provided by scripts/checkpatch.pl script&lt;br /&gt;
from linux kernel source tree. You might have headers or complete sources&lt;br /&gt;
of linux kernel at /usr/src/. Run&lt;br /&gt;
         checkpatch.pl my_patch.patch (consider --no-tree option for headers-only)&lt;br /&gt;
It will produce detailed report on style problems in your patch.&lt;br /&gt;
Make sure to fix all _errors_(some warnings may be ignored).&lt;br /&gt;
&lt;br /&gt;
To check whether your patches don't harm anything run&lt;br /&gt;
         make test&lt;br /&gt;
It will launch [[ZDTM_Test_Suite]]. Check for error messages produced by it.&lt;br /&gt;
You may also want to run other tests(rpc, libcriu, security etc) from test/ dir.&lt;br /&gt;
&lt;br /&gt;
== Mailing patches ==&lt;br /&gt;
&lt;br /&gt;
The patches should be sent to CRIU development mailing list&lt;br /&gt;
which is located at https://openvz.org/mailman/listinfo/criu&lt;br /&gt;
&lt;br /&gt;
Please make sure the email client you're using doesn't screw&lt;br /&gt;
your patch (line wrapping and so on).&lt;br /&gt;
&lt;br /&gt;
== Wait for response ==&lt;br /&gt;
&lt;br /&gt;
Be patient. Most CRIU developers are pretty busy people so if&lt;br /&gt;
there is no immediate response on your patch - don't be surprised,&lt;br /&gt;
sometimes a patch may fly around a week(s) before it get reviewed.&lt;br /&gt;
But definitely the patches will not go to &amp;lt;code&amp;gt;/dev/null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
	<entry>
		<id>https://criu.org/index.php?title=ZDTM_test_suite&amp;diff=1665</id>
		<title>ZDTM test suite</title>
		<link rel="alternate" type="text/html" href="https://criu.org/index.php?title=ZDTM_test_suite&amp;diff=1665"/>
		<updated>2014-09-02T12:23:23Z</updated>

		<summary type="html">&lt;p&gt;Efiop: add a bit more information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
ZDTM stands for zero-down-time-migration. It's test suite developed for testing how OpenVZ live migration works. We use this test suite for checking how criu do their job. The suit consists of many small atomic tests -- each puts a process into some &amp;quot;state&amp;quot; (opens a file, maps a memory segment, puts data in a pipe, etc.), then asks to be checkpointed and restored. The in checks that the &amp;quot;state&amp;quot; was preserved (file is still open, memory is still mapped, pipe contains what was put into it).&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
=== All zdtm tests ===&lt;br /&gt;
You can run all the tests by:&lt;br /&gt;
       make test&lt;br /&gt;
or by:&lt;br /&gt;
       test/zdtm.sh&lt;br /&gt;
Note, that if one test fails, ztdm will continue to run others. So, be sure to check its output for error messages.&lt;br /&gt;
&lt;br /&gt;
=== Certain test ===&lt;br /&gt;
You can also run the tests manually by issuing a&lt;br /&gt;
       make &amp;lt;testname&amp;gt;.pid&lt;br /&gt;
command. After you've done c/r-ing it you should run &lt;br /&gt;
       make &amp;lt;testname&amp;gt;.out&lt;br /&gt;
and check for the &amp;lt;testname&amp;gt;.out file contents.&lt;br /&gt;
&lt;br /&gt;
If you don't want to mess with this you can use the &amp;lt;code&amp;gt;zdtm.sh&amp;lt;/code&amp;gt; script. When launched without arguments runs all the tests one-by-one. The exact test can be specified by the command line argument. The &amp;lt;code&amp;gt;-l&amp;lt;/code&amp;gt; option lists the tests it can run.&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;/div&gt;</summary>
		<author><name>Efiop</name></author>
	</entry>
</feed>