[CRIU] [PATCH 07/12] p.haul: add two common fs methods for shared backups
Nikita Spiridonov
nspiridonov at virtuozzo.com
Tue Apr 5 03:21:58 PDT 2016
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 Fri, 2016-04-01 at 18:45 +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 | 10 ++++++++++
> phaul/fs_haul_shared.py | 6 ++++++
> phaul/fs_haul_subtree.py | 6 ++++++
> 3 files changed, 22 insertions(+)
>
> diff --git a/phaul/fs_haul_ploop.py b/phaul/fs_haul_ploop.py
> index f59f831..f95086c 100644
> --- a/phaul/fs_haul_ploop.py
> +++ b/phaul/fs_haul_ploop.py
> @@ -112,6 +112,16 @@ class p_haul_fs:
> total_xferred += ploopcopy.copy_stop()
> return mstats.fs_iter_stats(total_xferred)
>
> + def restore_shared_backups(self):
> + if iters.is_live_mode(self.__mode):
Please remove mode check (iters.is_live_mode) from
restore_shared_backups and cleanup_shared_backups functions, it is
excess (was mentioned in comments to previous patches).
> + for pl in self.__shared_ploops:
> + pl.restore()
> +
> + def cleanup_shared_backups(self):
> + if iters.is_live_mode(self.__mode):
> + 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