ia64/xen-unstable

changeset 13571:b75af612851c

[XEND] Save model attribute for HVM VIFs

This solves the problem of HVM VIFs forgetting their model config on
reboot.

http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=867

Signed-off-by: Alastair Tse <atse@xensource.com>
author Alastair Tse <atse@xensource.com>
date Mon Jan 22 17:31:15 2007 +0000 (2007-01-22)
parents bffe67212133
children 4e878f596c16
files tools/python/xen/xend/server/netif.py
line diff
     1.1 --- a/tools/python/xen/xend/server/netif.py	Mon Jan 22 17:23:53 2007 +0000
     1.2 +++ b/tools/python/xen/xend/server/netif.py	Mon Jan 22 17:31:15 2007 +0000
     1.3 @@ -147,6 +147,7 @@ class NetifController(DevController):
     1.4          rate    = config.get('rate')
     1.5          uuid    = config.get('uuid')
     1.6          ipaddr  = config.get('ip')
     1.7 +        model   = config.get('model')
     1.8  
     1.9          devid = self.allocateDeviceID()
    1.10  
    1.11 @@ -176,6 +177,8 @@ class NetifController(DevController):
    1.12              back['rate'] = parseRate(rate)
    1.13          if uuid:
    1.14              back['uuid'] = uuid
    1.15 +        if model:
    1.16 +            back['model'] = model
    1.17  
    1.18          return (devid, back, front)
    1.19  
    1.20 @@ -185,8 +188,9 @@ class NetifController(DevController):
    1.21  
    1.22          result = DevController.getDeviceConfiguration(self, devid)
    1.23          devinfo =  self.readBackend(devid, 'script', 'ip', 'bridge',
    1.24 -                                    'mac', 'type', 'vifname', 'rate', 'uuid')
    1.25 -        (script, ip, bridge, mac, typ, vifname, rate, uuid) = devinfo
    1.26 +                                    'mac', 'type', 'vifname', 'rate',
    1.27 +                                    'uuid', 'model')
    1.28 +        (script, ip, bridge, mac, typ, vifname, rate, uuid, model) = devinfo
    1.29  
    1.30          if script:
    1.31              network_script_dir = xoptions.network_script_dir + os.sep
    1.32 @@ -205,6 +209,8 @@ class NetifController(DevController):
    1.33              result['rate'] = formatRate(rate)
    1.34          if uuid:
    1.35              result['uuid'] = uuid
    1.36 -
    1.37 +        if model:
    1.38 +            result['model'] = model
    1.39 +            
    1.40          return result
    1.41