From patchwork Thu Nov 4 06:15:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yang X-Patchwork-Id: 301052 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 oA46FVjn026309 for ; Thu, 4 Nov 2010 06:15:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932117Ab0KDGP1 (ORCPT ); Thu, 4 Nov 2010 02:15:27 -0400 Received: from mga02.intel.com ([134.134.136.20]:31730 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932072Ab0KDGP0 (ORCPT ); Thu, 4 Nov 2010 02:15:26 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 03 Nov 2010 23:15:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.58,293,1286175600"; d="scan'208";a="570223560" Received: from syang10-desktop.sh.intel.com (HELO syang10-desktop) ([10.239.13.14]) by orsmga002.jf.intel.com with ESMTP; 03 Nov 2010 23:15:16 -0700 Received: from yasker by syang10-desktop with local (Exim 4.72) (envelope-from ) id 1PDt6f-00012W-SU; Thu, 04 Nov 2010 14:15:29 +0800 From: Sheng Yang To: Avi Kivity , Marcelo Tosatti Cc: "Michael S. Tsirkin" , kvm@vger.kernel.org, Sheng Yang Subject: [PATCH 3/5] KVM: Move struct kvm_io_device to kvm_host.h Date: Thu, 4 Nov 2010 14:15:19 +0800 Message-Id: <1288851321-3964-4-git-send-email-sheng@linux.intel.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1288851321-3964-1-git-send-email-sheng@linux.intel.com> References: <1288851321-3964-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.3 (demeter1.kernel.org [140.211.167.41]); Thu, 04 Nov 2010 06:15:31 +0000 (UTC) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 0b89d00..7f9e4b7 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -74,6 +74,29 @@ int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, struct kvm_io_device *dev); +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) {