[CRIU] Patch for the migration feature to change ip

孙亚 sunya888888 at 163.com
Thu Jul 10 23:00:17 PDT 2014


Hi there:
 In order to implement the migration with changing the ip to the target machine where the program migrates to ,  I add a arg option '-m' in main function in  crtools.c and add some code to limit the -m option only valid in restore operation. And I add a data member in opts struct defined in cr_option.h.

When the user use the command like this:

'''criu restore -D targetFiles -m 192.168.0.1 --tcp-established '''

the ip will be changed into 192.168.0.1 in function restore_sockaddr in sk-inet.c.
Of course , the program will be restored , but the tcp connection will be disconnected because of the changing of the ip. And for the program , there should be error handling code for this scenario.

By the way , if there is not -m option in command, the program will be restored in the original way.
Finally, I patched the three files. But what should be noticed , the command to patch the files:

'''diff -uN fromFile toFile > file.patch'''

the fromFile is from the criu-1.3-rc1 , and the toFile is from the criu-1.3-rc2.

The whole story will be seen: https://bugzilla.openvz.org/show_bug.cgi?id=2988
If there is any problem , please let me know.
The attachment is the patch files.
Thanks
 
Ya Sun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20140711/8b8045be/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patchForMigration.tar
Type: application/x-tar
Size: 10240 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/criu/attachments/20140711/8b8045be/attachment-0001.tar>


More information about the CRIU mailing list