Re: [PATCH] qemu: Check for maximum vcpus exceeding cpu topology

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

 



On Tue, Feb 07, 2017 at 07:56:29AM -0500, Kothapally Madhu Pavan wrote:
> This patch will prevent guest to start when the maximum
> vcpus are greater than cpu topology limit. Currently similar
> checks do exist only during setvcpus. The patch adds the
> missing check. The c9cb35c255222 reverted similar check to
> avoid older configs from vanishing. The current patch adds
> it in domain validation part to be consistent with the
> original intent.
> 
> Signed-off-by: Kothapally Madhu Pavan <kmp@xxxxxxxxxxxxxxxxxx>
> ---
>  src/qemu/qemu_process.c |    7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index 184440d..f0d42b8 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -3738,6 +3738,13 @@ qemuValidateCpuCount(virDomainDefPtr def,
>          return -1;
>      }
>  
> +    if (def->cpu->sockets && virDomainDefGetVcpusMax(def) >
> +        def->cpu->sockets * def->cpu->cores * def->cpu->threads) {
> +        virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
> +                       _("Maximum CPUs greater than topology limit"));
> +        return -1;
> +    }

This looks wrong.  def->cpu->sockets is sockets-per-NUMA node.
So you're comparing the total number of VCPUS against the CPUs
permitted in a single guest NUMA node. 


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|

--
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]
  Powered by Linux