[Kimchi-devel] [PATCH v3 3/5] Set max VCPU count to the max supported value

Jose Ricardo Ziviani joserz at linux.vnet.ibm.com
Wed Sep 16 18:51:50 UTC 2015


From: Crístian Deives <cristiandeives at gmail.com>

When updating the CPU count of a VM, its maximum CPU count is also
updated to the same value. This wouldn't allow for CPU hotplug
afterwards.

Update the maximum CPU count to the maximum value supported by libvirt
when the user updates the VM CPU count.

Signed-off-by: Crístian Deives <cristiandeives at gmail.com>
Signed-off-by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
---
 src/kimchi/model/vms.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/kimchi/model/vms.py b/src/kimchi/model/vms.py
index 0dd8099..6e4579d 100644
--- a/src/kimchi/model/vms.py
+++ b/src/kimchi/model/vms.py
@@ -817,7 +817,8 @@ class VMModel(object):
 
             try:
                 # set maximum VCPU count
-                dom.setVcpusFlags(cpus, libvirt.VIR_DOMAIN_AFFECT_CONFIG |
+                max_vcpus = self.conn.get().getMaxVcpus('kvm')
+                dom.setVcpusFlags(max_vcpus, libvirt.VIR_DOMAIN_AFFECT_CONFIG |
                                   libvirt.VIR_DOMAIN_VCPU_MAXIMUM)
 
                 # set current VCPU count
-- 
1.9.1




More information about the Kimchi-devel mailing list