mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 06:35:24 +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,
|
||||
unsigned int vcpu)
|
||||
{
|
||||
if (vcpu > def->maxvcpus) {
|
||||
if (vcpu >= def->maxvcpus) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("vCPU '%u' is not present in domain definition"),
|
||||
vcpu);
|
||||
|
Loading…
Reference in New Issue
Block a user