
From: CrÃstian Deives <cristiandeives@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@gmail.com> Signed-off-by: Jose Ricardo Ziviani <joserz@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