mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
[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@xensource.com>
This commit is contained in:
1 parent
a69280ed5e
commit
2f88aa3aa6
2 files changed
+25
-8
No files matched your search
@@ -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']
|
||||
|
||||
@@ -117,6 +117,20 @@ XENAPI_UNSUPPORTED_IN_LEGACY_CFG = [
|
||||
'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
|
||||
|
||||
|
||||