From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: [uq/master PATCH] kvm-all: exit in case max vcpus exceeded Date: Tue, 25 Feb 2014 23:22:07 -0300 Message-ID: <20140226022207.GA2787@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Paolo Bonzini To: kvm-devel Return-path: Received: from mx1.redhat.com ([209.132.183.28]:19385 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888AbaBZCWj (ORCPT ); Tue, 25 Feb 2014 21:22:39 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1Q2McOJ019697 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 25 Feb 2014 21:22:38 -0500 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Rather than fall back to TCG (so the user has to discover whats happening, in case of no access to qemu stdout/stderr). Signed-off-by: Marcelo Tosatti diff --git a/kvm-all.c b/kvm-all.c index 3937754..3f6841d 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1432,11 +1432,10 @@ int kvm_init(void) nc->name, nc->num, soft_vcpus_limit); if (nc->num > hard_vcpus_limit) { - ret = -EINVAL; fprintf(stderr, "Number of %s cpus requested (%d) exceeds " "the maximum cpus supported by KVM (%d)\n", nc->name, nc->num, hard_vcpus_limit); - goto err; + exit(1); } } nc++;