qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2] kvm: Check if smp_cpus exceeds max cpus supp


From: Dunrong Huang
Subject: Re: [Qemu-devel] [PATCH v2] kvm: Check if smp_cpus exceeds max cpus supported by kvm
Date: Tue, 31 Jul 2012 18:30:18 +0800

2012/7/31 Peter Maydell <address@hidden>:
> On 31 July 2012 11:14,  <address@hidden> wrote:
>>
>> @@ -1256,6 +1274,13 @@ int kvm_init(void)
>>          goto err;
>>      }
>>
>> +    max_vcpus = kvm_max_vcpus(s);
>> +    if (smp_cpus > max_vcpus) {
>> +        fprintf(stderr, "Number of SMP cpus requested (%d) exceeds max cpus 
>> "
>> +                "supported by KVM (%d)\n", smp_cpus, max_vcpus);
>> +        exit(1);
>
> Don't exit here, just use 'goto err' like all the other checks in
> this function. The caller will handle this and exit (or downgrade
> to TCG if the user wanted that).
>
Thanks for your review.
I agree with you, I should use "goto err" like other checks.
> -- PMM



-- 
Best Regards,

Dunrong Huang



reply via email to

[Prev in Thread] Current Thread [Next in Thread]