From patchwork Fri Dec 10 07:52:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lai Jiangshan X-Patchwork-Id: 397722 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBA7nRjY027257 for ; Fri, 10 Dec 2010 07:49:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753184Ab0LJHtY (ORCPT ); Fri, 10 Dec 2010 02:49:24 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:60785 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751073Ab0LJHtY (ORCPT ); Fri, 10 Dec 2010 02:49:24 -0500 Received: from tang.cn.fujitsu.com (tang.cn.fujitsu.com [10.167.250.3]) by song.cn.fujitsu.com (Postfix) with ESMTP id B70281704D7; Fri, 10 Dec 2010 15:49:21 +0800 (CST) Received: from mailserver.fnst.cn.fujitus.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id oBA7ibPv011603; Fri, 10 Dec 2010 15:44:37 +0800 Received: from [10.167.225.68] ([10.167.225.68]) by mailserver.fnst.cn.fujitus.com (Lotus Domino Release 8.5.1FP4) with ESMTP id 2010121015492519-205438 ; Fri, 10 Dec 2010 15:49:25 +0800 Message-ID: <4D01DC44.2040409@cn.fujitsu.com> Date: Fri, 10 Dec 2010 15:52:36 +0800 From: Lai Jiangshan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100423 Thunderbird/3.0.4 MIME-Version: 1.0 To: Avi Kivity , "kvm@vger.kernel.org" Subject: [PATCH] qemu-kvm,cleanup: convert kvm_ioctl(KVM_CHECK_EXTENSION) to kvm_check_extension() X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2010-12-10 15:49:25, Serialize by Router on mailserver/fnst(Release 8.5.1FP4|July 25, 2010) at 2010-12-10 15:49:25, Serialize complete at 2010-12-10 15:49:25 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 10 Dec 2010 07:49:27 +0000 (UTC) diff --git a/kvm-all.c b/kvm-all.c index cae24bb..35fc73c 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -678,7 +678,7 @@ int kvm_init(int smp_cpus) s->broken_set_mem_region = 1; #ifdef KVM_CAP_JOIN_MEMORY_REGIONS_WORKS - ret = kvm_ioctl(s, KVM_CHECK_EXTENSION, KVM_CAP_JOIN_MEMORY_REGIONS_WORKS); + ret = kvm_check_extension(s, KVM_CAP_JOIN_MEMORY_REGIONS_WORKS); if (ret > 0) { s->broken_set_mem_region = 0; } diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 755f8c9..4004de7 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -187,7 +187,7 @@ static int kvm_get_mce_cap_supported(KVMState *s, uint64_t *mce_cap, { int r; - r = kvm_ioctl(s, KVM_CHECK_EXTENSION, KVM_CAP_MCE); + r = kvm_check_extension(s, KVM_CAP_MCE); if (r > 0) { *max_banks = r; return kvm_ioctl(s, KVM_X86_GET_MCE_CAP_SUPPORTED, mce_cap); @@ -540,7 +540,7 @@ int kvm_arch_init(KVMState *s, int smp_cpus) * versions of KVM just assumed that it would be at the end of physical * memory but that doesn't work with more than 4GB of memory. We simply * refuse to work with those older versions of KVM. */ - ret = kvm_ioctl(s, KVM_CHECK_EXTENSION, KVM_CAP_SET_TSS_ADDR); + ret = kvm_check_extension(s, KVM_CAP_SET_TSS_ADDR); if (ret <= 0) { fprintf(stderr, "kvm does not support KVM_CAP_SET_TSS_ADDR\n"); return ret;