From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Zeffertt Subject: [PATCH 8/24] [xen-unstable.hg] rename xenstore stubdom as Xenstore Date: Mon, 23 Mar 2009 15:20:54 +0000 Message-ID: <49C7A8D6.2030603@eu.citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060806020407020801060404" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------060806020407020801060404 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit --------------060806020407020801060404 Content-Type: text/plain; name="xend_rename_xenstore_domain" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xend_rename_xenstore_domain" 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 Signed-off-by: Alex Zeffertt --- diff -r b14e95d65bb6 tools/python/xen/xend/XendDomainInfo.py --- a/tools/python/xen/xend/XendDomainInfo.py Wed Mar 18 10:59:59 2009 +0000 +++ b/tools/python/xen/xend/XendDomainInfo.py Wed Mar 18 11:03:08 2009 +0000 @@ -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")) --------------060806020407020801060404 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------060806020407020801060404--