Re: [PATCH 4/4] Check the kvm host cpu max limits in virConnectGetDomainCapabilities()

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

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]