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] [xen-unstable] [XEND] Better checking of shutdown of dom

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Better checking of shutdown of domain0.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 28 Jul 2006 21:51:44 +0000
Delivery-date: Fri, 28 Jul 2006 14:55:02 -0700
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 kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 98ee83ed9d286e5ac49e445aa7fe73f224ffa756
# Parent  affe80cdb4857b52a0f7bb1eb36c28977f270eae
[XEND] Better checking of shutdown of domain0.
Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |    2 ++
 tools/python/xen/xm/shutdown.py         |   15 ++++-----------
 2 files changed, 6 insertions(+), 11 deletions(-)

diff -r affe80cdb485 -r 98ee83ed9d28 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Jul 28 17:33:26 2006 +0100
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Jul 28 17:35:39 2006 +0100
@@ -943,6 +943,8 @@ class XendDomainInfo:
     def shutdown(self, reason):
         if not reason in shutdown_reasons.values():
             raise XendError('Invalid reason: %s' % reason)
+        if self.domid == 0:
+            raise XendError("Can't specify Domain-0")
         self.storeDom("control/shutdown", reason)
 
 
diff -r affe80cdb485 -r 98ee83ed9d28 tools/python/xen/xm/shutdown.py
--- a/tools/python/xen/xm/shutdown.py   Fri Jul 28 17:33:26 2006 +0100
+++ b/tools/python/xen/xm/shutdown.py   Fri Jul 28 17:35:39 2006 +0100
@@ -22,8 +22,6 @@ from xen.xend.XendClient import server
 from xen.xend.XendClient import server
 from xen.xend import sxp
 from xen.xm.opts import *
-
-DOM0_ID = '0'
 
 gopts = Opts(use="""[options] [DOM]
 
@@ -51,14 +49,6 @@ gopts.opt('reboot', short='R',
           use='Shutdown and reboot.')
 
 def shutdown(opts, doms, mode, wait):
-    if doms == None: doms = server.xend.domains(0)
-    dom0_name = sxp.child_value(server.xend.domain(0), 'name')
-    for x in [dom0_name, DOM0_ID]:
-        if x in doms:
-            if opts.vals.all:
-                doms.remove(x)
-            else:
-                opts.err("Can't specify Domain-0")
     for d in doms:
         server.xend.domain.shutdown(d, mode)
     if wait:
@@ -86,8 +76,11 @@ def shutdown_mode(opts):
         return 'poweroff'
 
 def main_all(opts, args):
+    doms = server.xend.domains(0)
+    dom0_name = sxp.child_value(server.xend.domain(0), 'name')
+    doms.remove(dom0_name)
     mode = shutdown_mode(opts)  
-    shutdown(opts, None, mode, opts.vals.wait)
+    shutdown(opts, doms, mode, opts.vals.wait)
 
 def main_dom(opts, args):
     if len(args) == 0: opts.err('No domain parameter given')

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEND] Better checking of shutdown of domain0., Xen patchbot-unstable <=