ia64/xen-unstable

changeset 6851:05d42f7674e8

Switch most uses of write over to store.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Wed Sep 14 19:53:29 2005 +0000 (2005-09-14)
parents 40e6dfad4eff
children 1a29e0f5c610
files tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Wed Sep 14 19:52:04 2005 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Wed Sep 14 19:53:29 2005 +0000
     1.3 @@ -136,7 +136,6 @@ class XendDomain:
     1.4              try:
     1.5                  domid = int(domdb["domid"].getData())
     1.6              except:
     1.7 -                log.info("fuck off")
     1.8                  domid = None
     1.9              # XXX if domid in self.domains, then something went wrong
    1.10              if (domid is None) or (domid in self.domains):
     2.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Wed Sep 14 19:52:04 2005 +0000
     2.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Wed Sep 14 19:53:29 2005 +0000
     2.3 @@ -263,7 +263,7 @@ class XendDomainInfo:
     2.4          self.device_model_pid = 0
     2.5  
     2.6          self.writeVm("uuid", self.uuid)
     2.7 -        self.writeDom("vm", self.path)
     2.8 +        self.storeDom("vm", self.path)
     2.9  
    2.10      def readVm(self, *args):
    2.11          return xstransact.Read(self.path, *args)
    2.12 @@ -316,47 +316,35 @@ class XendDomainInfo:
    2.13          @param dom: domain id
    2.14          """
    2.15          self.domid = domid
    2.16 -        self.writeDom("domid", "%i" % self.domid)
    2.17 +        self.storeDom("domid", self.domid)
    2.18  
    2.19      def getDomain(self):
    2.20          return self.domid
    2.21  
    2.22      def setName(self, name):
    2.23          self.name = name
    2.24 -        self.writeVm("name", name)
    2.25 +        self.storeVm("name", name)
    2.26  
    2.27      def getName(self):
    2.28          return self.name
    2.29  
    2.30      def setStoreRef(self, ref):
    2.31          self.store_mfn = ref
    2.32 -        if ref:
    2.33 -            self.writeDom("store/ring-ref", "%i" % ref)
    2.34 -        else:
    2.35 -            self.removeDom("store/ring-ref")
    2.36 +        self.storeDom("store/ring-ref", ref)
    2.37  
    2.38      def setStoreChannel(self, channel):
    2.39          if self.store_channel and self.store_channel != channel:
    2.40              self.store_channel.close()
    2.41          self.store_channel = channel
    2.42 -        if channel:
    2.43 -            self.writeDom("store/port", "%i" % channel.port1)
    2.44 -        else:
    2.45 -            self.removeDom("store/port")
    2.46 +        self.storeDom("store/port", channel.port1)
    2.47  
    2.48      def setConsoleRef(self, ref):
    2.49          self.console_mfn = ref
    2.50 -        if ref:
    2.51 -            self.writeDom("console/ring-ref", "%i" % ref)
    2.52 -        else:
    2.53 -            self.removeDom("console/ring-ref")
    2.54 +        self.storeDom("console/ring-ref", ref)
    2.55  
    2.56      def setMemoryTarget(self, target):
    2.57          self.memory_target = target
    2.58 -        if target:
    2.59 -            self.writeDom("memory/target", "%i" % target)
    2.60 -        else:
    2.61 -            self.removeDom("memory/target")
    2.62 +        self.storeDom("memory/target", target)
    2.63  
    2.64      def update(self, info=None):
    2.65          """Update with  info from xc.domain_getinfo().
    2.66 @@ -835,7 +823,7 @@ class XendDomainInfo:
    2.67                  # if anything goes wrong, assume the port was not yet set
    2.68                  pass
    2.69          ret = EventChannel.interdomain(0, self.domid, port1=port, port2=0)
    2.70 -        self.writeDom(path, "%i" % ret.port1)
    2.71 +        self.storeDom(path, ret.port1)
    2.72          return ret
    2.73          
    2.74      def create_channel(self):
    2.75 @@ -1082,12 +1070,12 @@ class XendDomainInfo:
    2.76              availability = "offline"
    2.77          else:
    2.78              availability = "online"
    2.79 -        self.writeVm("cpu/%d/availability" % vcpu, availability)
    2.80 +        self.storeVm("cpu/%d/availability" % vcpu, availability)
    2.81  
    2.82      def shutdown(self, reason):
    2.83          if not reason in shutdown_reasons.values():
    2.84              raise XendError('invalid reason:' + reason)
    2.85 -        self.writeVm("control/shutdown", reason)
    2.86 +        self.storeVm("control/shutdown", reason)
    2.87          if not reason in ['suspend']:
    2.88              self.shutdown_pending = {'start':time.time(), 'reason':reason}
    2.89  
    2.90 @@ -1095,7 +1083,7 @@ class XendDomainInfo:
    2.91          self.removeVm("control/shutdown")
    2.92  
    2.93      def send_sysrq(self, key=0):
    2.94 -        self.writeVm("control/sysrq", '%c' % key)
    2.95 +        self.storeVm("control/sysrq", '%c' % key)
    2.96  
    2.97      def shutdown_time_left(self, timeout):
    2.98          if not self.shutdown_pending: