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] Checks to make sure the image type

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Checks to make sure the image type is valid in configuration
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 30 Nov 2006 21:30:33 +0000
Delivery-date: Thu, 30 Nov 2006 13:31:15 -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 d9b5e34c4e5c45ae6f18beed4d2fafe5304182d8
# Parent  96621d417bd485b6f3a7f1d715dda39d7df1e275
[XEND] Checks to make sure the image type is valid in configuration

The 'builder' (eg. image type) should either be 'hvm' or 'linux' as
image.py only supports these at the moment.

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendConfig.py |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff -r 96621d417bd4 -r d9b5e34c4e5c tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Thu Nov 30 14:50:27 2006 +0000
+++ b/tools/python/xen/xend/XendConfig.py       Thu Nov 30 14:51:46 2006 +0000
@@ -328,9 +328,14 @@ class XendConfig(dict):
                 raise XendConfigError('Invalid event handling mode: ' +
                                       event)
 
+    def _builder_sanity_check(self):
+        if self['builder'] not in ('hvm', 'linux'):
+            raise XendConfigError('Invalid builder configuration')
+
     def validate(self):
         self._memory_sanity_check()
         self._actions_sanity_check()
+        self._builder_sanity_check()
 
     def _dominfo_to_xapi(self, dominfo):
         self['domid'] = dominfo['domid']
@@ -665,7 +670,14 @@ class XendConfig(dict):
         officially supported by the Xen API but is required for
         the rest of Xend to function.
         """
-        pass
+
+        # populate image
+        self['image']['type'] = self['builder']
+        if self['builder'] == 'hvm':
+            self['image']['hvm'] = {}
+            for xapi, cfgapi in XENAPI_HVM_CFG.items():
+                self['image']['hvm'][cfgapi] = self[xapi]
+            
 
     def _get_old_state_string(self):
         """Returns the old xm state string.
@@ -868,13 +880,14 @@ class XendConfig(dict):
             
             elif dev_type in ('vbd', 'tap'):
                 if dev_type == 'vbd':
-                    dev_info['uname'] = cfg_xenapi.get('image', None)
+                    dev_info['uname'] = cfg_xenapi.get('image', '')
                     dev_info['dev'] = '%s:disk' % cfg_xenapi.get('device')
                 elif dev_type == 'tap':
                     dev_info['uname'] = 'tap:qcow:%s' % cfg_xenapi.get('image')
                     dev_info['dev'] = '%s:disk' % cfg_xenapi.get('device')
                     
                 dev_info['driver'] = cfg_xenapi.get('driver')
+                dev_info['VDI'] = cfg_xenapi.get('VDI', '')
                     
                 if cfg_xenapi.get('mode') == 'RW':
                     dev_info['mode'] = 'w'

_______________________________________________
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] Checks to make sure the image type is valid in configuration, Xen patchbot-unstable <=