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] xm: Add maxvcpus support

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xm: Add maxvcpus support
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 25 Nov 2009 06:20:16 -0800
Delivery-date: Wed, 25 Nov 2009 06:20:28 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1259158262 0
# Node ID dc121a3c3a92a91d491af1041dc0dd2bd4725a50
# Parent  c9b3fb7684e6d850b38a241d833528a0ac44905f
xm: Add maxvcpus support

this is patch to add maxvcpus support to xen xm command. It's using
vcpu_avail bitmask and sets the number of vcpus to maxvcpus if
present.  If it's not present, old behavior is preserved.

In domain config file you can define it as follows:

maxvcpus = 4
vcpus = 2

this automatically sets vcpus to 4 and corresponding bitmask to
present 2 vcpus in the guest with option to increase it up to 4
vcpus. If maxvcpus is not present, the old behavior for vcpus is
preserved, ie.  you can set vcpus to some number of vcpus to be used
and the vcpu_avail is set appropriately to use all of them. Only when
you use maxvcpus and vcpus new vcpu_avail value is calculated to show
PV guest the desired number of vcpus only.

It's been tested using RHEL-5 32-bit PV guest with maxvcpus = 4 and
vcpus = 2 and also the previous setup of vcpus = 2 only... In both
cases I was able to use 'xm vcpu-set {domainId} {numberOfVCPUs}' to
increase move vcpu count from 0 to maxvcpus/vcpus so it was working as
designed.

Signed-off-By: Michal Novotny<minovotn@xxxxxxxxxx>
---
 tools/python/xen/xm/create.py |   27 +++++++++++++++++++++++----
 1 files changed, 23 insertions(+), 4 deletions(-)

diff -r c9b3fb7684e6 -r dc121a3c3a92 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Wed Nov 25 14:06:17 2009 +0000
+++ b/tools/python/xen/xm/create.py     Wed Nov 25 14:11:02 2009 +0000
@@ -1029,6 +1029,24 @@ def make_config(vals):
     
     config = ['vm']
 
+    def vcpu_conf():
+        maxvcpus = False
+        vcpus = False
+        if hasattr(vals, 'maxvcpus'):
+            maxvcpus = getattr(vals, 'maxvcpus')
+        if hasattr(vals, 'vcpus'):
+            vcpus = getattr(vals, 'vcpus')
+
+        if maxvcpus and not vcpus:
+            config.append(['vcpus', maxvcpus])
+        if maxvcpus and vcpus:
+           config.append(['vcpu_avail', (1 << vcpus) - 1])
+
+        # For case we don't have maxvcpus set but we have vcpus we preserve
+        # old behaviour
+        if not maxvcpus and vcpus:
+            config.append(['vcpus', vcpus])
+
     def add_conf(n):
         if hasattr(vals, n):
             v = getattr(vals, n)
@@ -1037,10 +1055,11 @@ def make_config(vals):
 
     map(add_conf, ['name', 'memory', 'maxmem', 'shadow_memory',
                    'restart', 'on_poweroff',  'tsc_mode', 'nomigrate',
-                   'on_reboot', 'on_crash', 'vcpus', 'vcpu_avail', 'features',
-                   'on_xend_start', 'on_xend_stop', 'target', 'cpuid',
-                   'cpuid_check', 'machine_address_size', 
'suppress_spurious_page_faults'])
-
+                   'on_reboot', 'on_crash', 'features', 'on_xend_start',
+                   'on_xend_stop', 'target', 'cpuid', 'cpuid_check',
+                   'machine_address_size', 'suppress_spurious_page_faults'])
+
+    vcpu_conf()
     if vals.uuid is not None:
         config.append(['uuid', vals.uuid])
     if vals.cpu is not None:

_______________________________________________
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] xm: Add maxvcpus support, Xen patchbot-unstable <=