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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Switch vtpm 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:04 +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 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

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