[CRIU] [PATCH 1/3] p.haul: add --dst-id option

Nikita Spiridonov nspiridonov at virtuozzo.com
Mon Apr 18 09:38:48 PDT 2016


On Mon, 2016-04-18 at 20:02 +0300, Pavel Emelyanov wrote:
> On 04/15/2016 04:12 PM, Nikita Spiridonov wrote:
> > Add --dst-id option needed to handle migration with id change.
> > 
> > Signed-off-by: Nikita Spiridonov <nspiridonov at virtuozzo.com>
> > ---
> >  phaul/args_parser.py |    1 +
> >  phaul/p_haul_vz.py   |    1 -
> >  2 files changed, 1 insertions(+), 1 deletions(-)
> > 
> > diff --git a/phaul/args_parser.py b/phaul/args_parser.py
> > index 165ef60..f6945f8 100644
> > --- a/phaul/args_parser.py
> > +++ b/phaul/args_parser.py
> > @@ -25,6 +25,7 @@ def parse_client_args():
> >  	parser.add_argument("--fdfs", help="Module specific definition of fs channel")
> >  	parser.add_argument("--mode", choices=iters.MIGRATION_MODES,
> >  		default=iters.MIGRATION_MODE_LIVE, help="Mode of migration")
> > +	parser.add_argument("--dst-id", help="ID at destination")
> >  	parser.add_argument("-v", default=criu_api.def_verb, type=int, dest="verbose", help="Verbosity level")
> >  	parser.add_argument("--keep-images", default=False, action='store_true', help="Keep images after migration")
> >  	parser.add_argument("--dst-rpid", default=None, help="Write pidfile on restore")
> > diff --git a/phaul/p_haul_vz.py b/phaul/p_haul_vz.py
> > index b867477..c1d28d0 100644
> > --- a/phaul/p_haul_vz.py
> > +++ b/phaul/p_haul_vz.py
> > @@ -301,7 +301,6 @@ class p_haul_type:
> >  
> >  def add_hauler_args(parser):
> >  	"""Add Virtuozzo specific command line arguments"""
> > -	parser.add_argument("--vz-dst-ctid", help="ctid at destination")
> 
> So why is --dst-id better than --vz-dst-ctid?

--vz-dst-ctid option is Virtuozzo-specific (conventionally) and --dst-id
is global. --vz-dst-ctid option was introduced previosly for future
reference and was unimplemented until now.

Then I realize that it is hard to implement this "--vz-dst-ctid" option
as module specific since it is hard to encapsulate such functionality
into single module and it is better to handle such option in generic
code (iters.py/service.py).

So I rename it to "--dst-id" and make it global.

> 
> >  	parser.add_argument("--vz-shared-disks", help="List of shared storage disks")
> >  
> >  
> > 
> 




More information about the CRIU mailing list