summaryrefslogtreecommitdiff
path: root/tests/xmconfigdata
diff options
context:
space:
mode:
authorJim Fehlig <jfehlig@suse.com>2015-12-15 14:47:40 -0700
committerJim Fehlig <jfehlig@suse.com>2015-12-18 17:52:00 -0700
commit5b74103b0bcb8b9c184c1583694d76976753265a (patch)
tree58c63917f0afc0926540f2218894ae192c37b2c7 /tests/xmconfigdata
parent2eba5c5635a041a0a3a736e917fa1495c97c132b (diff)
downloadlibvirt-5b74103b0bcb8b9c184c1583694d76976753265a.tar.gz
Xen: support maxvcpus in xm and xl config
From: Ian Campbell <ian.campbell@citrix.com> xend prior to 4.0 understands vcpus as maxvcpus and vcpu_avail as a bit map of which cpus are online (default is all). xend from 4.0 onwards understands maxvcpus as maxvcpus and vcpus as the number which are online (from 0..N-1). The upstream commit (68a94cf528e6 "xm: Add maxvcpus support") claims that if maxvcpus is omitted then the old behaviour (i.e. obeying vcpu_avail) is retained, but AFAICT it was not, in this case vcpu==maxcpus==online cpus. This is good for us because handling anything else would be fiddly. This patch changes parsing of the virDomainDef maxvcpus and vcpus entries to use the corresponding 'maxvcpus' and 'vcpus' settings from xm and xl config. It also drops use of the old Xen 3.x 'vcpu_avail' setting. The change also removes the maxvcpus limit of MAX_VIRT_VCPUS (since maxvcpus is simply a count, not a bit mask), which is particularly crucial on ARM where MAX_VIRT_CPUS == 1 (since all guests are expected to support vcpu placement, and therefore only the boot vcpu's info lives in the shared info page). Existing tests adjusted accordingly, and new tests added for the 'maxvcpus' setting.
Diffstat (limited to 'tests/xmconfigdata')
-rw-r--r--tests/xmconfigdata/test-paravirt-maxvcpus.cfg13
-rw-r--r--tests/xmconfigdata/test-paravirt-maxvcpus.xml31
-rw-r--r--tests/xmconfigdata/test-paravirt-vcpu.cfg4
3 files changed, 46 insertions, 2 deletions
diff --git a/tests/xmconfigdata/test-paravirt-maxvcpus.cfg b/tests/xmconfigdata/test-paravirt-maxvcpus.cfg
new file mode 100644
index 0000000000..8d1ac4d786
--- /dev/null
+++ b/tests/xmconfigdata/test-paravirt-maxvcpus.cfg
@@ -0,0 +1,13 @@
+name = "XenGuest1"
+uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809"
+maxmem = 579
+memory = 394
+maxvcpus = 4
+vcpus = 2
+localtime = 0
+on_poweroff = "destroy"
+on_reboot = "restart"
+on_crash = "restart"
+vif = [ "mac=00:16:3e:66:94:9c,bridge=br0,script=vif-bridge" ]
+bootloader = "/usr/bin/pygrub"
+disk = [ "phy:/dev/HostVG/XenGuest1,xvda,w" ]
diff --git a/tests/xmconfigdata/test-paravirt-maxvcpus.xml b/tests/xmconfigdata/test-paravirt-maxvcpus.xml
new file mode 100644
index 0000000000..3b0e0ce14f
--- /dev/null
+++ b/tests/xmconfigdata/test-paravirt-maxvcpus.xml
@@ -0,0 +1,31 @@
+<domain type='xen'>
+ <name>XenGuest1</name>
+ <uuid>c7a5fdb0-cdaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>592896</memory>
+ <currentMemory unit='KiB'>403456</currentMemory>
+ <vcpu placement='static' current='2'>4</vcpu>
+ <bootloader>/usr/bin/pygrub</bootloader>
+ <os>
+ <type arch='i686' machine='xenpv'>linux</type>
+ </os>
+ <clock offset='utc' adjustment='reset'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <disk type='block' device='disk'>
+ <driver name='phy'/>
+ <source dev='/dev/HostVG/XenGuest1'/>
+ <target dev='xvda' bus='xen'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='00:16:3e:66:94:9c'/>
+ <source bridge='br0'/>
+ <script path='vif-bridge'/>
+ </interface>
+ <console type='pty'>
+ <target type='xen' port='0'/>
+ </console>
+ <memballoon model='xen'/>
+ </devices>
+</domain>
diff --git a/tests/xmconfigdata/test-paravirt-vcpu.cfg b/tests/xmconfigdata/test-paravirt-vcpu.cfg
index 1e7765d4e5..8d1ac4d786 100644
--- a/tests/xmconfigdata/test-paravirt-vcpu.cfg
+++ b/tests/xmconfigdata/test-paravirt-vcpu.cfg
@@ -2,8 +2,8 @@ name = "XenGuest1"
uuid = "c7a5fdb0-cdaf-9455-926a-d65c16db1809"
maxmem = 579
memory = 394
-vcpus = 4
-vcpu_avail = 3
+maxvcpus = 4
+vcpus = 2
localtime = 0
on_poweroff = "destroy"
on_reboot = "restart"