From patchwork Mon Jan 24 09:02:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 80104 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 876C9B7109 for ; Mon, 24 Jan 2011 20:16:25 +1100 (EST) Received: from localhost ([127.0.0.1]:33867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhIX8-00044p-M1 for incoming@patchwork.ozlabs.org; Mon, 24 Jan 2011 04:16:22 -0500 Received: from [140.186.70.92] (port=37948 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhIMQ-0008Iq-Hf for qemu-devel@nongnu.org; Mon, 24 Jan 2011 04:05:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhIMO-0007Dh-8C for qemu-devel@nongnu.org; Mon, 24 Jan 2011 04:05:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhIMO-0007DH-1V for qemu-devel@nongnu.org; Mon, 24 Jan 2011 04:05:16 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0O95BXV028807 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 24 Jan 2011 04:05:11 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0O95AnJ006445; Mon, 24 Jan 2011 04:05:11 -0500 Received: from amt.cnet (vpn2-9-29.ams2.redhat.com [10.36.9.29]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p0O959Yw008684; Mon, 24 Jan 2011 04:05:10 -0500 Received: from amt.cnet (localhost.localdomain [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 22BDF652039; Mon, 24 Jan 2011 07:03:11 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id p0O932oc028377; Mon, 24 Jan 2011 07:03:02 -0200 From: Marcelo Tosatti To: Anthony Liguori Date: Mon, 24 Jan 2011 07:02:11 -0200 Message-Id: <14a095184c6068c78e67f17c200cf00b4170f704.1295859760.git.mtosatti@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org, Lai Jiangshan Subject: [Qemu-devel] [PATCH 02/31] kvm: convert kvm_ioctl(KVM_CHECK_EXTENSION) to kvm_check_extension() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Lai Jiangshan simple cleanup and use existing helper: kvm_check_extension(). Signed-off-by: Lai Jiangshan Signed-off-by: Marcelo Tosatti --- kvm-all.c | 2 +- target-i386/kvm.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 255b6fa..935c436 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -717,7 +717,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;