[CRIU] [PATCH 01/12] p.haul: move get_ddxml_path

Nikita Spiridonov nspiridonov at virtuozzo.com
Tue Apr 5 02:39:13 PDT 2016


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

On Fri, 2016-04-01 at 18:45 +0300, Alexander Burluka wrote:
> move get_ddxml_path from class fs_haul_ploop to outstanding function
> 
> Signed-off-by: Alexander Burluka <aburluka at virtuozzo.com>
> ---
>  phaul/fs_haul_ploop.py | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/phaul/fs_haul_ploop.py b/phaul/fs_haul_ploop.py
> index f26eb67..fb6ed0b 100644
> --- a/phaul/fs_haul_ploop.py
> +++ b/phaul/fs_haul_ploop.py
> @@ -12,6 +12,11 @@ import mstats
>  DDXML_FILENAME = "DiskDescriptor.xml"
>  
> 
> +def get_ddxml_path(delta_path):
> +	"""Get path to disk descriptor file by path to disk delta"""
> +	return os.path.join(os.path.dirname(delta_path), DDXML_FILENAME)
> +
> +
>  class p_haul_fs:
>  	def __init__(self, deltas):
>  		"""Initialize ploop disks hauler
> @@ -24,7 +29,7 @@ class p_haul_fs:
>  		self.__log_init_hauler(deltas)
>  		self.__ploop_copies = []
>  		for delta_path, delta_fd in deltas:
> -			ddxml_path = self.__get_ddxml_path(delta_path)
> +			ddxml_path = get_ddxml_path(delta_path)
>  			self.__check_ddxml(ddxml_path)
>  			self.__ploop_copies.append(
>  				libploop.ploopcopy(ddxml_path, delta_fd))
> @@ -62,10 +67,6 @@ class p_haul_fs:
>  		for delta in deltas:
>  			logging.info("\t`- %s", delta[0])
>  
> -	def __get_ddxml_path(self, delta_path):
> -		"""Get path to disk descriptor file by path to disk delta"""
> -		return os.path.join(os.path.dirname(delta_path), DDXML_FILENAME)
> -
>  	def __check_ddxml(self, ddxml_path):
>  		"""Check disk descriptor file exist"""
>  		if not os.path.isfile(ddxml_path):




More information about the CRIU mailing list