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

[Xen-changelog] Change configuration handling wrt to the vcpus entry, so that we only see a



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 653d38c8fbc8d3d1b5dbac21c180fedeccb272b3
# Parent  eae64901e428da38b2bf50d053a771958f757101
Change configuration handling wrt to the vcpus entry, so that we only see a
vcpus entry in the image section when using VMX, only add VMX options at all
if the builder is vmx, and issue a warning when overriding the global vcpus
setting with the one from the image.

This removes the duplicated vcpus entries in the domain's sxpr.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r eae64901e428 -r 653d38c8fbc8 tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Wed Dec  7 11:47:46 2005
+++ b/tools/python/xen/xend/XendDomainInfo.py   Wed Dec  7 11:50:55 2005
@@ -285,16 +285,18 @@
     for e in ROUNDTRIPPING_CONFIG_ENTRIES:
         result[e[0]] = get_cfg(e[0], e[1])
 
-    result['cpu']       = get_cfg('cpu',       int)
-    result['cpus']      = get_cfg('cpus',      str)
-    result['image']     = get_cfg('image')
+    result['cpu']   = get_cfg('cpu',  int)
+    result['cpus']  = get_cfg('cpus', str)
+    result['image'] = get_cfg('image')
 
     try:
         if result['image']:
-            result['vcpus'] = int(sxp.child_value(result['image'],
-                                                  'vcpus', 1))
-        else:
-            result['vcpus'] = 1
+            v = sxp.child_value(result['image'], 'vcpus')
+            if v is not None and int(v) != result['vcpus']:
+                log.warn(('Image VCPUs setting overrides vcpus=%d elsewhere.'
+                          '  Using %s VCPUs for VM %s.') %
+                         (result['vcpus'], v, result['uuid']))
+                result['vcpus'] = int(v)
     except TypeError, exn:
         raise VmError(
             'Invalid configuration setting: vcpus = %s: %s' %
diff -r eae64901e428 -r 653d38c8fbc8 tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Wed Dec  7 11:47:46 2005
+++ b/tools/python/xen/xm/create.py     Wed Dec  7 11:50:55 2005
@@ -424,8 +424,10 @@
         config_image.append(['root', cmdline_root])
     if vals.extra:
         config_image.append(['args', vals.extra])
-    if vals.vcpus:
-        config_image.append(['vcpus', vals.vcpus])
+
+    if vals.builder == 'vmx':
+        configure_vmx(config_image, vals)
+        
     return config_image
     
 def configure_disks(config_devs, vals):
@@ -573,7 +575,7 @@
                 config.append([n, v])
 
     map(add_conf, ['name', 'memory', 'ssidref', 'maxmem', 'restart',
-                   'on_poweroff', 'on_reboot', 'on_crash'])
+                   'on_poweroff', 'on_reboot', 'on_crash', 'vcpus'])
     
     if vals.cpu is not None:
         config.append(['cpu', vals.cpu])
@@ -593,7 +595,6 @@
         config_image = run_bootloader(vals)
     else:
         config_image = configure_image(vals)
-    configure_vmx(config_image, vals)
     config.append(['image', config_image])
 
     config_devs = []

_______________________________________________
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®.