mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 15:15:25 +00:00
qemu: Improve error when setting invalid count of vcpus via agent
https://bugzilla.redhat.com/show_bug.cgi?id=1035108 When attempting to enable more vCPUs in the guest than is currently enabled in the guest but less than the maximum count for the VM we currently reported an unhelpful message: error: internal error: guest agent reports less cpu than requested This patch changes it to: error: invalid argument: requested vcpu count is greater than the count of enabled vcpus in the domain: 3 > 2
This commit is contained in:
parent
be904e4eeb
commit
34b8449027
@ -4201,6 +4201,14 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus,
|
|||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nvcpus > vm->def->vcpus) {
|
||||||
|
virReportError(VIR_ERR_INVALID_ARG,
|
||||||
|
_("requested vcpu count is greater than the count "
|
||||||
|
"of enabled vcpus in the domain: %d > %d"),
|
||||||
|
nvcpus, vm->def->vcpus);
|
||||||
|
goto endjob;
|
||||||
|
}
|
||||||
|
|
||||||
qemuDomainObjEnterAgent(vm);
|
qemuDomainObjEnterAgent(vm);
|
||||||
ncpuinfo = qemuAgentGetVCPUs(priv->agent, &cpuinfo);
|
ncpuinfo = qemuAgentGetVCPUs(priv->agent, &cpuinfo);
|
||||||
qemuDomainObjExitAgent(vm);
|
qemuDomainObjExitAgent(vm);
|
||||||
|
Loading…
Reference in New Issue
Block a user