# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID 05d42f7674e8bed8664fd3af74e34eab825a2d4a
# Parent 40e6dfad4eff688ace19c53d2d63ef0d5656f4b7
Switch most uses of write over to store.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>
diff -r 40e6dfad4eff -r 05d42f7674e8 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py Wed Sep 14 19:52:04 2005
+++ b/tools/python/xen/xend/XendDomain.py Wed Sep 14 19:53:29 2005
@@ -136,7 +136,6 @@
try:
domid = int(domdb["domid"].getData())
except:
- log.info("fuck off")
domid = None
# XXX if domid in self.domains, then something went wrong
if (domid is None) or (domid in self.domains):
diff -r 40e6dfad4eff -r 05d42f7674e8 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py Wed Sep 14 19:52:04 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py Wed Sep 14 19:53:29 2005
@@ -263,7 +263,7 @@
self.device_model_pid = 0
self.writeVm("uuid", self.uuid)
- self.writeDom("vm", self.path)
+ self.storeDom("vm", self.path)
def readVm(self, *args):
return xstransact.Read(self.path, *args)
@@ -316,47 +316,35 @@
@param dom: domain id
"""
self.domid = domid
- self.writeDom("domid", "%i" % self.domid)
+ self.storeDom("domid", self.domid)
def getDomain(self):
return self.domid
def setName(self, name):
self.name = name
- self.writeVm("name", name)
+ self.storeVm("name", name)
def getName(self):
return self.name
def setStoreRef(self, ref):
self.store_mfn = ref
- if ref:
- self.writeDom("store/ring-ref", "%i" % ref)
- else:
- self.removeDom("store/ring-ref")
+ self.storeDom("store/ring-ref", ref)
def setStoreChannel(self, channel):
if self.store_channel and self.store_channel != channel:
self.store_channel.close()
self.store_channel = channel
- if channel:
- self.writeDom("store/port", "%i" % channel.port1)
- else:
- self.removeDom("store/port")
+ self.storeDom("store/port", channel.port1)
def setConsoleRef(self, ref):
self.console_mfn = ref
- if ref:
- self.writeDom("console/ring-ref", "%i" % ref)
- else:
- self.removeDom("console/ring-ref")
+ self.storeDom("console/ring-ref", ref)
def setMemoryTarget(self, target):
self.memory_target = target
- if target:
- self.writeDom("memory/target", "%i" % target)
- else:
- self.removeDom("memory/target")
+ self.storeDom("memory/target", target)
def update(self, info=None):
"""Update with info from xc.domain_getinfo().
@@ -835,7 +823,7 @@
# if anything goes wrong, assume the port was not yet set
pass
ret = EventChannel.interdomain(0, self.domid, port1=port, port2=0)
- self.writeDom(path, "%i" % ret.port1)
+ self.storeDom(path, ret.port1)
return ret
def create_channel(self):
@@ -1082,12 +1070,12 @@
availability = "offline"
else:
availability = "online"
- self.writeVm("cpu/%d/availability" % vcpu, availability)
+ self.storeVm("cpu/%d/availability" % vcpu, availability)
def shutdown(self, reason):
if not reason in shutdown_reasons.values():
raise XendError('invalid reason:' + reason)
- self.writeVm("control/shutdown", reason)
+ self.storeVm("control/shutdown", reason)
if not reason in ['suspend']:
self.shutdown_pending = {'start':time.time(), 'reason':reason}
@@ -1095,7 +1083,7 @@
self.removeVm("control/shutdown")
def send_sysrq(self, key=0):
- self.writeVm("control/sysrq", '%c' % key)
+ self.storeVm("control/sysrq", '%c' % key)
def shutdown_time_left(self, timeout):
if not self.shutdown_pending:
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|