From patchwork Wed Jan 7 10:49:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 1139 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n07Ak8QI030323 for ; Wed, 7 Jan 2009 02:46:10 -0800 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751586AbZAGKtm (ORCPT ); Wed, 7 Jan 2009 05:49:42 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751992AbZAGKtl (ORCPT ); Wed, 7 Jan 2009 05:49:41 -0500 Received: from mga11.intel.com ([192.55.52.93]:44087 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751586AbZAGKtk (ORCPT ); Wed, 7 Jan 2009 05:49:40 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 07 Jan 2009 02:41:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.36,339,1228118400"; d="scan'208";a="655209510" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.13.47]) by fmsmga001.fm.intel.com with ESMTP; 07 Jan 2009 02:50:03 -0800 Received: from yasker by syang10-desktop with local (Exim 4.69) (envelope-from ) id 1LKVyd-0005xm-MS; Wed, 07 Jan 2009 18:49:31 +0800 From: Sheng Yang To: Avi Kivity Cc: Anthony Liguori , kvm@vger.kernel.org, Sheng Yang Subject: [PATCH 3/6] kvm: ioctl for gsi_route Date: Wed, 7 Jan 2009 18:49:28 +0800 Message-Id: <1231325371-22896-4-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.5.6.3 In-Reply-To: <1231325371-22896-1-git-send-email-sheng@linux.intel.com> References: <1231325371-22896-1-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Sheng Yang --- libkvm/libkvm.c | 27 +++++++++++++++++++++++++++ libkvm/libkvm.h | 8 ++++++++ 2 files changed, 35 insertions(+), 0 deletions(-) diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c index 0408fdb..6d53f38 100644 --- a/libkvm/libkvm.c +++ b/libkvm/libkvm.c @@ -1164,3 +1164,30 @@ int kvm_reinject_control(kvm_context_t kvm, int pit_reinject) #endif return -ENOSYS; } + +#ifdef KVM_CAP_GSI_ROUTE +int kvm_request_gsi_route(kvm_context_t kvm, + struct kvm_gsi_route_guest *route) +{ + int ret; + + ret = ioctl(kvm->vm_fd, KVM_REQUEST_GSI_ROUTE, route); + if (ret < 0) + return -errno; + + return ret; +} + +int kvm_free_gsi_route(kvm_context_t kvm, + struct kvm_gsi_route_guest *route) +{ + int ret; + + ret = ioctl(kvm->vm_fd, KVM_FREE_GSI_ROUTE, route); + if (ret < 0) + return -errno; + + return ret; +} + +#endif diff --git a/libkvm/libkvm.h b/libkvm/libkvm.h index ee1ba68..2bfcfe3 100644 --- a/libkvm/libkvm.h +++ b/libkvm/libkvm.h @@ -720,4 +720,12 @@ int kvm_assign_irq(kvm_context_t kvm, */ int kvm_destroy_memory_region_works(kvm_context_t kvm); #endif + +#ifdef KVM_CAP_GSI_ROUTE +int kvm_request_gsi_route(kvm_context_t kvm, + struct kvm_gsi_route_guest *route); +int kvm_free_gsi_route(kvm_context_t kvm, + struct kvm_gsi_route_guest *route); +#endif + #endif