ia64/xen-unstable

changeset 5481:7d4dd8aae709

bitkeeper revision 1.1713.3.7 (42b2eca9N1e5S0oGdW8OeKAkL9oDOQ)

netif.py, blkif.py:
Add exportToDB functions to save evtchn port.
Signed-off-by: Mike Wray <mike.wray@hp.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Fri Jun 17 15:30:49 2005 +0000 (2005-06-17)
parents ebef9f2fb49f
children 43ae2740ac94
files tools/python/xen/xend/server/blkif.py tools/python/xen/xend/server/netif.py
line diff
     1.1 --- a/tools/python/xen/xend/server/blkif.py	Fri Jun 17 14:20:55 2005 +0000
     1.2 +++ b/tools/python/xen/xend/server/blkif.py	Fri Jun 17 15:30:49 2005 +0000
     1.3 @@ -193,6 +193,13 @@ class BlkDev(Dev):
     1.4          self.backendId = 0
     1.5          self.configure(self.config, recreate=recreate)
     1.6  
     1.7 +    def exportToDB(self, save=False):
     1.8 +        Dev.exportToDB(self, save=save)
     1.9 +        backend = self.getBackend()
    1.10 +        if backend and backend.evtchn:
    1.11 +            db = self.db.addChild("evtchn")
    1.12 +            backend.evtchn.exportToDB(db, save=save)
    1.13 +
    1.14      def init(self, recreate=False, reboot=False):
    1.15          self.frontendDomain = self.getDomain()
    1.16          self.frontendChannel = self.getChannel()
     2.1 --- a/tools/python/xen/xend/server/netif.py	Fri Jun 17 14:20:55 2005 +0000
     2.2 +++ b/tools/python/xen/xend/server/netif.py	Fri Jun 17 15:30:49 2005 +0000
     2.3 @@ -66,11 +66,9 @@ class NetDev(Dev):
     2.4          DBVar('be_mac',  ty='mac'),
     2.5          DBVar('bridge',  ty='str'),
     2.6          DBVar('script',  ty='str'),
     2.7 -        #DBVar('ipaddr'),
     2.8          DBVar('credit',  ty='int'),
     2.9          DBVar('period',  ty='int'),
    2.10          DBVar('vifname', ty='str'),
    2.11 -        DBVar('evtchn'),                #todo: export fields (renamed)
    2.12          ]
    2.13  
    2.14      def __init__(self, controller, id, config, recreate=False):
    2.15 @@ -92,6 +90,12 @@ class NetDev(Dev):
    2.16          self.vifname = None
    2.17          self.configure(self.config, recreate=recreate)
    2.18  
    2.19 +    def exportToDB(self, save=False):
    2.20 +        Dev.exportToDB(self, save=save)
    2.21 +        if self.evtchn:
    2.22 +            db = self.db.addChild("evtchn")
    2.23 +            self.evtchn.exportToDB(db, save=save)
    2.24 +
    2.25      def init(self, recreate=False, reboot=False):
    2.26          self.destroyed = False
    2.27          self.status = NETIF_INTERFACE_STATUS_DISCONNECTED