WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Reduce the time required to start xm-test domains by all

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Reduce the time required to start xm-test domains by allowing the console
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Nov 2005 21:16:13 +0000
Delivery-date: Tue, 15 Nov 2005 21:17:29 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User danms@xxxxxxxxxx
# Node ID 4bdcb7f8c3d76dcdb7c67e996292fb3b2c8c483f
# Parent  1831da8249ba3aa234f3c36ffcb2ecb121ffbfc0
Reduce the time required to start xm-test domains by allowing the console
to retry connecting to the DomU multiple times.  A polling approach instead
of a wait-and-hope-it-works approach.

diff -r 1831da8249ba -r 4bdcb7f8c3d7 tools/xm-test/lib/XmTestLib/Console.py
--- a/tools/xm-test/lib/XmTestLib/Console.py    Tue Nov 15 14:44:37 2005
+++ b/tools/xm-test/lib/XmTestLib/Console.py    Tue Nov 15 15:07:44 2005
@@ -62,26 +62,37 @@
         self.historySaveCmds  = historySaveCmds
         self.debugMe          = False
         self.limit            = None
+        self.delay            = 2
 
         consoleCmd = ["/usr/sbin/xm", "xm", "console", domain]
 
-        if verbose:
-            print "Console executing: " + str(consoleCmd)
-
-        pid, fd = pty.fork()
-
-        if pid == 0:
-            os.execvp("/usr/sbin/xm", consoleCmd[1:])
-
-        self.consolePid = pid
-        self.consoleFd  = fd
-
-        tty.setraw(self.consoleFd, termios.TCSANOW)
+        start = time.time()
+
+        while (time.time() - start) < self.TIMEOUT:
+            if verbose:
+                print "Console executing: %s" % str(consoleCmd)
+
+            pid, fd = pty.fork()
+
+            if pid == 0:
+                os.execvp("/usr/sbin/xm", consoleCmd[1:])
+
+            self.consolePid = pid
+            self.consoleFd  = fd
+
+            tty.setraw(self.consoleFd, termios.TCSANOW)
             
-        bytes = self.__chewall(self.consoleFd)
-        if bytes < 0:
-            raise ConsoleError("Console didn't respond")
-
+            bytes = self.__chewall(self.consoleFd)
+
+            if bytes > 0:
+                return
+
+            if verbose:
+                print "Console didn't attach, waiting %i sec..." % self.delay
+            time.sleep(self.delay)
+
+        raise ConsoleError("Console didn't respond after %i secs" % 
self.TIMEOUT)
+    
     def __addToHistory(self, line):
         self.historyBuffer.append(line)
         self.historyLines += 1
diff -r 1831da8249ba -r 4bdcb7f8c3d7 tools/xm-test/lib/XmTestLib/XenDomain.py
--- a/tools/xm-test/lib/XmTestLib/XenDomain.py  Tue Nov 15 14:44:37 2005
+++ b/tools/xm-test/lib/XmTestLib/XenDomain.py  Tue Nov 15 15:07:44 2005
@@ -228,7 +228,7 @@
 #            status, output = traceCommand("xm list")
 
         XenDomain.start(self)
-        waitForBoot()
+#        waitForBoot()
 
     def startNow(self):
         XenDomain.start(self)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Reduce the time required to start xm-test domains by allowing the console, Xen patchbot -unstable <=