All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Hongyang <yanghy@cn.fujitsu.com>
To: xen-devel@lists.xen.org
Cc: rshriram@cs.ubc.ca, Yang Hongyang <yanghy@cn.fujitsu.com>,
	ian.jackson@eu.citrix.com
Subject: [PATCH v2 1/4] remus: remove old remus script
Date: Wed, 25 Jun 2014 15:26:12 +0800	[thread overview]
Message-ID: <1403681175-27305-1-git-send-email-yanghy@cn.fujitsu.com> (raw)

Since xend already deleted, the old remus script which based on
xend no longer functional, remove it.

Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
Acked-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
---
 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='store_true',
-                          help='replicate to /dev/null (no disk checkpoints, only memory & net buffering)')
-        parser.add_option('', '--no-net', dest='nonet', action='store_true',
-                          help='run without net buffering (benchmark option)')
-        parser.add_option('', '--no-compression', dest='nocompress', action='store_true',
-                          help='run without checkpoint compression')
-        parser.add_option('', '--timer', dest='timer', action='store_true',
-                          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

             reply	other threads:[~2014-06-25  7:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-25  7:26 Yang Hongyang [this message]
2014-06-25  7:26 ` [PATCH v2 2/4] remus: move remus README to docs directory Yang Hongyang
2014-06-30 12:41   ` Shriram Rajagopalan
2014-06-30 17:06   ` Ian Jackson
2014-06-25  7:26 ` [PATCH v2 3/4] remus: add wikipage link to remus README Yang Hongyang
2014-06-25  7:38   ` Shriram Rajagopalan
2014-06-25  7:26 ` [PATCH v2 4/4] MAINTAINERS: Update maintained files of REMUS part Yang Hongyang
2014-06-30 12:39   ` Shriram Rajagopalan
2014-06-26  7:57 ` [PATCH v2 1/4] remus: remove old remus script Hongyang Yang
2014-06-30  4:30 ` Hongyang Yang
2014-07-03 10:03 ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1403681175-27305-1-git-send-email-yanghy@cn.fujitsu.com \
    --to=yanghy@cn.fujitsu.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=rshriram@cs.ubc.ca \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.