ia64/xen-unstable

changeset 5344:e1cd6bd22fb9

bitkeeper revision 1.1662.1.8 (42a480d7vu7MGD-9xtbGvuR9EefiQw)

XendDomainInfo.py:
g/c configs array.
Add change parameter to createDevice and pass it to controller.
g/c config_devices.
Signed-off-by: Mike Wray <mike.wray@hp.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Mon Jun 06 16:59:03 2005 +0000 (2005-06-06)
parents 4c7d2c6e932a
children cf712d7c809c
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Mon Jun 06 16:09:57 2005 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Mon Jun 06 16:59:03 2005 +0000
     1.3 @@ -237,8 +237,6 @@ class XendDomainInfo:
     1.4          self.channel = None
     1.5          self.controllers = {}
     1.6          
     1.7 -        self.configs = []
     1.8 -        
     1.9          self.info = None
    1.10          self.blkif_backend = False
    1.11          self.netif_backend = False
    1.12 @@ -333,9 +331,10 @@ class XendDomainInfo:
    1.13          self.controllers[type] = ctrl
    1.14          return ctrl
    1.15  
    1.16 -    def createDevice(self, type, devconfig):
    1.17 +    def createDevice(self, type, devconfig, change=False):
    1.18          ctrl = self.findDeviceController(type)
    1.19 -        return ctrl.createDevice(devconfig, recreate=self.recreate)
    1.20 +        return ctrl.createDevice(devconfig, recreate=self.recreate,
    1.21 +                                 change=change)
    1.22  
    1.23      def configureDevice(self, type, id, devconfig):
    1.24          ctrl = self.getDeviceController(type)
    1.25 @@ -521,22 +520,6 @@ class XendDomainInfo:
    1.26          #                            self.store_mfn,
    1.27          #                            self.store_channel)
    1.28  
    1.29 -    def config_devices(self, name):
    1.30 -        """Get a list of the 'device' nodes of a given type from the config.
    1.31 -
    1.32 -        @param name: device type
    1.33 -        @type  name: string
    1.34 -        @return: device configs
    1.35 -        @rtype: list
    1.36 -        """
    1.37 -        devices = []
    1.38 -        for d in sxp.children(self.config, 'device'):
    1.39 -            dev = sxp.child0(d)
    1.40 -            if dev is None: continue
    1.41 -            if name == sxp.name(dev):
    1.42 -                devices.append(dev)
    1.43 -        return devices
    1.44 -
    1.45      def get_device_savedinfo(self, type, id):
    1.46          val = None
    1.47          if self.savedinfo is None:
    1.48 @@ -555,13 +538,6 @@ class XendDomainInfo:
    1.49      def get_device_recreate(self, type, id):
    1.50          return self.get_device_savedinfo(type, id) or self.recreate
    1.51  
    1.52 -    def add_config(self, val):
    1.53 -        """Add configuration data to a virtual machine.
    1.54 -
    1.55 -        @param val: data to add
    1.56 -        """
    1.57 -        self.configs.append(val)
    1.58 -
    1.59      def destroy(self):
    1.60          """Completely destroy the vm.
    1.61          """
    1.62 @@ -606,8 +582,6 @@ class XendDomainInfo:
    1.63          for ctrl in self.getDeviceControllers():
    1.64              if ctrl.isDestroyed(): continue
    1.65              ctrl.destroyController(reboot=reboot)
    1.66 -        if not reboot:
    1.67 -            self.configs = []
    1.68  
    1.69      def show(self):
    1.70          """Print virtual machine info.
    1.71 @@ -615,11 +589,6 @@ class XendDomainInfo:
    1.72          print "[VM dom=%d name=%s memory=%d" % (self.id, self.name, self.memory)
    1.73          print "image:"
    1.74          sxp.show(self.image)
    1.75 -        print
    1.76 -        for val in self.configs:
    1.77 -            print "config:"
    1.78 -            sxp.show(val)
    1.79 -            print
    1.80          print "]"
    1.81  
    1.82      def init_domain(self):