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] Make vif cleanup use xstransact and use classmethods for

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Make vif cleanup use xstransact and use classmethods for setup.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 09 Sep 2005 17:42:13 +0000
Delivery-date: Fri, 09 Sep 2005 17:40:56 +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 31c257b9a36025fba57dcd3d0a5fe707785cbd70
# Parent  1a27091a1e7a5d6b73bf6bbf2d687fc6acc21412
Make vif cleanup use xstransact and use classmethods for setup.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 1a27091a1e7a -r 31c257b9a360 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Sep  9 17:34:40 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Sep  9 17:36:39 2005
@@ -457,24 +457,22 @@
                                                 self.uuid, devnum)
             frontpath = "%s/device/%s/%d" % (self.path, type, devnum)
 
-            frontt = xstransact(frontpath)
-            frontt.write('backend', backpath)
-            frontt.write('backend-id', "%i" % backdom.id)
-            frontt.write('handle', "%i" % devnum)
-            frontt.write('mac', mac)
-            frontt.commit()
-
-            backt = xstransact(backpath)
-            backt.write('script', script)
-            backt.write('domain', self.name)
-            backt.write('mac', mac)
-            backt.write('bridge', bridge)
+            front = { 'backend' : backpath,
+                      'backend-id' : "%i" % backdom.id,
+                      'handle' : "%i" % devnum,
+                      'mac' : mac }
+            xstransact.Write(frontpath, front)
+
+            back = { 'script' : script,
+                     'domain' : self.name,
+                     'mac' : mac,
+                     'bridge' : bridge,
+                     'frontend' : frontpath,
+                     'frontend-id' : "%i" % self.id,
+                     'handle' : "%i" % devnum }
             if ipaddr:
-                backt.write('ip', ' '.join(ipaddr))
-            backt.write('frontend', frontpath)
-            backt.write('frontend-id', "%i" % self.id)
-            backt.write('handle', "%i" % devnum)
-            backt.commit()
+                back['ip'] = ' '.join(ipaddr)
+            xstransact.Write(backpath, back)
 
             return
         
@@ -801,6 +799,10 @@
         for ctrl in self.getDeviceControllers():
             if ctrl.isDestroyed(): continue
             ctrl.destroyController(reboot=reboot)
+        t = xstransact("%s/device" % self.path)
+        for d in t.list("vif"):
+            t.remove(d)
+        t.commit()
         ddb = self.db.addChild("/device")
         for type in ddb.keys():
             if type == 'vbd':
@@ -809,11 +811,6 @@
                     devdb = typedb.addChild(str(dev))
                     Blkctl.block('unbind', devdb['type'].getData(),
                                  devdb['node'].getData())
-                    typedb[dev].delete()
-                typedb.saveDB(save=True)
-            if type == 'vif':
-                typedb = ddb.addChild(type)
-                for dev in typedb.keys():
                     typedb[dev].delete()
                 typedb.saveDB(save=True)
             if type == 'vtpm':

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Make vif cleanup use xstransact and use classmethods for setup., Xen patchbot -unstable <=