ia64/xen-unstable

changeset 6818:a0399927e1a1

Switch shutdown and sysrq to xstransact.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Tue Sep 13 20:54:41 2005 +0000 (2005-09-13)
parents feff6bf0417e
children 3eea03342466
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Sep 13 19:43:58 2005 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Sep 13 20:54:41 2005 +0000
     1.3 @@ -1055,21 +1055,15 @@ class XendDomainInfo:
     1.4      def shutdown(self, reason):
     1.5          if not reason in shutdown_reasons.values():
     1.6              raise XendError('invalid reason:' + reason)
     1.7 -        db = self.db.addChild("/control");
     1.8 -        db['shutdown'] = reason;
     1.9 -        db.saveDB(save=True);
    1.10 +        xstransact.Write(self.path, "control/shutdown", reason)
    1.11          if not reason in ['suspend']:
    1.12              self.shutdown_pending = {'start':time.time(), 'reason':reason}
    1.13  
    1.14      def clear_shutdown(self):
    1.15 -        db = self.db.addChild("/control")
    1.16 -        db['shutdown'] = ""
    1.17 -        db.saveDB(save=True)
    1.18 +        xstransact.Remove(self.path, "control/shutdown")
    1.19  
    1.20      def send_sysrq(self, key=0):
    1.21 -        db = self.db.addChild("/control");
    1.22 -        db['sysrq'] = '%c' % key;
    1.23 -        db.saveDB(save=True);        
    1.24 +        xstransact.Write(self.path, "control/sysrq", '%c' % key)
    1.25  
    1.26      def shutdown_time_left(self, timeout):
    1.27          if not self.shutdown_pending: