From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFSDC-0005ci-Tx for qemu-devel@nongnu.org; Tue, 01 Dec 2009 07:52:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFSD7-0005a5-Eh for qemu-devel@nongnu.org; Tue, 01 Dec 2009 07:52:09 -0500 Received: from [199.232.76.173] (port=35016 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFSD6-0005Zu-Ok for qemu-devel@nongnu.org; Tue, 01 Dec 2009 07:52:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14418) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFSD6-0004sd-EG for qemu-devel@nongnu.org; Tue, 01 Dec 2009 07:52:04 -0500 From: Glauber Costa Date: Tue, 1 Dec 2009 10:51:37 -0200 Message-Id: <1259671897-22232-12-git-send-email-glommer@redhat.com> In-Reply-To: <1259671897-22232-11-git-send-email-glommer@redhat.com> References: <1259671897-22232-1-git-send-email-glommer@redhat.com> <1259671897-22232-2-git-send-email-glommer@redhat.com> <1259671897-22232-3-git-send-email-glommer@redhat.com> <1259671897-22232-4-git-send-email-glommer@redhat.com> <1259671897-22232-5-git-send-email-glommer@redhat.com> <1259671897-22232-6-git-send-email-glommer@redhat.com> <1259671897-22232-7-git-send-email-glommer@redhat.com> <1259671897-22232-8-git-send-email-glommer@redhat.com> <1259671897-22232-9-git-send-email-glommer@redhat.com> <1259671897-22232-10-git-send-email-glommer@redhat.com> <1259671897-22232-11-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH v2 11/11] remove smp restriction from kvm List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, avi@redhat.com, agraf@suse.de We don't support smp without irqchip in kernel, so only abort in that situation Signed-off-by: Glauber Costa --- kvm-all.c | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 286d0ee..db5daf6 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -438,15 +438,23 @@ static int kvm_create_irqchip(KVMState *s) { int ret = 0; #if defined(CONFIG_IOTHREAD) + ret = -1; if (!kvm_check_extension(s, KVM_CAP_IRQCHIP)) - return -1; + goto failed; ret = kvm_vm_ioctl(s, KVM_CREATE_IRQCHIP); if (ret < 0) - return ret; + goto failed; s->irqchip_in_kernel = 1; + + return ret; +failed: #endif + if (smp_cpus > 1) { + fprintf(stderr, "No SMP KVM support, use '-smp 1'\n"); + ret = -EINVAL; + } return ret; } @@ -459,11 +467,6 @@ int kvm_init(int smp_cpus) int ret; int i; - if (smp_cpus > 1) { - fprintf(stderr, "No SMP KVM support, use '-smp 1'\n"); - return -EINVAL; - } - s = qemu_mallocz(sizeof(KVMState)); #ifdef KVM_CAP_SET_GUEST_DEBUG -- 1.6.5.2