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/
Home Products Support Community News


[Xen-changelog] [xen-unstable] xm reboot: Fix wait option of xm reboot c

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xm reboot: Fix wait option of xm reboot command
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 07 Feb 2008 11:00:38 -0800
Delivery-date: Thu, 07 Feb 2008 11:00:46 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1202376466 0
# Node ID d04593aa1605fd337423b2c1296e275424e06656
# Parent  45b2e7d59e3a1895e903cbb7939e79c2f1f351d6
xm reboot: Fix wait option of xm reboot command

When I rebooted a domain by xm reboot command with wait option,
I saw the following message.  But, rebooting the domain succeeded.
 Domain vm1 destroyed for failed in rebooting

The cause why the message was shown is the domain is destroyed
temporarily by processing of xm reboot command.  The domain
information is not gotten from Xend by server.xend.domains()
function till recreating the domain is completed.
This patch fixes processing of xm reboot command in Xm side.
It waits just a bit till recreating the domain is completed,
then it measures the success or failure of the reboot of the

Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
 tools/python/xen/xm/shutdown.py |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff -r 45b2e7d59e3a -r d04593aa1605 tools/python/xen/xm/shutdown.py
--- a/tools/python/xen/xm/shutdown.py   Thu Feb 07 09:21:19 2008 +0000
+++ b/tools/python/xen/xm/shutdown.py   Thu Feb 07 09:27:46 2008 +0000
@@ -23,6 +23,8 @@ from opts import *
 from opts import *
 from main import server, serverType, SERVER_XEN_API, get_single_vm
 from xen.xend.XendAPIConstants import *
 gopts = Opts(use="""[options] [DOM]
@@ -53,6 +55,7 @@ def wait_reboot(opts, doms, rcs):
     if serverType == SERVER_XEN_API:
         opts.err("Cannot wait for reboot w/ XenAPI (yet)")
+    recreating = {}
     while doms:
         alive = server.xend.domains(0)
         reboot = []
@@ -61,9 +64,17 @@ def wait_reboot(opts, doms, rcs):
                 rc = server.xend.domain.getRestartCount(d)
                 if rc == rcs[d]: continue
+            # Probably the domain is being recreated now.
+            # We have to wait just a bit for recreating the domain.
+            elif not recreating.has_key(d):
+                recreating[d] = 0
-                opts.info("Domain %s destroyed for failed in rebooting" % d)
-                doms.remove(d)
+                recreating[d] += 1
+                if recreating[d] > RECREATING_TIMEOUT:
+                    opts.info("Domain %s destroyed for failing to reboot" % d)
+                    doms.remove(d)
         for d in reboot:
             opts.info("Domain %s rebooted" % d)

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xm reboot: Fix wait option of xm reboot command, Xen patchbot-unstable <=