[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Switch vtpm device setup/teardown over to xstransact.



# HG changeset patch
# User cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID cdaaaa027bf843a62627e61bfa9351c3991d57c9
# Parent  38a29ec8d021821f9d2dec1f9177468056544b6c
Switch vtpm device setup/teardown over to xstransact.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r 38a29ec8d021 -r cdaaaa027bf8 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Mon Sep 12 19:55:57 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Mon Sep 12 19:59:40 2005
@@ -473,22 +473,19 @@
             devnum = int(sxp.child_value(devconfig, 'instance', '0'))
             log.error("The domain has a TPM with instance %d." % devnum)
 
-            # 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))
-
-            backdb['frontend'] = db.getPath()
-            backdb['frontend-id'] = "%i" % self.id
-            backdb['instance'] = sxp.child_value(devconfig, 'instance', '0')
-            backdb.saveDB(save=True)
-
-            db['handle'] = "%i" % devnum
-            db['backend'] = backdb.getPath()
-            db['backend-id'] = "%i" % int(sxp.child_value(devconfig,
-                                                          'backend', '0'))
-            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,
+                      'handle' : "%i" % devnum }
+            xstransact.Write(frontpath, front)
+
+            back = { 'instance' : "%i" % devnum,
+                     'frontend' : frontpath,
+                     'frontend-id' : "%i" % self.id }
+            xstransact.Write(backpath, back)
 
             return
 
@@ -795,14 +792,9 @@
             t.remove(d)
         for d in t.list("vif"):
             t.remove(d)
+        for d in t.list("vtpm"):
+            t.remove(d)
         t.commit()
-        ddb = self.db.addChild("/device")
-        for type in ddb.keys():
-            if type == 'vtpm':
-                typedb = ddb.addChild(type)
-                for dev in typedb.keys():
-                    typedb[dev].delete()
-                typedb.saveDB(save=True)
 
     def show(self):
         """Print virtual machine info.

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.