ia64/xen-unstable

changeset 13192:159ae46d5e7f

Persist the VLAN setting.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Mon Dec 25 17:02:16 2006 +0000 (2006-12-25)
parents c1aecee76db5
children 6533ebfc25e1
files tools/python/xen/xend/XendNode.py tools/python/xen/xend/XendPIF.py
line diff
     1.1 --- a/tools/python/xen/xend/XendNode.py	Mon Dec 25 16:56:46 2006 +0000
     1.2 +++ b/tools/python/xen/xend/XendNode.py	Mon Dec 25 17:02:16 2006 +0000
     1.3 @@ -107,6 +107,7 @@ class XendNode:
     1.4                      self.pifs[pif_uuid] = XendPIF(pif_uuid,
     1.5                                                    pif['name'],
     1.6                                                    pif['MTU'],
     1.7 +                                                  pif['VLAN'],
     1.8                                                    pif['MAC'],
     1.9                                                    network,
    1.10                                                    self)
    1.11 @@ -114,7 +115,7 @@ class XendNode:
    1.12              for name, mtu, mac in linux_get_phy_ifaces():
    1.13                  network = self.networks.values()[0]
    1.14                  pif_uuid = uuid.createString()
    1.15 -                pif = XendPIF(pif_uuid, name, mtu, mac, network, self)
    1.16 +                pif = XendPIF(pif_uuid, name, mtu, '', mac, network, self)
    1.17                  self.pifs[pif_uuid] = pif
    1.18  
    1.19          # initialise storage
     2.1 --- a/tools/python/xen/xend/XendPIF.py	Mon Dec 25 16:56:46 2006 +0000
     2.2 +++ b/tools/python/xen/xend/XendPIF.py	Mon Dec 25 17:02:16 2006 +0000
     2.3 @@ -99,12 +99,12 @@ def same_dir_rename(old_path, new_path):
     2.4  class XendPIF:
     2.5      """Representation of a Physical Network Interface."""
     2.6      
     2.7 -    def __init__(self, uuid, name, mtu, mac, network, host):
     2.8 +    def __init__(self, uuid, name, mtu, vlan, mac, network, host):
     2.9          self.uuid = uuid
    2.10          self.name = name
    2.11          self.mac = mac
    2.12          self.mtu = mtu
    2.13 -        self.vlan = ''
    2.14 +        self.vlan = vlan
    2.15          self.network = network
    2.16          self.host = host
    2.17  
    2.18 @@ -132,11 +132,11 @@ class XendPIF:
    2.19      def get_record(self, transient = True):
    2.20          result = {'name': self.name,
    2.21                    'MAC': self.mac,
    2.22 -                  'MTU': self.mtu,
    2.23 +                  'MTU': str(self.mtu),
    2.24                    'VLAN': self.vlan,
    2.25                    'host': self.host.uuid,
    2.26                    'network': self.network.uuid}
    2.27          if transient:
    2.28 -            result['io_read_kbs'] = self.get_io_read_kbs()
    2.29 -            result['io_write_kbs'] = self.get_io_write_kbs()
    2.30 +            result['io_read_kbs'] = str(self.get_io_read_kbs())
    2.31 +            result['io_write_kbs'] = str(self.get_io_write_kbs())
    2.32          return result