[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Implement VM.{add_to, remove_from}_VCPUs_params.



# HG changeset patch
# User Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Date 1173824020 0
# Node ID 01e35a77ce8fac487f678d3364c99af6f080f54e
# Parent  3f45afc6b0251d938c7751ea216689edf0973c7f
Implement VM.{add_to,remove_from}_VCPUs_params.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/python/xen/xend/XendAPI.py |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff -r 3f45afc6b025 -r 01e35a77ce8f tools/python/xen/xend/XendAPI.py
--- a/tools/python/xen/xend/XendAPI.py  Tue Mar 13 22:12:18 2007 +0000
+++ b/tools/python/xen/xend/XendAPI.py  Tue Mar 13 22:13:40 2007 +0000
@@ -1040,6 +1040,8 @@ class XendAPI(object):
                   ('resume', None),
                   ('add_to_HVM_boot_params', None),
                   ('remove_from_HVM_boot_params', None),
+                  ('add_to_VCPUs_params', None),
+                  ('remove_from_VCPUs_params', None),
                   ('add_to_platform', None),
                   ('remove_from_platform', None),
                   ('add_to_other_config', None),
@@ -1259,9 +1261,24 @@ class XendAPI(object):
         dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
         return xen_api_todo()
     
-    def VM_set_VCPUs_params(self, session, vm_ref, params):
-        dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
-        return xen_api_todo()
+    def VM_set_VCPUs_params(self, session, vm_ref, value):
+        return self.VM_set('vcpus_params', session, vm_ref, value)
+
+    def VM_add_to_VCPUs_params(self, session, vm_ref, key, value):
+        dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
+        if 'vcpus_params' not in dom.info:
+            dom.info['vcpus_params'] = {}
+        dom.info['vcpus_params'][key] = value
+        return self._VM_save(dom)
+
+    def VM_remove_from_VCPUs_params(self, session, vm_ref, key):
+        dom = XendDomain.instance().get_vm_by_uuid(vm_ref)
+        if 'vcpus_params' in dom.info \
+               and key in dom.info['vcpus_params']:
+            del dom.info['vcpus_params'][key]
+            return self._VM_save(dom)
+        else:
+            return xen_api_success_void()
     
     def VM_set_actions_after_shutdown(self, session, vm_ref, action):
         if action not in XEN_API_ON_NORMAL_EXIT:

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.