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] Setup network devices in xenstore using xstransact.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Setup network devices in xenstore using xstransact.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 09 Sep 2005 17:42:11 +0000
Delivery-date: Fri, 09 Sep 2005 17:40: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 578c19d1ed494646a8b92207eb576c268312d4d0
# Parent  fbdb56cd611b31a6924d3dd881fae64f9d7ec0e1
Setup network devices in xenstore using xstransact.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r fbdb56cd611b -r 578c19d1ed49 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Sep  9 16:07:26 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Sep  9 16:08:17 2005
@@ -47,6 +47,7 @@
 
 from xen.xend.uuid import getUuid
 from xen.xend.xenstore import DBVar, XenNode, DBMap
+from xen.xend.xenstore.xstransact import xstransact
 
 """Shutdown code for poweroff."""
 DOMAIN_POWEROFF = 0
@@ -452,30 +453,28 @@
             mac = sxp.child_value(devconfig, 'mac')
             ipaddr = _get_config_ipaddr(devconfig)
 
-            # 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['script'] = script
-            backdb['domain'] = self.name
-            backdb['mac'] = mac
-            backdb['bridge'] = bridge
+            backpath = "%s/backend/%s/%s/%d" % (backdom.path, type,
+                                                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)
             if ipaddr:
-                backdb['ip'] = ' '.join(ipaddr)
-            backdb['frontend'] = db.getPath()
-            backdb['frontend-id'] = "%i" % self.id
-            backdb['handle'] = "%i" % devnum
-            backdb.saveDB(save=True)
-
-            db['backend'] = backdb.getPath()
-            db['backend-id'] = "%i" % backdom.id
-            db['handle'] = "%i" % devnum
-            db['mac'] = mac
-
-            db.saveDB(save=True)
+                backt.write('ip', ' '.join(ipaddr))
+            backt.write('frontend', frontpath)
+            backt.write('frontend-id', "%i" % self.id)
+            backt.write('handle', "%i" % devnum)
+            backt.commit()
 
             return
         

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Setup network devices in xenstore using xstransact., Xen patchbot -unstable <=