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] Switch block device setup/teardown over to xstransact.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Switch block device setup/teardown over to xstransact.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 12 Sep 2005 20:02:19 +0000
Delivery-date: Mon, 12 Sep 2005 20:01:00 +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 38a29ec8d021821f9d2dec1f9177468056544b6c
# Parent  3aa853185afe00a4c6417b65a37f6f78c0fb6a77
Switch block device setup/teardown over to xstransact.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 3aa853185afe -r 38a29ec8d021 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Mon Sep 12 19:49:59 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Mon Sep 12 19:55:57 2005
@@ -397,31 +397,28 @@
             typedev = sxp.child_value(devconfig, 'dev')
             if re.match('^ioemu:', typedev):
                return;
+
             backdom = domain_exists(sxp.child_value(devconfig, 'backend', '0'))
 
             devnum = blkdev_name_to_number(sxp.child_value(devconfig, 'dev'))
 
-            # create backend db
-            backdb = backdom.db.addChild("/backend/%s/%s/%d" %
-                                         (type, self.uuid, devnum))
-
-            # create frontend db
-            db = self.db.addChild("/device/%s/%d" % (type, devnum))
-            
-            db['virtual-device'] = "%i" % devnum
-            #db['backend'] = sxp.child_value(devconfig, 'backend', '0')
-            db['backend'] = backdb.getPath()
-            db['backend-id'] = "%i" % backdom.id
-
-            (type, params) = string.split(sxp.child_value(devconfig, 'uname'), 
':', 1)
-            backdb['type'] = type
-            backdb['params'] = params
-            backdb['frontend'] = db.getPath()
-            backdb['frontend-id'] = "%i" % self.id
-            backdb.saveDB(save=True)
-
-            db.saveDB(save=True)
-            
+            backpath = "%s/backend/%s/%s/%d" % (backdom.path, type,
+                                                self.uuid, devnum)
+            frontpath = "%s/device/%s/%d" % (self.path, type, devnum)
+
+            front = { 'backend' : backpath,
+                      'backend-id' : "%i" % backdom.id,
+                      'virtual-device' : "%i" % devnum }
+            xstransact.Write(frontpath, front)
+
+            (type, params) = string.split(sxp.child_value(devconfig,
+                                                          'uname'), ':', 1)
+            back = { 'type' : type,
+                     'params' : params,
+                     'frontend' : frontpath,
+                     'frontend-id' : "%i" % self.id }
+            xstransact.Write(backpath, back)
+
             return
 
         if type == 'vif':
@@ -794,16 +791,13 @@
             if ctrl.isDestroyed(): continue
             ctrl.destroyController(reboot=reboot)
         t = xstransact("%s/device" % self.path)
+        for d in t.list("vbd"):
+            t.remove(d)
         for d in t.list("vif"):
             t.remove(d)
         t.commit()
         ddb = self.db.addChild("/device")
         for type in ddb.keys():
-            if type == 'vbd':
-                typedb = ddb.addChild(type)
-                for dev in typedb.keys():
-                    typedb[dev].delete()
-                typedb.saveDB(save=True)
             if type == 'vtpm':
                 typedb = ddb.addChild(type)
                 for dev in typedb.keys():

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Switch block device setup/teardown over to xstransact., Xen patchbot -unstable <=