[lxc-devel] [PATCH 1/2] c/r: refactor the way we pass data to criu/scripts

Serge Hallyn serge.hallyn at ubuntu.com
Thu Oct 16 20:53:03 UTC 2014


Quoting Tycho Andersen (tycho.andersen at canonical.com):
> We previously wrote a bunch of files (eth*, veth*, and bridge*) as hard coded
> files which we used as the names of interfaces to restore via criu's
> --veth-pair. This meant that if people, e.g. gave a different bridge on their
> new host, we would use our saved bridge in bridge* and try to restore to the
> wrong bridge. Instead, we can just generate a new veth id (if the user hasn't
> provided one), and use whatever the user configured values for the interface
> name and bridge are.
> 
> This allows people to switch the bridge that they restore onto simply by
> migrating the rootfs and config, and then changing the bridge name in the
> container's configuration before running lxc-checkpoint.
> 
> Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>

Mostly looks good, but two things.

Should we be concerned about API version .vs. criu?  I'm not sure how
we can coordinate it (maybe a 'criu --get-apiversion' before we do an
actual checkpoint/restore), and I'm not sure it's worth doing so as
persumably serious api changes will stop when we get at all stable...
but I'm not certain.

> ---
>  src/lxc/lxc-restore-net |  16 +++---
>  src/lxc/lxccontainer.c  | 126 +++++++++++++++++++++++-------------------------
>  2 files changed, 68 insertions(+), 74 deletions(-)
> 

...

> @@ -3874,6 +3866,11 @@ static bool lxcapi_restore(struct lxc_container *c, char *directory, bool verbos
>  		goto out_fini_handler;
>  	}
>  
> +	if (!restore_net_info(c)) {
> +		ERROR("failed restoring network info");
> +		goto out_fini_handler;
> +	}
> +
>  	pid = fork();
>  	if (pid < 0)
>  		goto out_fini_handler;
> @@ -3944,11 +3941,6 @@ static bool lxcapi_restore(struct lxc_container *c, char *directory, bool verbos
>  					goto out_fini_handler;
>  				}
>  
> -				if (!restore_net_info(c, directory)) {
> -					ERROR("failed restoring network info");

I'm confused here.  This doesn't show up in the git HEAD src/lxc/lxccontainer.c.

> -					goto out_fini_handler;
> -				}
> -
>  				if (lxc_set_state(c->name, handler, RUNNING))
>  					goto out_fini_handler;
>  			}
> -- 
> 1.9.1
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


More information about the lxc-devel mailing list