On Wed, Apr 27, 2016 at 17:36:06 +0200, Martin Kletzander wrote:
On Wed, Apr 27, 2016 at 04:48:43PM +0200, Peter Krempa wrote:
>When the domain definition describes a machine with NUMA, setting the
>maximum vCPU count via the API might lead to an invalid config.
>
>Add a check that will forbid this until we add more advanced cpu config
>capabilities.
>
>Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1327499
>---
> src/libvirt_private.syms | 1 +
> src/qemu/qemu_driver.c | 7 +++++++
> 2 files changed, 8 insertions(+)
>
[...]
>diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>index 542d13c..44ec42d 100644
>--- a/src/qemu/qemu_driver.c
>+++ b/src/qemu/qemu_driver.c
>@@ -4898,6 +4898,13 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int
nvcpus,
>
> if (persistentDef) {
> if (flags & VIR_DOMAIN_VCPU_MAXIMUM) {
>+ if (virDomainNumaGetCPUCountTotal(persistentDef->numa) > nvcpus)
{
>+ virReportError(VIR_ERR_INVALID_ARG, "%s",
>+ _("Number of CPUs in <numa> exceeds the
desired "
>+ "maximum vcpu count"));
>+ goto endjob;
>+ }
>+
We should probably make sure that maxcpus == numacpus. But that's for
the future. ACK to this one.
I plan to phase out the ability to set cpus for numa topologies using
this API once we have a better approach.
Thanks; Pushed.
Peter