[CRIU] [PATCH v2 07/12] p.haul: add two common fs methods for shared backups

Nikita Spiridonov nspiridonov at virtuozzo.com
Mon Apr 11 08:41:58 PDT 2016


(unresolved comment from previous patchset)

I am not sure about prepare_shared_backups, restore_shared_backups and
cleanup_shared_backups names. Upper level migration logic call this
functions, maybe more generic names needed (something like
rollback_stop_migration, accept_stop_migration etc)? Xemul, what do you
think?

On Sat, 2016-04-09 at 16:41 +0300, Alexander Burluka wrote:
> restore_shared_backups and cleanup_shared_backups
> was added
> 
> Signed-off-by: Alexander Burluka <aburluka at virtuozzo.com>
> ---
>  phaul/fs_haul_ploop.py   | 8 ++++++++
>  phaul/fs_haul_shared.py  | 6 ++++++
>  phaul/fs_haul_subtree.py | 6 ++++++
>  3 files changed, 20 insertions(+)
> 
> diff --git a/phaul/fs_haul_ploop.py b/phaul/fs_haul_ploop.py
> index 6ab2fd0..b79f69c 100644
> --- a/phaul/fs_haul_ploop.py
> +++ b/phaul/fs_haul_ploop.py
> @@ -109,6 +109,14 @@ class p_haul_fs:
>  			total_xferred += ploopcopy.copy_stop()
>  		return mstats.fs_iter_stats(total_xferred)
>  
> +	def restore_shared_backups(self):
> +		for pl in self.__shared_ploops:
> +			pl.restore()
> +
> +	def cleanup_shared_backups(self):
> +		for pl in self.__shared_ploops:
> +			pl.cleanup()
> +
>  	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 77a5a27..28fd322 100644
> --- a/phaul/fs_haul_shared.py
> +++ b/phaul/fs_haul_shared.py
> @@ -24,6 +24,12 @@ class p_haul_fs:
>  	def stop_migration(self):
>  		return None
>  
> +	def restore_shared_backups(self):
> +		pass
> +
> +	def cleanup_shared_backups(self):
> +		pass
> +
>  	# Inode numbers do not change on this FS
>  	# during migration
>  	def persistent_inodes(self):
> diff --git a/phaul/fs_haul_subtree.py b/phaul/fs_haul_subtree.py
> index 7f7e46d..ffb0788 100644
> --- a/phaul/fs_haul_subtree.py
> +++ b/phaul/fs_haul_subtree.py
> @@ -58,3 +58,9 @@ class p_haul_fs:
>  	# When rsync-ing FS inodes number will change
>  	def persistent_inodes(self):
>  		return False
> +
> +	def restore_shared_backups(self):
> +		pass
> +
> +	def cleanup_shared_backups(self):
> +		pass




More information about the CRIU mailing list