[CRIU] Restoring with different PID

Pavel Emelyanov xemul at parallels.com
Tue May 7 14:06:34 EDT 2013


On 05/06/2013 11:09 PM, Bhargav Bhikkaji wrote:
> Hi All,
> 
> A process on VM-1 is running with PID: 26861. Check-pointed this process using following command
> 
> ./criu dump -vvvv -D /root/download/test-images/ -o /root/download/test-images/dump.log -t 26861 -R --shell-job && echo OK
> 
> Moved *.img files on to VM-2 and restored them with following command.
> 
> ./criu restore -vvvv -d -D /root/download/test-images -o /root/download/test-images/restore.log -t 27397 --shell-job && echo OK
> 
> Pls note, tried to restore with different process ID but what is observed is that *restore* always restores with original process id it was check pointed with.
> 
> Is it possible to change the process id during restore ?

It's almost impossible. The thing is that tasks tend to keep pid-s values in their
internal data structures and we cannot change these numbers, as we do not know the
logic used by tasks.

One of examples of pids storing is glibc -- it caches the pid value e.g. for speeding
up the getpid() function.

Thus I see no ways for restoring a task with its pid changed.

> Thanks
> Bhargav

Thanks,
Pavel


More information about the CRIU mailing list