WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Rename XendDomainInfo and DevController.getDomain to get

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Rename XendDomainInfo and DevController.getDomain to getDomid.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Sep 2005 17:16:10 +0000
Delivery-date: Thu, 22 Sep 2005 17:14:40 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@ewan
# Node ID 40a0f049e344e7704d24c669e65d07dc87c6efc8
# Parent  f5e33f4d0238cfee9e0b759fe959706b21f179d1
Rename XendDomainInfo and DevController.getDomain to getDomid.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r f5e33f4d0238 -r 40a0f049e344 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Thu Sep 22 16:52:07 2005
+++ b/tools/python/xen/xend/XendDomain.py       Thu Sep 22 16:58:43 2005
@@ -179,13 +179,13 @@
         @param info:   domain info object
         @param notify: send a domain created event if true
         """
-        if info.getDomain() in self.domains:
+        if info.getDomid() in self.domains:
             notify = False
-        self.domains[info.getDomain()] = info
+        self.domains[info.getDomid()] = info
         info.exportToDB(save=True)
         if notify:
             eserver.inject('xend.domain.create', [info.getName(),
-                                                  info.getDomain()])
+                                                  info.getDomid()])
 
     def _delete_domain(self, id, notify=True):
         """Remove a domain from the tables.
@@ -200,7 +200,7 @@
             info.delete()
             if notify:
                 eserver.inject('xend.domain.died', [info.getName(),
-                                                    info.getDomain()])
+                                                    info.getDomid()])
         # XXX this should not be needed
         for domdb in self.dbmap.values():
             if not domdb.has_key("xend"):
@@ -246,11 +246,11 @@
         # Remove entries for domains that no longer exist.
         # Update entries for existing domains.
         for d in self.domains.values():
-            info = doms.get(d.getDomain())
+            info = doms.get(d.getDomid())
             if info:
                 d.update(info)
             elif not d.restart_pending():
-                self._delete_domain(d.getDomain())
+                self._delete_domain(d.getDomid())
 
     def update_domain(self, id):
         """Update information for a single domain.
@@ -281,22 +281,22 @@
         @param dominfo: domain object
         """
         log.info("Restarting domain: name=%s id=%s", dominfo.getName(),
-                 dominfo.getDomain())
+                 dominfo.getDomid())
         eserver.inject("xend.domain.restart",
-                       [dominfo.getName(), dominfo.getDomain(), "begin"])
+                       [dominfo.getName(), dominfo.getDomid(), "begin"])
         try:
             dominfo.restart()
             log.info('Restarted domain name=%s id=%s', dominfo.getName(),
-                     dominfo.getDomain())
+                     dominfo.getDomid())
             eserver.inject("xend.domain.restart",
-                           [dominfo.getName(), dominfo.getDomain(),
+                           [dominfo.getName(), dominfo.getDomid(),
                             "success"])
-            self.domain_unpause(dominfo.getDomain())
+            self.domain_unpause(dominfo.getDomid())
         except Exception, ex:
             log.exception("Exception restarting domain: name=%s id=%s",
-                          dominfo.getName(), dominfo.getDomain())
+                          dominfo.getName(), dominfo.getDomid())
             eserver.inject("xend.domain.restart",
-                           [dominfo.getName(), dominfo.getDomain(), "fail"])
+                           [dominfo.getName(), dominfo.getDomid(), "fail"])
         return dominfo
 
     def domain_configure(self, config):
@@ -386,9 +386,9 @@
         """
         dominfo = self.domain_lookup(id)
         eserver.inject('xend.domain.unpause', [dominfo.getName(),
-                                               dominfo.getDomain()])
-        try:
-            return xc.domain_unpause(dom=dominfo.getDomain())
+                                               dominfo.getDomid()])
+        try:
+            return xc.domain_unpause(dom=dominfo.getDomid())
         except Exception, ex:
             raise XendError(str(ex))
     
@@ -399,9 +399,9 @@
         """
         dominfo = self.domain_lookup(id)
         eserver.inject('xend.domain.pause', [dominfo.getName(),
-                                             dominfo.getDomain()])
-        try:
-            return xc.domain_pause(dom=dominfo.getDomain())
+                                             dominfo.getDomid()])
+        try:
+            return xc.domain_pause(dom=dominfo.getDomid())
         except Exception, ex:
             raise XendError(str(ex))
     
@@ -417,9 +417,9 @@
         @param reason: shutdown type: poweroff, reboot, suspend, halt
         """
         dominfo = self.domain_lookup(id)
-        self.domain_restart_schedule(dominfo.getDomain(), reason, force=True)
+        self.domain_restart_schedule(dominfo.getDomid(), reason, force=True)
         eserver.inject('xend.domain.shutdown', [dominfo.getName(),
-                                                dominfo.getDomain(), reason])
+                                                dominfo.getDomid(), reason])
         if reason == 'halt':
             reason = 'poweroff'
         val = dominfo.shutdown(reason)
@@ -443,7 +443,7 @@
             if not dominfo.shutdown_pending:
                 # domain doesn't need shutdown
                 continue
-            id = dominfo.getDomain()
+            id = dominfo.getDomid()
             left = dominfo.shutdown_time_left(SHUTDOWN_TIMEOUT)
             if left <= 0:
                 # Shutdown expired - destroy domain.
@@ -474,16 +474,16 @@
         restart = (force and reason == 'reboot') or 
dominfo.restart_needed(reason)
         if restart:
             log.info('Scheduling restart for domain: name=%s id=%s',
-                     dominfo.getName(), dominfo.getDomain())
+                     dominfo.getName(), dominfo.getDomid())
             eserver.inject("xend.domain.restart",
-                           [dominfo.getName(), dominfo.getDomain(),
+                           [dominfo.getName(), dominfo.getDomid(),
                             "schedule"])
             dominfo.restarting()
         else:
             log.info('Cancelling restart for domain: name=%s id=%s',
-                     dominfo.getName(), dominfo.getDomain())
+                     dominfo.getName(), dominfo.getDomid())
             eserver.inject("xend.domain.restart",
-                           [dominfo.getName(), dominfo.getDomain(), "cancel"])
+                           [dominfo.getName(), dominfo.getDomid(), "cancel"])
             dominfo.restart_cancel()
 
     def domain_restarts(self):
@@ -493,7 +493,7 @@
         for dominfo in self.domains.values():
             if not dominfo.restart_pending():
                 continue
-            info = doms.get(dominfo.getDomain())
+            info = doms.get(dominfo.getDomid())
             if info:
                 # Don't execute restart for domains still running.
                 continue
@@ -578,7 +578,7 @@
         """
         dominfo = self.domain_lookup(id)
         try:
-            return xc.domain_pincpu(dominfo.getDomain(), vcpu, cpumap)
+            return xc.domain_pincpu(dominfo.getDomid(), vcpu, cpumap)
         except Exception, ex:
             raise XendError(str(ex))
 
@@ -587,7 +587,7 @@
         """
         dominfo = self.domain_lookup(id)
         try:
-            return xc.bvtsched_domain_set(dom=dominfo.getDomain(),
+            return xc.bvtsched_domain_set(dom=dominfo.getDomid(),
                                           mcuadv=mcuadv,
                                           warpback=warpback,
                                           warpvalue=warpvalue, 
@@ -600,7 +600,7 @@
         """
         dominfo = self.domain_lookup(id)
         try:
-            return xc.bvtsched_domain_get(dominfo.getDomain())
+            return xc.bvtsched_domain_get(dominfo.getDomid())
         except Exception, ex:
             raise XendError(str(ex))
     
@@ -610,7 +610,7 @@
         """
         dominfo = self.domain_lookup(id)
         try:
-            return xc.sedf_domain_set(dominfo.getDomain(), period, slice,
+            return xc.sedf_domain_set(dominfo.getDomid(), period, slice,
                                       latency, extratime, weight)
         except Exception, ex:
             raise XendError(str(ex))
@@ -620,7 +620,7 @@
         """
         dominfo = self.domain_lookup(id)
         try:
-            return xc.sedf_domain_get(dominfo.getDomain())
+            return xc.sedf_domain_get(dominfo.getDomid())
         except Exception, ex:
             raise XendError(str(ex))
 
@@ -709,7 +709,7 @@
         """
         dominfo = self.domain_lookup(id)
         try:
-            return xc.shadow_control(dominfo.getDomain(), op)
+            return xc.shadow_control(dominfo.getDomid(), op)
         except Exception, ex:
             raise XendError(str(ex))
 
@@ -723,7 +723,7 @@
         dominfo = self.domain_lookup(id)
         maxmem = int(mem) * 1024
         try:
-            return xc.domain_setmaxmem(dominfo.getDomain(),
+            return xc.domain_setmaxmem(dominfo.getDomid(),
                                        maxmem_kb = maxmem)
         except Exception, ex:
             raise XendError(str(ex))
@@ -757,12 +757,12 @@
         """
         dominfo = self.domain_lookup(id)
         corefile = "/var/xen/dump/%s.%s.core" % (dominfo.getName(),
-                                                 dominfo.getDomain())
-        try:
-            xc.domain_dumpcore(dom=dominfo.getDomain(), corefile=corefile)
+                                                 dominfo.getDomid())
+        try:
+            xc.domain_dumpcore(dom=dominfo.getDomid(), corefile=corefile)
         except Exception, ex:
             log.warning("Dumpcore failed, id=%s name=%s: %s",
-                        dominfo.getDomain(), dominfo.getName(), ex)
+                        dominfo.getDomid(), dominfo.getName(), ex)
         
 def instance():
     """Singleton constructor. Use this instead of the class constructor.
diff -r f5e33f4d0238 -r 40a0f049e344 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Thu Sep 22 16:52:07 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Thu Sep 22 16:58:43 2005
@@ -474,7 +474,7 @@
         self.domid = domid
         self.storeDom("domid", self.domid)
 
-    def getDomain(self):
+    def getDomid(self):
         return self.domid
 
     def setName(self, name):
diff -r f5e33f4d0238 -r 40a0f049e344 tools/python/xen/xend/image.py
--- a/tools/python/xen/xend/image.py    Thu Sep 22 16:52:07 2005
+++ b/tools/python/xen/xend/image.py    Thu Sep 22 16:58:43 2005
@@ -161,14 +161,14 @@
             raise VmError('Kernel ramdisk does not exist: %s' % self.ramdisk)
         if len(self.cmdline) >= MAX_GUEST_CMDLINE:
             log.warning('kernel cmdline too long, domain %d',
-                        self.vm.getDomain())
+                        self.vm.getDomid())
         
         log.info("buildDomain os=%s dom=%d vcpus=%d", self.ostype,
-                 self.vm.getDomain(), self.vm.getVCpuCount())
+                 self.vm.getDomid(), self.vm.getVCpuCount())
         err = self.buildDomain()
         if err != 0:
             raise VmError('Building domain failed: ostype=%s dom=%d err=%d'
-                          % (self.ostype, self.vm.getDomain(), err))
+                          % (self.ostype, self.vm.getDomid(), err))
 
     def getDomainMemory(self, mem):
         """@return The memory required, in KiB, by the domain to store the
@@ -210,7 +210,7 @@
         else:
             console_evtchn = 0
 
-        log.debug("dom            = %d", self.vm.getDomain())
+        log.debug("dom            = %d", self.vm.getDomid())
         log.debug("image          = %s", self.kernel)
         log.debug("store_evtchn   = %d", store_evtchn)
         log.debug("console_evtchn = %d", console_evtchn)
@@ -219,7 +219,7 @@
         log.debug("flags          = %d", self.flags)
         log.debug("vcpus          = %d", self.vm.getVCpuCount())
 
-        ret = xc.linux_build(dom            = self.vm.getDomain(),
+        ret = xc.linux_build(dom            = self.vm.getDomid(),
                              image          = self.kernel,
                              store_evtchn   = store_evtchn,
                              console_evtchn = console_evtchn,
@@ -266,14 +266,14 @@
 
     def buildDomain(self):
         # Create an event channel
-        self.device_channel = channel.eventChannel(0, self.vm.getDomain())
+        self.device_channel = channel.eventChannel(0, self.vm.getDomid())
         log.info("VMX device model port: %d", self.device_channel.port2)
         if self.vm.store_channel:
             store_evtchn = self.vm.store_channel.port2
         else:
             store_evtchn = 0
 
-        log.debug("dom            = %d", self.vm.getDomain())
+        log.debug("dom            = %d", self.vm.getDomid())
         log.debug("image          = %s", self.kernel)
         log.debug("control_evtchn = %d", self.device_channel.port2)
         log.debug("store_evtchn   = %d", store_evtchn)
@@ -284,7 +284,7 @@
         log.debug("flags          = %d", self.flags)
         log.debug("vcpus          = %d", self.vm.getVCpuCount())
 
-        ret = xc.vmx_build(dom            = self.vm.getDomain(),
+        ret = xc.vmx_build(dom            = self.vm.getDomid(),
                            image          = self.kernel,
                            control_evtchn = self.device_channel.port2,
                            store_evtchn   = store_evtchn,
@@ -370,7 +370,7 @@
         elif vnc:
             ret = ret + ['-vnc', '-k', 'en-us']
         if vnc:
-            vncport = int(self.vm.getDomain()) + 5900
+            vncport = int(self.vm.getDomid()) + 5900
             ret = ret + ['-vncport', '%d' % vncport]
         return ret
 
@@ -384,7 +384,7 @@
         vnc = self.vncParams()
         if len(vnc):
             args = args + vnc
-        args = args + ([ "-d",  "%d" % self.vm.getDomain(),
+        args = args + ([ "-d",  "%d" % self.vm.getDomid(),
                   "-p", "%d" % self.device_channel.port1,
                   "-m", "%s" % (self.vm.getMemoryTarget() / 1024)])
         args = args + self.dmargs
diff -r f5e33f4d0238 -r 40a0f049e344 
tools/python/xen/xend/server/DevController.py
--- a/tools/python/xen/xend/server/DevController.py     Thu Sep 22 16:52:07 2005
+++ b/tools/python/xen/xend/server/DevController.py     Thu Sep 22 16:58:43 2005
@@ -84,7 +84,7 @@
     def sxpr(self, devid):
         """@return an s-expression describing the specified device.
         """
-        return [self.deviceClass, ['dom', self.vm.getDomain(),
+        return [self.deviceClass, ['dom', self.vm.getDomid(),
                                    'id', devid]]
 
 
@@ -110,11 +110,11 @@
         raise NotImplementedError()
 
 
-    def getDomain(self):
-        """Stub to {@link XendDomainInfo.getDomain}, for use by our
+    def getDomid(self):
+        """Stub to {@link XendDomainInfo.getDomid}, for use by our
         subclasses.
         """
-        return self.vm.getDomain()
+        return self.vm.getDomid()
 
 
     def allocateDeviceID(self):
@@ -167,14 +167,14 @@
         
         frontDetails.update({
             'backend' : backpath,
-            'backend-id' : "%i" % backdom.getDomain()
+            'backend-id' : "%i" % backdom.getDomid()
             })
 
 
         backDetails.update({
             'domain' : self.vm.getName(),
             'frontend' : frontpath,
-            'frontend-id' : "%i" % self.vm.getDomain()
+            'frontend-id' : "%i" % self.vm.getDomid()
             })
 
         log.debug('DevController: writing %s to %s.', str(frontDetails),
diff -r f5e33f4d0238 -r 40a0f049e344 tools/python/xen/xend/server/pciif.py
--- a/tools/python/xen/xend/server/pciif.py     Thu Sep 22 16:52:07 2005
+++ b/tools/python/xen/xend/server/pciif.py     Thu Sep 22 16:58:43 2005
@@ -68,7 +68,7 @@
         dev  = get_param('dev')
         func = get_param('func')
 
-        rc = xc.physdev_pci_access_modify(dom    = self.getDomain(),
+        rc = xc.physdev_pci_access_modify(dom    = self.getDomid(),
                                           bus    = bus,
                                           dev    = dev,
                                           func   = func,

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Rename XendDomainInfo and DevController.getDomain to getDomid., Xen patchbot -unstable <=