[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/4] remus: remove old remus script




On Jun 25, 2014 12:34 PM, "Yang Hongyang" <yanghy@xxxxxxxxxxxxxx> wrote:
>
> Since xend already deleted, the old remus script which based on
> xend no longer functional, remove it.
>
> Signed-off-by: Yang Hongyang <yanghy@xxxxxxxxxxxxxx>
> ---
> Âtools/remus/Makefile | Â15 ----
> Âtools/remus/remus  Â| 230 ---------------------------------------------------
> Â2 files changed, 245 deletions(-)
> Âdelete mode 100644 tools/remus/Makefile
> Âdelete mode 100644 tools/remus/remus
>
> diff --git a/tools/remus/Makefile b/tools/remus/Makefile
> deleted file mode 100644
> index ae82376..0000000
> --- a/tools/remus/Makefile
> +++ /dev/null
> @@ -1,15 +0,0 @@
> -XEN_ROOT=$(CURDIR)/../..
> -include $(XEN_ROOT)/tools/Rules.mk
> -
> -SCRIPTS = remus
> -
> -.PHONY: all
> -all: subdirs-all
> -
> -.PHONY: install
> -install: subdirs-install
> - Â Â Â $(INSTALL_DIR) $(DESTDIR)$(BINDIR)
> - Â Â Â $(INSTALL_PYTHON_PROG) $(SCRIPTS) $(DESTDIR)$(BINDIR)
> -
> -.PHONY: clean
> -clean: subdirs-clean
> diff --git a/tools/remus/remus b/tools/remus/remus
> deleted file mode 100644
> index 38f0365..0000000
> --- a/tools/remus/remus
> +++ /dev/null
> @@ -1,230 +0,0 @@
> -#!/usr/bin/env python
> -#
> -# This is a save process which also buffers outgoing I/O between
> -# rounds, so that external viewers never see anything that hasn't
> -# been committed at the backup
> -#
> -# TODO: fencing.
> -
> -import optparse, os, re, select, signal, sys, time
> -
> -from xen.remus import save, util, vm
> -from xen.remus.device import ReplicatedDisk, ReplicatedDiskException
> -from xen.remus.device import BufferedNIC, BufferedNICException
> -from xen.xend import XendOptions
> -
> -class CfgException(Exception): pass
> -
> -class Cfg(object):
> -
> - Â ÂREMUS_FLAGS_COMPRESSION = 1
> -
> - Â Âdef __init__(self):
> - Â Â Â Â# must be set
> - Â Â Â Âself.domid = 0
> -
> - Â Â Â Âself.host = 'localhost'
> - Â Â Â Âself.nullremus = False
> - Â Â Â Âself.port = XendOptions.instance().get_xend_relocation_port()
> - Â Â Â Âself.interval = 200
> - Â Â Â Âself.netbuffer = True
> - Â Â Â Âself.flags = self.REMUS_FLAGS_COMPRESSION
> - Â Â Â Âself.timer = False
> -
> - Â Â Â Âparser = optparse.OptionParser()
> - Â Â Â Âparser.usage = '%prog [options] domain [destination]'
> - Â Â Â Âparser.add_option('-i', '--interval', dest='interval', type='int',
> - Â Â Â Â Â Â Â Â Â Â Â Â Âmetavar='MS',
> - Â Â Â Â Â Â Â Â Â Â Â Â Âhelp='checkpoint every MS milliseconds')
> - Â Â Â Âparser.add_option('-p', '--port', dest='port', type='int',
> - Â Â Â Â Â Â Â Â Â Â Â Â Âhelp='send stream to port PORT', metavar='PORT')
> - Â Â Â Âparser.add_option('', '--blackhole', dest='nullremus', action=""> > - Â Â Â Â Â Â Â Â Â Â Â Â Âhelp='replicate to /dev/null (no disk checkpoints, only memory & net buffering)')
> - Â Â Â Âparser.add_option('', '--no-net', dest='nonet', action=""> > - Â Â Â Â Â Â Â Â Â Â Â Â Âhelp='run without net buffering (benchmark option)')
> - Â Â Â Âparser.add_option('', '--no-compression', dest='nocompress', action=""> > - Â Â Â Â Â Â Â Â Â Â Â Â Âhelp='run without checkpoint compression')
> - Â Â Â Âparser.add_option('', '--timer', dest='timer', action=""> > - Â Â Â Â Â Â Â Â Â Â Â Â Âhelp='force pause at checkpoint interval (experimental)')
> - Â Â Â Âself.parser = parser
> -
> - Â Âdef usage(self):
> - Â Â Â Âself.parser.print_help()
> -
> - Â Âdef getargs(self):
> - Â Â Â Âopts, args = self.parser.parse_args()
> -
> - Â Â Â Âif opts.interval:
> - Â Â Â Â Â Âself.interval = opts.interval
> - Â Â Â Âif opts.port:
> - Â Â Â Â Â Âself.port = opts.port
> - Â Â Â Âif opts.nullremus:
> - Â Â Â Â Â Âself.nullremus = True
> - Â Â Â Âif opts.nonet:
> - Â Â Â Â Â Âself.netbuffer = False
> - Â Â Â Âif opts.nocompress:
> - Â Â Â Â Â Âself.flags &= ~self.REMUS_FLAGS_COMPRESSION
> - Â Â Â Âif opts.timer:
> - Â Â Â Â Â Âself.timer = True
> -
> - Â Â Â Âif not args:
> - Â Â Â Â Â Âraise CfgException('Missing domain')
> - Â Â Â Âself.domid = args[0]
> - Â Â Â Âif (len(args) > 1):
> - Â Â Â Â Â Âself.host = args[1]
> -
> -class SignalException(Exception): pass
> -
> -def run(cfg):
> - Â Âclosure = lambda: None
> - Â Âclosure.cmd = None
> -
> - Â Âdef sigexception(signo, frame):
> - Â Â Â Âraise SignalException(signo)
> -
> - Â Âdef die():
> - Â Â Â Â# I am not sure what the best way to die is. xm destroy is another option,
> - Â Â Â Â# or we could attempt to trigger some instant reboot.
> - Â Â Â Âprint "dying..."
> - Â Â Â Âprint util.runcmd(['sudo', 'ifdown', 'eth2'])
> - Â Â Â Â# dangling imq0 handle on vif locks up the system
> - Â Â Â Âfor buf in bufs:
> - Â Â Â Â Â Âbuf.uninstall()
> - Â Â Â Âprint util.runcmd(['sudo', 'xm', 'destroy', cfg.domid])
> - Â Â Â Âprint util.runcmd(['sudo', 'ifup', 'eth2'])
> -
> - Â Âdef getcommand():
> - Â Â Â Â"""Get a command to execute while running.
> - Â Â Â ÂCommands include:
> - Â Â Â Â Âs: die prior to postsuspend hook
> - Â Â Â Â Âs2: die after postsuspend hook
> - Â Â Â Â Âr: die prior to preresume hook
> - Â Â Â Â Âr2: die after preresume hook
> - Â Â Â Â Âc: die prior to commit hook
> - Â Â Â Â Âc2: die after commit hook
> - Â Â Â Â Â"""
> - Â Â Â Âr, w, x = select.select([sys.stdin], [], [], 0)
> - Â Â Â Âif sys.stdin not in r:
> - Â Â Â Â Â Âreturn
> -
> - Â Â Â Âcmd = sys.stdin.readline().strip()
> - Â Â Â Âif cmd not in ('s', 's2', 'r', 'r2', 'c', 'c2'):
> - Â Â Â Â Â Âprint "unknown command: %s" % cmd
> - Â Â Â Âclosure.cmd = cmd
> -
> - Â Âsignal.signal(signal.SIGTERM, sigexception)
> -
> - Â Âdom = vm.VM(cfg.domid)
> -
> - Â Â# set up I/O buffers
> - Â Âbufs = []
> -
> - Â Â# disks must commit before network can be released
> - Â Âif not cfg.nullremus:
> - Â Â Â Âfor disk in dom.disks:
> - Â Â Â Â Â Âtry:
> - Â Â Â Â Â Â Â Âbufs.append(ReplicatedDisk(disk))
> - Â Â Â Â Â Âexcept ReplicatedDiskException, e:
> - Â Â Â Â Â Â Â Âprint e
> - Â Â Â Â Â Â Â Âcontinue
> -
> - Â Âif cfg.netbuffer:
> - Â Â Â Âfor vif in dom.vifs:
> - Â Â Â Â Â Âbufs.append(BufferedNIC(vif))
> -
> - Â Âif cfg.nullremus:
> - Â Â Â Âfd = save.NullSocket((cfg.host, cfg.port))
> - Â Âelse:
> - Â Â Â Âfd = save.MigrationSocket((cfg.host, cfg.port))
> -
> - Â Âdef postsuspend():
> - Â Â Â Â'Begin external checkpointing after domain has paused'
> - Â Â Â Âif not cfg.timer:
> - Â Â Â Â Â Â# when not using a timer thread, sleep until now + interval
> - Â Â Â Â Â Âclosure.starttime = time.time()
> -
> - Â Â Â Âif closure.cmd == 's':
> - Â Â Â Â Â Âdie()
> -
> - Â Â Â Âfor buf in bufs:
> - Â Â Â Â Â Âbuf.postsuspend()
> -
> - Â Â Â Âif closure.cmd == 's2':
> - Â Â Â Â Â Âdie()
> -
> - Â Âdef preresume():
> - Â Â Â Â'Complete external checkpointing before domain resumes'
> - Â Â Â Âif closure.cmd == 'r':
> - Â Â Â Â Â Âdie()
> -
> - Â Â Â Âfor buf in bufs:
> - Â Â Â Â Â Âbuf.preresume()
> -
> - Â Â Â Âif closure.cmd == 'r2':
> - Â Â Â Â Â Âdie()
> -
> - Â Âdef commit():
> - Â Â Â Â'commit network buffer'
> - Â Â Â Âif closure.cmd == 'c':
> - Â Â Â Â Â Âdie()
> -
> - Â Â Â Âprint >> sys.stderr, "PROF: flushed memory at %0.6f" % (time.time())
> -
> - Â Â Â Âfor buf in bufs:
> - Â Â Â Â Â Âbuf.commit()
> -
> - Â Â Â Âif closure.cmd == 'c2':
> - Â Â Â Â Â Âdie()
> -
> - Â Â Â Â# Since the domain is running at this point, it's a good time to
> - Â Â Â Â# check for control channel commands
> - Â Â Â Âgetcommand()
> -
> - Â Â Â Âif not cfg.timer:
> - Â Â Â Â Â Âendtime = time.time()
> - Â Â Â Â Â Âelapsed = (endtime - closure.starttime) * 1000
> -
> - Â Â Â Â Â Âif elapsed < cfg.interval:
> - Â Â Â Â Â Â Â Âtime.sleep((cfg.interval - elapsed) / 1000.0)
> -
> - Â Â Â Â# False ends checkpointing
> - Â Â Â Âreturn True
> -
> - Â Âif cfg.timer:
> - Â Â Â Âinterval = cfg.interval
> - Â Âelse:
> - Â Â Â Âinterval = 0
> -
> - Â Ârc = 0
> -
> - Â Âcheckpointer = save.Saver(cfg.domid, fd, postsuspend, preresume, commit,
> - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âinterval, cfg.flags)
> -
> - Â Âtry:
> - Â Â Â Âcheckpointer.start()
> - Â Âexcept save.CheckpointError, e:
> - Â Â Â Âprint e
> - Â Â Â Ârc = 1
> - Â Âexcept KeyboardInterrupt:
> - Â Â Â Âpass
> - Â Âexcept SignalException:
> - Â Â Â Âprint '*** signalled ***'
> -
> - Â Âfor buf in bufs:
> - Â Â Â Âbuf.uninstall()
> -
> - Â Âsys.exit(rc)
> -
> -cfg = Cfg()
> -try:
> - Â Âcfg.getargs()
> -except CfgException, inst:
> - Â Âprint str(inst)
> - Â Âcfg.usage()
> - Â Âsys.exit(1)
> -
> -try:
> - Â Ârun(cfg)
> -except vm.VMException, inst:
> - Â Âprint str(inst)
> - Â Âsys.exit(1)
> --
> 1.9.1
>

Acked-by: Shriram Rajagopalan <rshriram@xxxxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.