From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] Bail out when VCPU_CREATE fails Date: Wed, 24 Mar 2010 11:32:23 +0200 Message-ID: <4BA9DC27.6020705@redhat.com> References: <1269254953-20323-1-git-send-email-agraf@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: KVM list To: Alexander Graf Return-path: Received: from mx1.redhat.com ([209.132.183.28]:17031 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755047Ab0CXJc2 (ORCPT ); Wed, 24 Mar 2010 05:32:28 -0400 In-Reply-To: <1269254953-20323-1-git-send-email-agraf@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On 03/22/2010 12:49 PM, Alexander Graf wrote: > When we fail to create a VCPU we have no way to tell our callers that something > failed. So the caller happily uses a completely broken state. > > This code should become deprecated in the process of converting qemu-kvm to > qemu anyways, so let's not care about remdeling it but just bailing out when > something breaks. Also give the user a hint on why the VCPU_CREATE might have > failed. > > This fixes a segmentation fault with -smp> VCPU_MAX in the host kernel. > > Applied, thanks. Note, kvm reports the number of supported vcpus using KVM_CAP_NR_VCPUS, so we can fail in vl.c. -- error compiling committee.c: too many arguments to function