mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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>
This commit is contained in:
1 parent
99a2107ffa
commit
c7fcce5589
2 files changed
+13
-2
No files matched your search
@@ -193,6 +193,13 @@ class BlkDev(Dev):
|
||||
self.backendId = 0
|
||||
self.configure(self.config, recreate=recreate)
|
||||
|
||||
def exportToDB(self, save=False):
|
||||
Dev.exportToDB(self, save=save)
|
||||
backend = self.getBackend()
|
||||
if backend and backend.evtchn:
|
||||
db = self.db.addChild("evtchn")
|
||||
backend.evtchn.exportToDB(db, save=save)
|
||||
|
||||
def init(self, recreate=False, reboot=False):
|
||||
self.frontendDomain = self.getDomain()
|
||||
self.frontendChannel = self.getChannel()
|
||||
|
||||
@@ -66,11 +66,9 @@ class NetDev(Dev):
|
||||
DBVar('be_mac', ty='mac'),
|
||||
DBVar('bridge', ty='str'),
|
||||
DBVar('script', ty='str'),
|
||||
#DBVar('ipaddr'),
|
||||
DBVar('credit', ty='int'),
|
||||
DBVar('period', ty='int'),
|
||||
DBVar('vifname', ty='str'),
|
||||
DBVar('evtchn'), #todo: export fields (renamed)
|
||||
]
|
||||
|
||||
def __init__(self, controller, id, config, recreate=False):
|
||||
@@ -92,6 +90,12 @@ class NetDev(Dev):
|
||||
self.vifname = None
|
||||
self.configure(self.config, recreate=recreate)
|
||||
|
||||
def exportToDB(self, save=False):
|
||||
Dev.exportToDB(self, save=save)
|
||||
if self.evtchn:
|
||||
db = self.db.addChild("evtchn")
|
||||
self.evtchn.exportToDB(db, save=save)
|
||||
|
||||
def init(self, recreate=False, reboot=False):
|
||||
self.destroyed = False
|
||||
self.status = NETIF_INTERFACE_STATUS_DISCONNECTED
|
||||
|
||||