From patchwork Fri Dec 9 06:54:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Evans X-Patchwork-Id: 130289 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B48851007D7 for ; Fri, 9 Dec 2011 17:53:11 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751424Ab1LIGxK (ORCPT ); Fri, 9 Dec 2011 01:53:10 -0500 Received: from ozlabs.org ([203.10.76.45]:53673 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750941Ab1LIGxJ (ORCPT ); Fri, 9 Dec 2011 01:53:09 -0500 Received: from [10.61.2.183] (ibmaus65.lnk.telstra.net [165.228.126.9]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPSA id AF9011007D6; Fri, 9 Dec 2011 17:53:08 +1100 (EST) Message-ID: <4EE1B089.8060509@ozlabs.org> Date: Fri, 09 Dec 2011 17:54:01 +1100 From: Matt Evans User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110921 Thunderbird/3.1.15 MIME-Version: 1.0 To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org CC: penberg@kernel.org, asias.hejun@gmail.com, levinsasha928@gmail.com, gorcunov@gmail.com Subject: [PATCH V2 06/23] kvm tools: Don't die if KVM_CAP_NR_VCPUS isn't available References: In-Reply-To: Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org We die() if we can't read KVM_CAP_NR_VCPUS, but the API docs suggest to assume the value 4 in this case. This is pertinent to PPC KVM, which currently does not support this CAP. Signed-off-by: Matt Evans --- tools/kvm/kvm.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/tools/kvm/kvm.c b/tools/kvm/kvm.c index 0356d74..0bbe9ba 100644 --- a/tools/kvm/kvm.c +++ b/tools/kvm/kvm.c @@ -266,7 +266,11 @@ int kvm__recommended_cpus(struct kvm *kvm) ret = ioctl(kvm->sys_fd, KVM_CHECK_EXTENSION, KVM_CAP_NR_VCPUS); if (ret <= 0) - die_perror("KVM_CAP_NR_VCPUS"); + /* + * api.txt states that if KVM_CAP_NR_VCPUS does not exist, + * assume 4. + */ + return 4; return ret; }