On Wed, 2016-06-15 at 09:58 +0000, Shivaprasad G Bhat wrote:
- domCaps->maxvcpus = maxvcpus;
+ domCaps->maxvcpus = virQEMUCapsGetMachineMaxCpus(qemuCaps, domCaps-
machine);
+ if (virttype == VIR_DOMAIN_VIRT_KVM) {
+ hostmaxvcpus = virHostCPUGetKVMVCPUs(VIR_HOSTCPU_KVM_MAXVCPUS);
+ domCaps->suggestedvcpus =
virHostCPUGetKVMVCPUs(VIR_HOSTCPU_KVM_NR_VCPUS);
+ domCaps->maxvcpus = MIN(domCaps->maxvcpus,
hostmaxvcpus);
+ }
Forgot to mention this yesterday: domCaps->suggestedvcpus
will have to be capped by hostmaxvcpus as well, because
otherwise you would end up with stuff like
<vcpu max='1' suggested='160'/>
for the 'isapc' or 'xenpv' machine types.
--
Andrea Bolognani / Red Hat / Virtualization