# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1167064944 0
# Node ID c1fbe291b56405b430703edfef02615c79944420
# Parent 8f864129d5994a99112eb786bbac9cf10508b377
Persist network details when they change.
Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
tools/python/xen/xend/XendNetwork.py | 4 ++++
tools/python/xen/xend/XendNode.py | 11 +++++++----
2 files changed, 11 insertions(+), 4 deletions(-)
diff -r 8f864129d599 -r c1fbe291b564 tools/python/xen/xend/XendNetwork.py
--- a/tools/python/xen/xend/XendNetwork.py Mon Dec 25 16:36:48 2006 +0000
+++ b/tools/python/xen/xend/XendNetwork.py Mon Dec 25 16:42:24 2006 +0000
@@ -66,17 +66,21 @@ class XendNetwork:
def set_name_label(self, new_name):
self.name_label = new_name
+ XendNode.instance().save_networks()
def set_name_description(self, new_desc):
self.name_description = new_desc
+ XendNode.instance().save_networks()
def set_default_gateway(self, new_gateway):
if re.search('^\d+\.\d+\.\d+\.\d+$', new_gateway):
self.default_gateway = new_gateway
+ XendNode.instance().save_networks()
def set_default_netmask(self, new_netmask):
if re.search('^\d+\.\d+\.\d+\.\d+$', new_netmask):
self.default_netmask = new_netmask
+ XendNode.instance().save_networks()
def get_VIF_UUIDs(self):
return []
diff -r 8f864129d599 -r c1fbe291b564 tools/python/xen/xend/XendNode.py
--- a/tools/python/xen/xend/XendNode.py Mon Dec 25 16:36:48 2006 +0000
+++ b/tools/python/xen/xend/XendNode.py Mon Dec 25 16:42:24 2006 +0000
@@ -135,13 +135,16 @@ class XendNode:
pif_records = dict([(k, v.get_record(transient = False))
for k, v in self.pifs.items()])
self.state_store.save_state('pif', pif_records)
+
+ self.save_networks()
+
+ sr_record = {self.sr.uuid: self.sr.get_record()}
+ self.state_store.save_state('sr', sr_record)
+
+ def save_networks(self):
net_records = dict([(k, v.get_record(transient = False))
for k, v in self.networks.items()])
self.state_store.save_state('network', net_records)
-
-
- sr_record = {self.sr.uuid: self.sr.get_record()}
- self.state_store.save_state('sr', sr_record)
def shutdown(self):
return 0
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|