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] Fix interpretation of stringified

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEND] Fix interpretation of stringified 64 bit ints in
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 02 Nov 2006 22:08:55 +0000
Delivery-date: Thu, 02 Nov 2006 21:42:36 -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 d21c7908e75c1ea1e063ce16f366dd19a4fdfd4d
# Parent  397cc120ae18e18204c8b2c72d9dd7580c15b081
[XEND] Fix interpretation of stringified 64 bit ints in
XendConfig. Rename Xen API classes, "Host" and "Host_CPU" to their
lowercase equivalent.

Apparent confusion in the docs as to what they should be named.

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendAPI.py    |   14 +++++++-------
 tools/python/xen/xend/XendConfig.py |   19 ++++++++++++++++++-
 2 files changed, 25 insertions(+), 8 deletions(-)

diff -r 397cc120ae18 -r d21c7908e75c tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Thu Oct 12 12:27:56 2006 +0100
+++ b/tools/python/xen/xend/XendAPI.py  Thu Oct 12 12:30:01 2006 +0100
@@ -208,8 +208,8 @@ class XendAPI:
         
         classes = {
             'Session': (session_required,),
-            'Host': (valid_host, session_required),
-            'Host_CPU': (valid_host_cpu, session_required),
+            'host': (valid_host, session_required),
+            'host_cpu': (valid_host_cpu, session_required),
             'VM': (valid_vm, session_required),
             'VBD': (valid_vbd, session_required),
             'VIF': (valid_vif, session_required)}
@@ -346,19 +346,19 @@ class XendAPI:
     # Xen API: Class Host
     # ----------------------------------------------------------------    
 
-    Host_attr_ro = ['software_version',
+    host_attr_ro = ['software_version',
                     'resident_VMs',
                     'host_CPUs']
     
-    Host_attr_rw = ['name_label',
+    host_attr_rw = ['name_label',
                     'name_description']
 
-    Host_methods = ['disable',
+    host_methods = ['disable',
                     'enable',
                     'reboot',
                     'shutdown']
     
-    Host_funcs = ['get_by_label']
+    host_funcs = ['get_by_label']
 
     # attributes
     def host_get_name_label(self, session, host_ref):
@@ -412,7 +412,7 @@ class XendAPI:
     # Xen API: Class Host_CPU
     # ----------------------------------------------------------------
 
-    Host_CPU_attr_ro = ['host',
+    host_cpu_attr_ro = ['host',
                         'number',
                         'features',
                         'utilisation']
diff -r 397cc120ae18 -r d21c7908e75c tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py       Thu Oct 12 12:27:56 2006 +0100
+++ b/tools/python/xen/xend/XendConfig.py       Thu Oct 12 12:30:01 2006 +0100
@@ -116,6 +116,20 @@ XENAPI_UNSUPPORTED_IN_LEGACY_CFG = [
     'pci_bus',
     'otherconfig'
     ]
+
+# configuration params that need to be converted to ints
+# since the XMLRPC transport for Xen API does not use
+# 32 bit ints but string representation of 64 bit ints.
+XENAPI_INT_CFG = [
+    'user_version',
+    'vcpus_number',
+    'memory_static_min',
+    'memory_static_max',
+    'memory_dynamic_min',
+    'memory_dynamic_max',
+    'tpm_instance',
+    'tpm_backend',
+]    
 
 ##
 ## Xend Configuration Parameters
@@ -563,7 +577,10 @@ class XendConfig(dict):
 
         for cfgkey, apikey in LEGACY_CFG_TO_XENAPI_CFG.items():
             try:
-                cfg[cfgkey] = xenapi_vm[apikey]
+                if apikey in XENAPI_INT_CFG:
+                    cfg[cfgkey] = int(xenapi_vm[apikey])
+                else:
+                    cfg[cfgkey] = xenapi_vm[apikey]                    
             except KeyError:
                 pass
 

_______________________________________________
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] Fix interpretation of stringified 64 bit ints in, Xen patchbot-unstable <=