rename xenstore stubdom as Xenstore
PATCH 8/24 rename xenstore stubdom as Xenstore
Attempts to set the name of the xenstore domain. I'm not sure if this is the best place to do so.
TODO: If this patch is kept, the patch xend_var_run_domid should put read_domid in a more global location from the beginning, instead of moving it here.
Signed-off-by Diego Ongaro <[email protected]>
Signed-off-by Alex Zeffertt <[email protected]>
---
tools/python/xen/xend/XendDomainInfo.py +14 -10
@@ -261,6 +261,16 @@ """ from xen.xend import XendDomain return XendDomain.instance().domain_lookup_by_name_nr(name) + +def read_domid(service): + try: + f = open("/var/run/%s.did" % service) + try: + return int(f.read()) + finally: + f.close() + except (IOError, ValueError): + return 0 # assume domain 0 is providing service def shutdown_reason(code):
@@ -433,6 +443,10 @@ self._checkName(self.info['name_label']) self.metrics = XendVMMetrics(uuid.createString(), self) + + if "name_label" in info and info["name_label"] == "Domain-Unnamed" and \ + read_domid("xenstore") == self.domid: + info["name_label"] = "XenStore" #
@@ -2750,16 +2764,6 @@ def _createChannels(self): """Create the channels to the domain. """ - def read_domid(service): - try: - f = open("/var/run/%s.did" % service) - try: - return int(f.read()) - finally: - f.close() - except (IOError, ValueError): - return 0 # assume domain 0 is providing service - self.store_port = self._createChannel(read_domid("xenstore")) self.console_port = self._createChannel(read_domid("console"))
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel