WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] [XEND] Accomodate extra "devices" in SXP

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Accomodate extra "devices" in SXP that do not have DevControllers
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 17 Nov 2006 20:10:12 +0000
Delivery-date: Fri, 17 Nov 2006 12:10:02 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Alastair Tse <atse@xxxxxxxxxxxxx>
# Node ID f1d2860c51370f7a89c5b8b6b7941b8975928349
# Parent  516821812322fe0290794f499bd758a47af4c3e5
[XEND] Accomodate extra "devices" in SXP that do not have DevControllers

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendConfig.py     |   10 ++++++----
 tools/python/xen/xend/XendDevices.py    |    5 +++++
 tools/python/xen/xend/XendDomainInfo.py |    5 +++--
 3 files changed, 14 insertions(+), 6 deletions(-)

diff -r 516821812322 -r f1d2860c5137 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Fri Nov 17 17:03:59 2006 +0000
+++ b/tools/python/xen/xend/XendConfig.py       Fri Nov 17 17:57:49 2006 +0000
@@ -780,7 +780,8 @@ class XendConfig(dict):
 
         # Verify devices
         for d_uuid, (d_type, d_info) in self['device'].items():
-            if d_type not in XendDevices.valid_devices():
+            if d_type not in XendDevices.valid_devices() and \
+               d_type not in XendDevices.pseudo_devices():
                 raise XendConfigError('Invalid device (%s)' % d_type)
 
         # Verify restart modes
@@ -798,7 +799,8 @@ class XendConfig(dict):
             self['vtpm_refs'] = []
 
     def device_add(self, dev_type, cfg_sxp = None, cfg_xenapi = None):
-        if dev_type not in XendDevices.valid_devices():
+        if dev_type not in XendDevices.valid_devices() and \
+           dev_type not in XendDevices.pseudo_devices():
             raise XendConfigError("XendConfig: %s not a valid device type" %
                             dev_type)
 
@@ -917,8 +919,8 @@ class XendConfig(dict):
             if dev_type == 'pci': # special case for pci devices
                 pci_devs.append(dev_info)
             else:
-                sxpr =  self.device_sxpr(dev_type = dev_type,
-                                         dev_info = dev_info)
+                sxpr = self.device_sxpr(dev_type = dev_type,
+                                        dev_info = dev_info)
                 sxprs.append((dev_type, sxpr))
 
         # if we have any pci_devs, we parse them differently into
diff -r 516821812322 -r f1d2860c5137 tools/python/xen/xend/XendDevices.py
--- a/tools/python/xen/xend/XendDevices.py      Fri Nov 17 17:03:59 2006 +0000
+++ b/tools/python/xen/xend/XendDevices.py      Fri Nov 17 17:57:49 2006 +0000
@@ -49,6 +49,11 @@ class XendDevices:
     valid_devices = classmethod(valid_devices)
 
     #@classmethod
+    def pseudo_devices(cls):
+        return ['console']
+    pseudo_devices = classmethod(pseudo_devices)
+
+    #@classmethod
     def make_controller(cls, name, domain):
         """Factory function to make device controllers per domain.
 
diff -r 516821812322 -r f1d2860c5137 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Fri Nov 17 17:03:59 2006 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Fri Nov 17 17:57:49 2006 +0000
@@ -1119,8 +1119,9 @@ class XendDomainInfo:
         @raise: VmError for invalid devices
         """
         for (devclass, config) in self.info.all_devices_sxpr():
-            log.info("createDevice: %s : %s" % (devclass, config))
-            self._createDevice(devclass, config)
+            if devclass in XendDevices.valid_devices():
+                log.info("createDevice: %s : %s" % (devclass, config))
+                self._createDevice(devclass, config)
 
         if self.image:
             self.image.createDeviceModel()

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEND] Accomodate extra "devices" in SXP that do not have DevControllers, Xen patchbot-unstable <=