mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 15:52:55 +00:00
conf: Fix off-by-one in virDomainDefGetVcpu
Cpus are indexed starting from '0' so the check was invalid. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1316384 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1316420
This commit is contained in:
parent
4a39149b69
commit
8c7b7c4b0b
@ -1405,7 +1405,7 @@ virDomainVcpuInfoPtr
|
|||||||
virDomainDefGetVcpu(virDomainDefPtr def,
|
virDomainDefGetVcpu(virDomainDefPtr def,
|
||||||
unsigned int vcpu)
|
unsigned int vcpu)
|
||||||
{
|
{
|
||||||
if (vcpu > def->maxvcpus) {
|
if (vcpu >= def->maxvcpus) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("vCPU '%u' is not present in domain definition"),
|
_("vCPU '%u' is not present in domain definition"),
|
||||||
vcpu);
|
vcpu);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user