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] Move id back into main domain dir and rename to domid.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Move id back into main domain dir and rename to domid.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Sep 2005 15:48:12 +0000
Delivery-date: Wed, 14 Sep 2005 15:46:44 +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 cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID 5cbb2ecce16a15b4625f31b661edb64669ba2a5b
# Parent  e2f0a6fdb7d9a8dd3b9920266460a48fc132c74a
Move id back into main domain dir and rename to domid.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r e2f0a6fdb7d9 -r 5cbb2ecce16a tools/python/xen/xend/XendCheckpoint.py
--- a/tools/python/xen/xend/XendCheckpoint.py   Wed Sep 14 14:43:34 2005
+++ b/tools/python/xen/xend/XendCheckpoint.py   Wed Sep 14 15:10:22 2005
@@ -49,7 +49,7 @@
     # simply uses the defaults compiled into libxenguest; see the comments 
     # and/or code in xc_linux_save() for more information. 
     cmd = [PATH_XC_SAVE, str(xc.handle()), str(fd),
-           str(dominfo.id), "0", "0", str(int(live)) ]
+           str(dominfo.domid), "0", "0", str(int(live)) ]
     log.info("[xc_save] " + join(cmd))
     child = xPopen3(cmd, True, -1, [fd, xc.handle()])
     
@@ -69,10 +69,10 @@
             if fd == child.fromchild.fileno():
                 l = child.fromchild.readline()
                 if l.rstrip() == "suspend":
-                    log.info("suspending %d" % dominfo.id)
-                    xd.domain_shutdown(dominfo.id, reason='suspend')
+                    log.info("suspending %d" % dominfo.domid)
+                    xd.domain_shutdown(dominfo.domid, reason='suspend')
                     dominfo.state_wait("suspended")
-                    log.info("suspend %d done" % dominfo.id)
+                    log.info("suspend %d done" % dominfo.domid)
                     child.tochild.write("done\n")
                     child.tochild.flush()
         if filter(lambda (fd, event): event & select.POLLHUP, r):
@@ -84,7 +84,7 @@
         raise XendError("xc_save failed: %s" % lasterr)
 
     dominfo.setStoreChannel(None)
-    xd.domain_destroy(dominfo.id)
+    xd.domain_destroy(dominfo.domid)
     return None
 
 def restore(xd, fd):
@@ -126,7 +126,7 @@
         console_evtchn = 0
 
     cmd = [PATH_XC_RESTORE, str(xc.handle()), str(fd),
-           str(dominfo.id), str(nr_pfns),
+           str(dominfo.domid), str(nr_pfns),
            str(store_evtchn), str(console_evtchn)]
     log.info("[xc_restore] " + join(cmd))
     child = xPopen3(cmd, True, -1, [fd, xc.handle()])
@@ -154,7 +154,7 @@
                         if dominfo.store_channel:
                             dominfo.setStoreRef(int(m.group(2)))
                             if dominfo.store_mfn >= 0:
-                                IntroduceDomain(dominfo.id,
+                                IntroduceDomain(dominfo.domid,
                                                 dominfo.store_mfn,
                                                 dominfo.store_channel.port1,
                                                 dominfo.path)
diff -r e2f0a6fdb7d9 -r 5cbb2ecce16a tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Wed Sep 14 14:43:34 2005
+++ b/tools/python/xen/xend/XendDomain.py       Wed Sep 14 15:10:22 2005
@@ -134,15 +134,17 @@
                 continue
             db = domdb.addChild("xend")
             try:
-                domid = int(db.id)
+                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):
                 domdb.delete()
             elif domid in doms:
                 try:
-                    self._new_domain(domdb["uuid"].getData(), db, doms[domid]) 
+                    self._new_domain(domdb["uuid"].getData(), domid, db,
+                                     doms[domid]) 
                 except Exception, ex:
                     log.exception("Error recreating domain info: id=%d", domid)
                     self._delete_domain(domid)
@@ -158,15 +160,15 @@
     def close(self):
         pass
 
-    def _new_domain(self, uuid, db, info):
+    def _new_domain(self, uuid, domid, db, info):
         """Create a domain entry from saved info.
 
         @param db:   saved info from the db
         @param info: domain info from xen
         @return: domain
         """
-        dominfo = XendDomainInfo.recreate(uuid, db, info)
-        self.domains[dominfo.id] = dominfo
+        dominfo = XendDomainInfo.recreate(uuid, domid, db, info)
+        self.domains[dominfo.domid] = dominfo
         return dominfo
 
     def _add_domain(self, info, notify=True):
@@ -177,15 +179,15 @@
         """
         # Remove entries under the wrong id.
         for i, d in self.domains.items():
-            if i != d.id:
+            if i != d.domid:
                 del self.domains[i]
                 self.dbmap.delete(d.uuid)
-        if info.id in self.domains:
+        if info.domid in self.domains:
             notify = False
-        self.domains[info.id] = info
+        self.domains[info.domid] = info
         info.exportToDB(save=True)
         if notify:
-            eserver.inject('xend.domain.create', [info.name, info.id])
+            eserver.inject('xend.domain.create', [info.name, info.domid])
 
     def _delete_domain(self, id, notify=True):
         """Remove a domain from the tables.
@@ -204,14 +206,14 @@
             info.cleanup()
             info.delete()
             if notify:
-                eserver.inject('xend.domain.died', [info.name, info.id])
+                eserver.inject('xend.domain.died', [info.name, info.domid])
         # XXX this should not be needed
         for domdb in self.dbmap.values():
             if not domdb.has_key("xend"):
                 continue
             db = domdb.addChild("xend")
             try:
-                domid = int(db.id)
+                domid = int(domdb["domid"].getData())
             except:
                 domid = None
             if (domid is None) or (domid == id):
@@ -267,13 +269,13 @@
         # Update entries for existing domains.
         do_domain_restarts = False
         for d in self.domains.values():
-            info = doms.get(d.id)
+            info = doms.get(d.domid)
             if info:
                 d.update(info)
             elif d.restart_pending():
                 do_domain_restarts = True
             else:
-                self._delete_domain(d.id)
+                self._delete_domain(d.domid)
         if cleanup and do_domain_restarts:
             scheduler.now(self.domain_restarts)
 
@@ -304,20 +306,20 @@
 
         @param dominfo: domain object
         """
-        log.info("Restarting domain: name=%s id=%s", dominfo.name, dominfo.id)
+        log.info("Restarting domain: name=%s id=%s", dominfo.name, 
dominfo.domid)
         eserver.inject("xend.domain.restart",
-                       [dominfo.name, dominfo.id, "begin"])
+                       [dominfo.name, dominfo.domid, "begin"])
         try:
             dominfo.restart()
-            log.info('Restarted domain name=%s id=%s', dominfo.name, 
dominfo.id)
+            log.info('Restarted domain name=%s id=%s', dominfo.name, 
dominfo.domid)
             eserver.inject("xend.domain.restart",
-                           [dominfo.name, dominfo.id, "success"])
-            self.domain_unpause(dominfo.id)
+                           [dominfo.name, dominfo.domid, "success"])
+            self.domain_unpause(dominfo.domid)
         except Exception, ex:
             log.exception("Exception restarting domain: name=%s id=%s",
-                          dominfo.name, dominfo.id)
+                          dominfo.name, dominfo.domid)
             eserver.inject("xend.domain.restart",
-                           [dominfo.name, dominfo.id, "fail"])
+                           [dominfo.name, dominfo.domid, "fail"])
         return dominfo
 
     def domain_configure(self, vmconfig):
@@ -362,11 +364,11 @@
                     "Creating entry for unknown domain: id=%d uuid=%s",
                     id, uuid)
                 db = self.dbmap.addChild("%s/xend" % uuid)
-                dominfo = XendDomainInfo.recreate(uuid, db, info)
-                dominfo.setdom(id)
+                dominfo = XendDomainInfo.recreate(uuid, id, db, info)
                 self._add_domain(dominfo)
                 return dominfo
         except Exception, ex:
+            raise
             log.exception("Error creating domain info: id=%d", id)
         return None
         
@@ -389,9 +391,9 @@
         @param id: domain id
         """
         dominfo = self.domain_lookup(id)
-        eserver.inject('xend.domain.unpause', [dominfo.name, dominfo.id])
-        try:
-            return xc.domain_unpause(dom=dominfo.id)
+        eserver.inject('xend.domain.unpause', [dominfo.name, dominfo.domid])
+        try:
+            return xc.domain_unpause(dom=dominfo.domid)
         except Exception, ex:
             raise XendError(str(ex))
     
@@ -401,9 +403,9 @@
         @param id: domain id
         """
         dominfo = self.domain_lookup(id)
-        eserver.inject('xend.domain.pause', [dominfo.name, dominfo.id])
-        try:
-            return xc.domain_pause(dom=dominfo.id)
+        eserver.inject('xend.domain.pause', [dominfo.name, dominfo.domid])
+        try:
+            return xc.domain_pause(dom=dominfo.domid)
         except Exception, ex:
             raise XendError(str(ex))
     
@@ -419,8 +421,8 @@
         @param reason: shutdown type: poweroff, reboot, suspend, halt
         """
         dominfo = self.domain_lookup(id)
-        self.domain_restart_schedule(dominfo.id, reason, force=True)
-        eserver.inject('xend.domain.shutdown', [dominfo.name, dominfo.id, 
reason])
+        self.domain_restart_schedule(dominfo.domid, reason, force=True)
+        eserver.inject('xend.domain.shutdown', [dominfo.name, dominfo.domid, 
reason])
         if reason == 'halt':
             reason = 'poweroff'
         val = dominfo.shutdown(reason)
@@ -444,7 +446,7 @@
             if not dominfo.shutdown_pending:
                 # domain doesn't need shutdown
                 continue
-            id = dominfo.id
+            id = dominfo.domid
             left = dominfo.shutdown_time_left(SHUTDOWN_TIMEOUT)
             if left <= 0:
                 # Shutdown expired - destroy domain.
@@ -475,15 +477,15 @@
         restart = (force and reason == 'reboot') or 
dominfo.restart_needed(reason)
         if restart:
             log.info('Scheduling restart for domain: name=%s id=%s',
-                     dominfo.name, dominfo.id)
+                     dominfo.name, dominfo.domid)
             eserver.inject("xend.domain.restart",
-                           [dominfo.name, dominfo.id, "schedule"])
+                           [dominfo.name, dominfo.domid, "schedule"])
             dominfo.restarting()
         else:
             log.info('Cancelling restart for domain: name=%s id=%s',
-                     dominfo.name, dominfo.id)
+                     dominfo.name, dominfo.domid)
             eserver.inject("xend.domain.restart",
-                           [dominfo.name, dominfo.id, "cancel"])
+                           [dominfo.name, dominfo.domid, "cancel"])
             dominfo.restart_cancel()
 
     def domain_restarts(self):
@@ -493,8 +495,8 @@
         for dominfo in self.domains.values():
             if not dominfo.restart_pending():
                 continue
-            print 'domain_restarts>', dominfo.name, dominfo.id
-            info = doms.get(dominfo.id)
+            print 'domain_restarts>', dominfo.name, dominfo.domid
+            info = doms.get(dominfo.domid)
             if info:
                 # Don't execute restart for domains still running.
                 print 'domain_restarts> still runnning: ', dominfo.name
@@ -511,7 +513,7 @@
         try:
             dominfo = self.domain_lookup(id)
             log.info('Destroying domain: name=%s', dominfo.name)
-            eserver.inject('xend.domain.destroy', [dominfo.name, dominfo.id])
+            eserver.inject('xend.domain.destroy', [dominfo.name, 
dominfo.domid])
             val = dominfo.destroy()
         except:
             #todo
@@ -586,7 +588,7 @@
         """
         dominfo = self.domain_lookup(id)
         try:
-            return xc.domain_pincpu(dominfo.id, vcpu, cpumap)
+            return xc.domain_pincpu(dominfo.domid, vcpu, cpumap)
         except Exception, ex:
             raise XendError(str(ex))
 
@@ -595,7 +597,7 @@
         """
         dominfo = self.domain_lookup(id)
         try:
-            return xc.bvtsched_domain_set(dom=dominfo.id, mcuadv=mcuadv,
+            return xc.bvtsched_domain_set(dom=dominfo.domid, mcuadv=mcuadv,
                                           warpback=warpback, 
warpvalue=warpvalue, 
                                           warpl=warpl, warpu=warpu)
         except Exception, ex:
@@ -606,7 +608,7 @@
         """
         dominfo = self.domain_lookup(id)
         try:
-            return xc.bvtsched_domain_get(dominfo.id)
+            return xc.bvtsched_domain_get(dominfo.domid)
         except Exception, ex:
             raise XendError(str(ex))
     
@@ -616,7 +618,7 @@
         """
         dominfo = self.domain_lookup(id)
         try:
-            return xc.sedf_domain_set(dominfo.id, period, slice, latency, 
extratime, weight)
+            return xc.sedf_domain_set(dominfo.domid, period, slice, latency, 
extratime, weight)
         except Exception, ex:
             raise XendError(str(ex))
 
@@ -625,7 +627,7 @@
         """
         dominfo = self.domain_lookup(id)
         try:
-            return xc.sedf_domain_get(dominfo.id)
+            return xc.sedf_domain_get(dominfo.domid)
         except Exception, ex:
             raise XendError(str(ex))
 
@@ -715,7 +717,7 @@
         """
         dominfo = self.domain_lookup(id)
         try:
-            return xc.shadow_control(dominfo.id, op)
+            return xc.shadow_control(dominfo.domid, op)
         except Exception, ex:
             raise XendError(str(ex))
 
@@ -729,7 +731,7 @@
         dominfo = self.domain_lookup(id)
         maxmem = int(mem) * 1024
         try:
-            return xc.domain_setmaxmem(dominfo.id, maxmem_kb = maxmem)
+            return xc.domain_setmaxmem(dominfo.domid, maxmem_kb = maxmem)
         except Exception, ex:
             raise XendError(str(ex))
 
@@ -761,12 +763,12 @@
         @param id: domain
         """
         dominfo = self.domain_lookup(id)
-        corefile = "/var/xen/dump/%s.%s.core"% (dominfo.name, dominfo.id)
-        try:
-            xc.domain_dumpcore(dom=dominfo.id, corefile=corefile)
+        corefile = "/var/xen/dump/%s.%s.core"% (dominfo.name, dominfo.domid)
+        try:
+            xc.domain_dumpcore(dom=dominfo.domid, corefile=corefile)
         except Exception, ex:
             log.warning("Dumpcore failed, id=%s name=%s: %s",
-                        dominfo.id, dominfo.name, ex)
+                        dominfo.domid, dominfo.name, ex)
         
 def instance():
     """Singleton constructor. Use this instead of the class constructor.
diff -r e2f0a6fdb7d9 -r 5cbb2ecce16a tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Wed Sep 14 14:43:34 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed Sep 14 15:10:22 2005
@@ -140,16 +140,15 @@
 
     create = classmethod(create)
 
-    def recreate(cls, uuid, db, info):
+    def recreate(cls, uuid, domid, db, info):
         """Create the VM object for an existing domain.
 
         @param db:        domain db
         @param info:      domain info from xc
         """
-        dom = info['dom']
         path = "/".join(db.getPath().split("/")[0:-2])
         vm = cls(uuid, path, db)
-        vm.setdom(dom)
+        vm.setDomid(domid)
         try:
             db.readDB()
         except: pass
@@ -168,7 +167,7 @@
             finally:
                 vm.recreate = False
         else:
-            vm.setName("Domain-%d" % dom)
+            vm.setName("Domain-%d" % domid)
 
         vm.exportToDB(save=True)
         return vm
@@ -190,7 +189,7 @@
         ssidref = int(sxp.child_value(config, 'ssidref'))
         log.debug('restoring with ssidref='+str(ssidref))
         id = xc.domain_create(ssidref = ssidref)
-        vm.setdom(id)
+        vm.setDomid(id)
         vm.clear_shutdown()
         try:
             vm.restore = True
@@ -203,7 +202,6 @@
     restore = classmethod(restore)
 
     __exports__ = [
-        DBVar('id',            ty='int'),
         DBVar('name',          ty='str'),
         DBVar('config',        ty='sxpr'),
         DBVar('start_time',    ty='float'),
@@ -225,7 +223,7 @@
         self.restore = 0
         
         self.config = None
-        self.id = None
+        self.domid = None
         self.cpu_weight = 1
         self.start_time = None
         self.name = None
@@ -281,16 +279,16 @@
         self.db.importFromDB(self, fields=self.__exports__)
         self.store_channel = self.eventChannel("store/port")
 
-    def setdom(self, dom):
+    def setDomid(self, domid):
         """Set the domain id.
 
         @param dom: domain id
         """
-        self.id = int(dom)
-        #self.db.id = self.id
+        self.domid = domid
+        xstransact.Write(self.path, "domid", "%i" % self.domid)
 
     def getDomain(self):
-        return self.id
+        return self.domid
 
     def setName(self, name):
         self.name = name
@@ -332,7 +330,7 @@
     def update(self, info=None):
         """Update with  info from xc.domain_getinfo().
         """
-        self.info = info or dom_get(self.id)
+        self.info = info or dom_get(self.domid)
         self.memory = self.info['mem_kb'] / 1024
         self.ssidref = self.info['ssidref']
 
@@ -352,7 +350,7 @@
 
     def __str__(self):
         s = "<domain"
-        s += " id=" + str(self.id)
+        s += " id=" + str(self.domid)
         s += " name=" + self.name
         s += " memory=" + str(self.memory)
         s += " ssidref=" + str(self.ssidref)
@@ -393,7 +391,7 @@
             frontpath = "%s/device/%s/%d" % (self.path, type, devnum)
 
             front = { 'backend' : backpath,
-                      'backend-id' : "%i" % backdom.id,
+                      'backend-id' : "%i" % backdom.domid,
                       'virtual-device' : "%i" % devnum }
             xstransact.Write(frontpath, front)
 
@@ -402,7 +400,7 @@
             back = { 'type' : type,
                      'params' : params,
                      'frontend' : frontpath,
-                     'frontend-id' : "%i" % self.id }
+                     'frontend-id' : "%i" % self.domid }
             xstransact.Write(backpath, back)
 
             return
@@ -435,7 +433,7 @@
             frontpath = "%s/device/%s/%d" % (self.path, type, devnum)
 
             front = { 'backend' : backpath,
-                      'backend-id' : "%i" % backdom.id,
+                      'backend-id' : "%i" % backdom.domid,
                       'handle' : "%i" % devnum,
                       'mac' : mac }
             xstransact.Write(frontpath, front)
@@ -445,7 +443,7 @@
                      'mac' : mac,
                      'bridge' : bridge,
                      'frontend' : frontpath,
-                     'frontend-id' : "%i" % self.id,
+                     'frontend-id' : "%i" % self.domid,
                      'handle' : "%i" % devnum }
             if ipaddr:
                 back['ip'] = ' '.join(ipaddr)
@@ -464,13 +462,13 @@
             frontpath = "%s/device/%s/%d" % (self.path, type, devnum)
 
             front = { 'backend' : backpath,
-                      'backend-id' : "%i" % backdom.id,
+                      'backend-id' : "%i" % backdom.domid,
                       'handle' : "%i" % devnum }
             xstransact.Write(frontpath, front)
 
             back = { 'instance' : "%i" % devnum,
                      'frontend' : frontpath,
-                     'frontend-id' : "%i" % self.id }
+                     'frontend-id' : "%i" % self.domid }
             xstransact.Write(backpath, back)
 
             return
@@ -505,7 +503,7 @@
 
     def sxpr(self):
         sxpr = ['domain',
-                ['id', self.id],
+                ['domid', self.domid],
                 ['name', self.name],
                 ['memory', self.memory],
                 ['ssidref', self.ssidref],
@@ -602,7 +600,7 @@
             return
         if dominfo.is_terminated():
             return
-        if not self.id or (dominfo.id != self.id):
+        if not self.domid or (dominfo.domid != self.domid):
             raise VmError('vm name clash: ' + name)
         
     def construct(self, config):
@@ -653,8 +651,8 @@
         self.setMemoryTarget(self.memory * (1 << 20))
         self.ssidref = int(sxp.child_value(config, 'ssidref'))
         cpu = sxp.child_value(config, 'cpu')
-        if self.recreate and self.id and cpu is not None and int(cpu) >= 0:
-            xc.domain_pincpu(self.id, 0, 1<<int(cpu))
+        if self.recreate and self.domid and cpu is not None and int(cpu) >= 0:
+            xc.domain_pincpu(self.domid, 0, 1<<int(cpu))
         try:
             image = sxp.child_value(self.config, 'image')
             vcpus = sxp.child_value(image, 'vcpus')
@@ -684,17 +682,17 @@
         self.image.createImage()
         self.exportToDB()
         if self.store_channel and self.store_mfn >= 0:
-            IntroduceDomain(self.id, self.store_mfn, self.store_channel.port1,
-                            self.path)
+            IntroduceDomain(self.domid, self.store_mfn,
+                            self.store_channel.port1, self.path)
         # get the configured value of vcpus and update store
         self.configure_vcpus(self.vcpus)
 
     def delete(self):
         """Delete the vm's db.
         """
-        if dom_get(self.id):
+        if dom_get(self.domid):
             return
-        self.id = None
+        self.domid = None
         self.saveToDB(sync=True)
         try:
             # Todo: eventually will have to wait for devices to signal
@@ -710,10 +708,10 @@
         The domain will not finally go away unless all vm
         devices have been released.
         """
-        if self.id is None:
+        if self.domid is None:
             return
         try:
-            xc.domain_destroy(dom=self.id)
+            xc.domain_destroy(dom=self.domid)
         except Exception, err:
             log.exception("Domain destroy failed: %s", self.name)
 
@@ -771,7 +769,7 @@
     def show(self):
         """Print virtual machine info.
         """
-        print "[VM dom=%d name=%s memory=%d ssidref=%d" % (self.id, self.name, 
self.memory, self.ssidref)
+        print "[VM dom=%d name=%s memory=%d ssidref=%d" % (self.domid, 
self.name, self.memory, self.ssidref)
         print "image:"
         sxp.show(self.image)
         print "]"
@@ -787,10 +785,10 @@
             cpu = int(sxp.child_value(self.config, 'cpu', '-1'))
         except:
             raise VmError('invalid cpu')
-        id = self.image.initDomain(self.id, self.memory, self.ssidref, cpu, 
self.cpu_weight)
+        id = self.image.initDomain(self.domid, self.memory, self.ssidref, cpu, 
self.cpu_weight)
         log.debug('init_domain> Created domain=%d name=%s memory=%d',
                   id, self.name, self.memory)
-        self.setdom(id)
+        self.setDomid(id)
 
     def eventChannel(self, path=None):
         """Create an event channel to the domain.
@@ -804,7 +802,7 @@
             except:
                 # if anything goes wrong, assume the port was not yet set
                 pass
-        ret = EventChannel.interdomain(0, self.id, port1=port, port2=0)
+        ret = EventChannel.interdomain(0, self.domid, port1=port, port2=0)
         xstransact.Write(self.path, path, "%i" % ret.port1)
         return ret
         
@@ -1081,7 +1079,7 @@
         if ref and ref >= 0:
             self.setStoreRef(ref)
             try:
-                IntroduceDomain(self.id, ref, self.store_channel.port1,
+                IntroduceDomain(self.domid, ref, self.store_channel.port1,
                                 self.path)
             except RuntimeError, ex:
                 if ex.args[0] == errno.EISCONN:
@@ -1089,7 +1087,7 @@
                 else:
                     raise
             # get run-time value of vcpus and update store
-            self.configure_vcpus(dom_get(self.id)['vcpus'])
+            self.configure_vcpus(dom_get(self.domid)['vcpus'])
 
 
 def vm_field_ignore(_, _1, _2, _3):
@@ -1110,7 +1108,7 @@
         maxmem = int(maxmem)
     except:
         raise VmError("invalid maxmem: " + str(maxmem))
-    xc.domain_setmaxmem(vm.id, maxmem_kb = maxmem * 1024)
+    xc.domain_setmaxmem(vm.domid, maxmem_kb = maxmem * 1024)
 
 
 #============================================================================
diff -r e2f0a6fdb7d9 -r 5cbb2ecce16a tools/python/xen/xend/server/SrvDomain.py
--- a/tools/python/xen/xend/server/SrvDomain.py Wed Sep 14 14:43:34 2005
+++ b/tools/python/xen/xend/server/SrvDomain.py Wed Sep 14 15:10:22 2005
@@ -41,21 +41,21 @@
         fn = FormFn(self.xd.domain_configure,
                     [['dom',    'int'],
                      ['config', 'sxpr']])
-        return fn(req.args, {'dom': self.dom.id})
+        return fn(req.args, {'dom': self.dom.domid})
 
     def op_unpause(self, op, req):
-        val = self.xd.domain_unpause(self.dom.id)
+        val = self.xd.domain_unpause(self.dom.domid)
         return val
         
     def op_pause(self, op, req):
-        val = self.xd.domain_pause(self.dom.id)
+        val = self.xd.domain_pause(self.dom.domid)
         return val
 
     def op_shutdown(self, op, req):
         fn = FormFn(self.xd.domain_shutdown,
                     [['dom',    'int'],
                      ['reason', 'str']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         req.setResponseCode(http.ACCEPTED)
         req.setHeader("Location", "%s/.." % req.prePathURL())
         return val
@@ -64,7 +64,7 @@
         fn = FormFn(self.xd.domain_sysrq,
                     [['dom',    'int'],
                      ['key',    'int']])
-        val = fn(req.args, {'dom' : self.dom.id})
+        val = fn(req.args, {'dom' : self.dom.domid})
         req.setResponseCode(http.ACCEPTED)
         req.setHeader("Location", "%s/.." % req.prePathURL())
         return val
@@ -73,7 +73,7 @@
         fn = FormFn(self.xd.domain_destroy,
                     [['dom',    'int'],
                      ['reason', 'str']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         req.setHeader("Location", "%s/.." % req.prePathURL())
         return val
 
@@ -84,7 +84,7 @@
         fn = FormFn(self.xd.domain_save,
                     [['dom',  'int'],
                      ['file', 'str']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         return 0
 
     def op_migrate(self, op, req):
@@ -96,14 +96,14 @@
                      ['destination', 'str'],
                      ['live',        'int'],
                      ['resource',    'int']])
-        return fn(req.args, {'dom': self.dom.id})
+        return fn(req.args, {'dom': self.dom.domid})
 
     def op_pincpu(self, op, req):
         fn = FormFn(self.xd.domain_pincpu,
                     [['dom', 'int'],
                      ['vcpu', 'int'],
                      ['cpumap', 'int']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         return val
 
     def op_cpu_bvt_set(self, op, req):
@@ -114,7 +114,7 @@
                      ['warpvalue', 'int'],
                      ['warpl',     'long'],
                      ['warpu',     'long']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         return val
     
     
@@ -126,28 +126,28 @@
                     ['latency', 'int'],
                     ['extratime', 'int'],
                     ['weight', 'int']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         return val
 
     def op_maxmem_set(self, op, req):
         fn = FormFn(self.xd.domain_maxmem_set,
                     [['dom',    'int'],
                      ['memory', 'int']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         return val
     
     def op_mem_target_set(self, op, req):
         fn = FormFn(self.xd.domain_mem_target_set,
                     [['dom',    'int'],
                      ['target', 'int']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         return val
 
     def op_devices(self, op, req):
         fn = FormFn(self.xd.domain_devtype_ls,
                     [['dom',    'int'],
                      ['type',   'str']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         return val
 
     def op_device(self, op, req):
@@ -155,7 +155,7 @@
                     [['dom',    'int'],
                      ['type',   'str'],
                      ['idx',    'int']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         if val:
             return val.sxpr()
         else:
@@ -165,7 +165,7 @@
         fn = FormFn(self.xd.domain_device_create,
                     [['dom',    'int'],
                      ['config', 'sxpr']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         return val
 
     def op_device_refresh(self, op, req):
@@ -173,7 +173,7 @@
                     [['dom',  'int'],
                      ['type', 'str'],
                      ['idx',  'str']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         return val
 
     def op_device_destroy(self, op, req):
@@ -181,7 +181,7 @@
                     [['dom',  'int'],
                      ['type', 'str'],
                      ['idx',  'str']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         return val
                 
     def op_device_configure(self, op, req):
@@ -189,7 +189,7 @@
                     [['dom',    'int'],
                      ['config', 'sxpr'],
                      ['idx',    'str']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         return val
 
     def op_vif_limit_set(self, op, req):
@@ -198,7 +198,7 @@
                      ['vif',    'int'],
                      ['credit', 'int'],
                      ['period', 'int']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         return val
 
     def op_vcpu_hotplug(self, op, req):
@@ -206,7 +206,7 @@
                     [['dom', 'int'],
                      ['vcpu', 'int'],
                      ['state', 'int']])
-        val = fn(req.args, {'dom': self.dom.id})
+        val = fn(req.args, {'dom': self.dom.domid})
         return val
 
     def render_POST(self, req):
diff -r e2f0a6fdb7d9 -r 5cbb2ecce16a 
tools/python/xen/xend/server/SrvDomainDir.py
--- a/tools/python/xen/xend/server/SrvDomainDir.py      Wed Sep 14 14:43:34 2005
+++ b/tools/python/xen/xend/server/SrvDomainDir.py      Wed Sep 14 15:10:22 2005
@@ -154,7 +154,7 @@
             for d in domains:
                req.write('<li><a href="%s%s"> Domain %s</a>'
                          % (url, d.name, d.name))
-               req.write('id=%s' % d.id)
+               req.write('id=%s' % d.domid)
                req.write('memory=%d'% d.memory)
                req.write('ssidref=%d'% d.ssidref)
                req.write('</li>')
diff -r e2f0a6fdb7d9 -r 5cbb2ecce16a tools/python/xen/xend/server/blkif.py
--- a/tools/python/xen/xend/server/blkif.py     Wed Sep 14 14:43:34 2005
+++ b/tools/python/xen/xend/server/blkif.py     Wed Sep 14 15:10:22 2005
@@ -123,7 +123,7 @@
     def init(self, recreate=False, reboot=False):
         self.frontendDomain = self.getDomain()
         backend = self.getBackend()
-        self.backendId = backend.id
+        self.backendId = backend.domid
 
     def configure(self, config, change=False, recreate=False):
         if change:
@@ -146,7 +146,7 @@
         
         try:
             xd = get_component('xen.xend.XendDomain')
-            self.backendDomain = 
xd.domain_lookup_by_name(sxp.child_value(config, 'backend', '0')).id
+            self.backendDomain = 
xd.domain_lookup_by_name(sxp.child_value(config, 'backend', '0')).domid
         except:
             raise XendError('invalid backend domain')
 
diff -r e2f0a6fdb7d9 -r 5cbb2ecce16a tools/python/xen/xend/server/netif.py
--- a/tools/python/xen/xend/server/netif.py     Wed Sep 14 14:43:34 2005
+++ b/tools/python/xen/xend/server/netif.py     Wed Sep 14 15:10:22 2005
@@ -180,7 +180,7 @@
             else:
                 #todo: Code below will fail on xend restart when backend is 
not domain 0.
                 xd = get_component('xen.xend.XendDomain')
-                self.backendDomain = 
xd.domain_lookup_by_name(sxp.child_value(config, 'backend', '0')).id
+                self.backendDomain = 
xd.domain_lookup_by_name(sxp.child_value(config, 'backend', '0')).domid
         except:
             raise XendError('invalid backend domain')
         return self.config
@@ -206,7 +206,7 @@
         mtu = self._get_config_mtu(config)
         
         xd = get_component('xen.xend.XendDomain')
-        backendDomain = xd.domain_lookup_by_name(sxp.child_value(config, 
'backend', '0')).id
+        backendDomain = xd.domain_lookup_by_name(sxp.child_value(config, 
'backend', '0')).domid
 
         if (mac is not None) and (mac != self.mac):
             raise XendError("cannot change mac")
diff -r e2f0a6fdb7d9 -r 5cbb2ecce16a tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Wed Sep 14 14:43:34 2005
+++ b/tools/python/xen/xm/create.py     Wed Sep 14 15:10:22 2005
@@ -750,7 +750,7 @@
             server.xend_domain_destroy(dom)
             opts.err("Failed to unpause domain %s" % dom)
     opts.info("Started domain %s" % (dom))
-    return int(sxp.child_value(dominfo, 'id'))
+    return int(sxp.child_value(dominfo, 'domid'))
 
 def get_dom0_alloc():
     """Return current allocation memory of dom0 (in MB). Return 0 on error"""
diff -r e2f0a6fdb7d9 -r 5cbb2ecce16a tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Wed Sep 14 14:43:34 2005
+++ b/tools/python/xen/xm/main.py       Wed Sep 14 15:10:22 2005
@@ -192,9 +192,9 @@
     from xen.xend.XendClient import server
     info = server.xend_domain_restore(savefile)
     PrettyPrint.prettyprint(info)
-    id = sxp.child_value(info, 'id')
+    id = sxp.child_value(info, 'domid')
     if id is not None:
-        server.xend_domain_unpause(id)
+        server.xend_domain_unpause(domid)
 
 def xm_migrate(args):
     # TODO: arg_check
@@ -242,7 +242,7 @@
 
 def parse_doms_info(info):
     dominfo = {}
-    dominfo['dom'] = int(sxp.child_value(info, 'id', '-1'))
+    dominfo['dom'] = int(sxp.child_value(info, 'domid', '-1'))
     dominfo['name'] = sxp.child_value(info, 'name', '??')
     dominfo['mem'] = int(sxp.child_value(info, 'memory', '0'))
     dominfo['cpu'] = str(sxp.child_value(info, 'cpu', '0'))
@@ -265,7 +265,7 @@
     for cpu in vcpu_to_cpu:
         vcpuinfo = {}
         vcpuinfo['name']   = sxp.child_value(info, 'name', '??')
-        vcpuinfo['dom']    = int(sxp.child_value(info, 'id', '-1'))
+        vcpuinfo['dom']    = int(sxp.child_value(info, 'domid', '-1'))
         vcpuinfo['vcpu']   = int(count)
         vcpuinfo['cpu']    = int(cpu)
         vcpuinfo['cpumap'] = int(cpumap[count])&mask
@@ -395,7 +395,7 @@
     
     from xen.xend.XendClient import server
     dom = server.xend_domain(name)
-    id = sxp.child_value(dom, 'id')
+    id = sxp.child_value(dom, 'domid')
     server.xend_domain_vcpu_hotplug(id, vcpu, 1)
 
 def xm_vcpu_disable(args):
@@ -406,7 +406,7 @@
     
     from xen.xend.XendClient import server
     dom = server.xend_domain(name)
-    id = sxp.child_value(dom, 'id')
+    id = sxp.child_value(dom, 'domid')
     server.xend_domain_vcpu_hotplug(id, vcpu, 0)
 
 def xm_domid(args):
@@ -414,7 +414,7 @@
 
     from xen.xend.XendClient import server
     dom = server.xend_domain(name)
-    print sxp.child_value(dom, 'id')
+    print sxp.child_value(dom, 'domid')
     
 def xm_domname(args):
     name = args[0]
@@ -462,7 +462,7 @@
     dom = args[0]
     from xen.xend.XendClient import server
     info = server.xend_domain(dom)
-    domid = int(sxp.child_value(info, 'id', '-1'))
+    domid = int(sxp.child_value(info, 'domid', '-1'))
     cmd = "/usr/libexec/xen/xenconsole %d" % domid
     os.execvp('/usr/libexec/xen/xenconsole', cmd.split())
     console = sxp.child(info, "console")

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Move id back into main domain dir and rename to domid., Xen patchbot -unstable <=