All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH 8/24] [xen-unstable.hg] rename xenstore stubdom as Xenstore
Date: Mon, 23 Mar 2009 15:20:54 +0000	[thread overview]
Message-ID: <49C7A8D6.2030603@eu.citrix.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2 bytes --]




[-- Attachment #2: xend_rename_xenstore_domain --]
[-- Type: text/plain, Size: 1956 bytes --]

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 <diego.ongaro@citrix.com>
Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
---

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"))
 



[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2009-03-23 15:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49C7A8D6.2030603@eu.citrix.com \
    --to=alex.zeffertt@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.