From patchwork Thu Jan 6 10:19:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 458421 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 p06AHBUB029434 for ; Thu, 6 Jan 2011 10:17:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752535Ab1AFKRH (ORCPT ); Thu, 6 Jan 2011 05:17:07 -0500 Received: from mga03.intel.com ([143.182.124.21]:18652 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752427Ab1AFKRG (ORCPT ); Thu, 6 Jan 2011 05:17:06 -0500 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 06 Jan 2011 02:17:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.60,282,1291622400"; d="scan'208";a="370848553" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.13.17]) by azsmga001.ch.intel.com with ESMTP; 06 Jan 2011 02:17:04 -0800 Received: from yasker by syang10-desktop with local (Exim 4.72) (envelope-from ) id 1Pamwd-0005Zx-Nx; Thu, 06 Jan 2011 18:19:47 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti Cc: "Michael S. Tsirkin" , kvm@vger.kernel.org, Sheng Yang Subject: [PATCH 1/3] KVM: Move struct kvm_io_device to kvm_host.h Date: Thu, 6 Jan 2011 18:19:43 +0800 Message-Id: <1294309185-21417-2-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1294309185-21417-1-git-send-email-sheng@linux.intel.com> References: <1294309185-21417-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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 06 Jan 2011 10:17:12 +0000 (UTC) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index b5021db..7d313e0 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -98,6 +98,29 @@ int kvm_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn, int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu); #endif +struct kvm_io_device; + +/** + * kvm_io_device_ops are called under kvm slots_lock. + * read and write handlers return 0 if the transaction has been handled, + * or non-zero to have it passed to the next device. + **/ +struct kvm_io_device_ops { + int (*read)(struct kvm_io_device *this, + gpa_t addr, + int len, + void *val); + int (*write)(struct kvm_io_device *this, + gpa_t addr, + int len, + const void *val); + void (*destructor)(struct kvm_io_device *this); +}; + +struct kvm_io_device { + const struct kvm_io_device_ops *ops; +}; + struct kvm_vcpu { struct kvm *kvm; #ifdef CONFIG_PREEMPT_NOTIFIERS diff --git a/virt/kvm/iodev.h b/virt/kvm/iodev.h index 12fd3ca..d1f5651 100644 --- a/virt/kvm/iodev.h +++ b/virt/kvm/iodev.h @@ -17,32 +17,9 @@ #define __KVM_IODEV_H__ #include +#include #include -struct kvm_io_device; - -/** - * kvm_io_device_ops are called under kvm slots_lock. - * read and write handlers return 0 if the transaction has been handled, - * or non-zero to have it passed to the next device. - **/ -struct kvm_io_device_ops { - int (*read)(struct kvm_io_device *this, - gpa_t addr, - int len, - void *val); - int (*write)(struct kvm_io_device *this, - gpa_t addr, - int len, - const void *val); - void (*destructor)(struct kvm_io_device *this); -}; - - -struct kvm_io_device { - const struct kvm_io_device_ops *ops; -}; - static inline void kvm_iodevice_init(struct kvm_io_device *dev, const struct kvm_io_device_ops *ops) {