[CRIU] [PATCH v2 09/12] p.haul: add prepare_src_data function

Nikita Spiridonov nspiridonov at virtuozzo.com
Mon Apr 11 08:20:07 PDT 2016


Acked-by: Nikita Spiridonov <nspiridonov at virtuozzo.com>

On Sat, 2016-04-09 at 16:41 +0300, Alexander Burluka wrote:
> Signed-off-by: Alexander Burluka <aburluka at virtuozzo.com>
> ---
>  phaul/fs_haul_ploop.py   | 9 +++++++++
>  phaul/fs_haul_shared.py  | 3 +++
>  phaul/fs_haul_subtree.py | 3 +++
>  3 files changed, 15 insertions(+)
> 
> diff --git a/phaul/fs_haul_ploop.py b/phaul/fs_haul_ploop.py
> index 12da507..9b4e60e 100644
> --- a/phaul/fs_haul_ploop.py
> +++ b/phaul/fs_haul_ploop.py
> @@ -58,6 +58,8 @@ class shared_ploop:
>  			os.remove(self.__backup_ddxml)
>  			os.remove(self.__backup_ddxml + ".lck")
>  
> +	def get_orig_info(self):
> +		return {"ddxml": self.__orig_ddxml, "guid": self.__orig_guid}
>  
>  class p_haul_fs:
>  	def __init__(self, deltas, ct_priv):
> @@ -122,6 +124,13 @@ class p_haul_fs:
>  		for pl in self.__shared_ploops:
>  			pl.cleanup()
>  
> +	def prepare_src_data(self, data):
> +		if self.__shared_ploops:
> +			data["shareds"] = []
> +			for pl in self.__shared_ploops:
> +				data["shareds"].append(pl.get_orig_info())
> +		return data
> +
>  	def persistent_inodes(self):
>  		"""Inode numbers do not change during ploop disk migration"""
>  		return True
> diff --git a/phaul/fs_haul_shared.py b/phaul/fs_haul_shared.py
> index 28fd322..d925256 100644
> --- a/phaul/fs_haul_shared.py
> +++ b/phaul/fs_haul_shared.py
> @@ -24,6 +24,9 @@ class p_haul_fs:
>  	def stop_migration(self):
>  		return None
>  
> +	def prepare_src_data(self, data):
> +		return data
> +
>  	def restore_shared_backups(self):
>  		pass
>  
> diff --git a/phaul/fs_haul_subtree.py b/phaul/fs_haul_subtree.py
> index ffb0788..2f5a56f 100644
> --- a/phaul/fs_haul_subtree.py
> +++ b/phaul/fs_haul_subtree.py
> @@ -59,6 +59,9 @@ class p_haul_fs:
>  	def persistent_inodes(self):
>  		return False
>  
> +	def prepare_src_data(self, data):
> +		return data
> +
>  	def restore_shared_backups(self):
>  		pass
>  




More information about the CRIU mailing list