ia64/xen-unstable

changeset 13190:c1fbe291b564

Persist network details when they change.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Mon Dec 25 16:42:24 2006 +0000 (2006-12-25)
parents 8f864129d599
children c1aecee76db5
files tools/python/xen/xend/XendNetwork.py tools/python/xen/xend/XendNode.py
line diff
     1.1 --- a/tools/python/xen/xend/XendNetwork.py	Mon Dec 25 16:36:48 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendNetwork.py	Mon Dec 25 16:42:24 2006 +0000
     1.3 @@ -66,17 +66,21 @@ class XendNetwork:
     1.4  
     1.5      def set_name_label(self, new_name):
     1.6          self.name_label = new_name
     1.7 +        XendNode.instance().save_networks()
     1.8  
     1.9      def set_name_description(self, new_desc):
    1.10          self.name_description = new_desc
    1.11 +        XendNode.instance().save_networks()
    1.12  
    1.13      def set_default_gateway(self, new_gateway):
    1.14          if re.search('^\d+\.\d+\.\d+\.\d+$', new_gateway):
    1.15              self.default_gateway = new_gateway
    1.16 +            XendNode.instance().save_networks()
    1.17  
    1.18      def set_default_netmask(self, new_netmask):
    1.19          if re.search('^\d+\.\d+\.\d+\.\d+$', new_netmask):
    1.20              self.default_netmask = new_netmask
    1.21 +            XendNode.instance().save_networks()
    1.22  
    1.23      def get_VIF_UUIDs(self):
    1.24          return []
     2.1 --- a/tools/python/xen/xend/XendNode.py	Mon Dec 25 16:36:48 2006 +0000
     2.2 +++ b/tools/python/xen/xend/XendNode.py	Mon Dec 25 16:42:24 2006 +0000
     2.3 @@ -135,14 +135,17 @@ class XendNode:
     2.4          pif_records = dict([(k, v.get_record(transient = False))
     2.5                              for k, v in self.pifs.items()])
     2.6          self.state_store.save_state('pif', pif_records)
     2.7 +
     2.8 +        self.save_networks()
     2.9 +
    2.10 +        sr_record = {self.sr.uuid: self.sr.get_record()}
    2.11 +        self.state_store.save_state('sr', sr_record)
    2.12 +
    2.13 +    def save_networks(self):
    2.14          net_records = dict([(k, v.get_record(transient = False))
    2.15                              for k, v in self.networks.items()])
    2.16          self.state_store.save_state('network', net_records)
    2.17  
    2.18 -
    2.19 -        sr_record = {self.sr.uuid: self.sr.get_record()}
    2.20 -        self.state_store.save_state('sr', sr_record)
    2.21 -
    2.22      def shutdown(self):
    2.23          return 0
    2.24