Re: [uq/master patch 2/2] kvm-all.c: max_cpus should not exceed KVM vcpu limit

2013-08-20 Thread Paolo Bonzini
Il 12/08/2013 21:56, Marcelo Tosatti ha scritto:
> maxcpus, which specifies the maximum number of hotpluggable CPUs,
> should not exceed KVM's vcpu limit.
> 
> Signed-off-by: Marcelo Tosatti 
> 
> Index: qemu/kvm-all.c
> ===
> --- qemu.orig/kvm-all.c
> +++ qemu/kvm-all.c
> @@ -1391,6 +1391,13 @@ int kvm_init(void)
>  goto err;
>  }
>  
> +if (max_cpus > max_vcpus) {
> +ret = -EINVAL;
> +fprintf(stderr, "Number of max_cpus requested (%d) exceeds max cpus "
> +"supported by KVM (%d)\n", max_cpus, max_vcpus);
> +goto err;
> +}
> +
>  s->vmfd = kvm_ioctl(s, KVM_CREATE_VM, 0);
>  if (s->vmfd < 0) {
>  #ifdef TARGET_S390X
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

I applied this patch to uq/master.  Thanks,

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[uq/master patch 2/2] kvm-all.c: max_cpus should not exceed KVM vcpu limit

2013-08-12 Thread Marcelo Tosatti
maxcpus, which specifies the maximum number of hotpluggable CPUs,
should not exceed KVM's vcpu limit.

Signed-off-by: Marcelo Tosatti 

Index: qemu/kvm-all.c
===
--- qemu.orig/kvm-all.c
+++ qemu/kvm-all.c
@@ -1391,6 +1391,13 @@ int kvm_init(void)
 goto err;
 }
 
+if (max_cpus > max_vcpus) {
+ret = -EINVAL;
+fprintf(stderr, "Number of max_cpus requested (%d) exceeds max cpus "
+"supported by KVM (%d)\n", max_cpus, max_vcpus);
+goto err;
+}
+
 s->vmfd = kvm_ioctl(s, KVM_CREATE_VM, 0);
 if (s->vmfd < 0) {
 #ifdef TARGET_S390X


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html