[CRIU] Patch for the migration feature to change ip

Pavel Emelyanov xemul at parallels.com
Fri Jul 11 04:09:52 PDT 2014


On 07/11/2014 10:00 AM, 孙亚 wrote:
> 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.

But there can be many sockets, which of them will have the ip changed into 192.168.0.1?

> 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.

Maybe it's just better to close the connection while restoring instead of fixing the ip address?

> 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'''

Git makes this much simpler :) Below is the link on a page describing how to do it.

> 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.

Can you send the patch in the format described at http://criu.org/How_to_submit_patches
Briefly -- the patch should be inline (viewable in the mailer) and with signed-off-by line.

> The attachment is the patch files.
> Thanks
>  
> Ya Sun

Thanks,
Pavel



More information about the CRIU mailing list