From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: [PATCH 36/37] kvm: Make kvm_state globally available Date: Mon, 14 Feb 2011 13:23:05 -0200 Message-ID: <6a7af8cb04c345eb1ed9d95250ef3ad4400e65c5.1297696986.git.mtosatti@redhat.com> References: Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Jan Kiszka , Marcelo Tosatti To: Anthony Liguori Return-path: Received: from mx1.redhat.com ([209.132.183.28]:32222 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755746Ab1BNPZA (ORCPT ); Mon, 14 Feb 2011 10:25:00 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: From: Jan Kiszka KVM-assisted devices need access to it but we have no clean channel to distribute a reference. As a workaround until there is a better solution, export kvm_state for global use, though use should remain restricted to the mentioned scenario. Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- kvm-all.c | 2 +- kvm.h | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index ecac0b3..e6a7de4 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -78,7 +78,7 @@ struct KVMState int many_ioeventfds; }; -static KVMState *kvm_state; +KVMState *kvm_state; static const KVMCapabilityInfo kvm_required_capabilites[] = { KVM_CAP_INFO(USER_MEMORY), diff --git a/kvm.h b/kvm.h index 4caa6ec..59b2c29 100644 --- a/kvm.h +++ b/kvm.h @@ -85,6 +85,7 @@ int kvm_on_sigbus(int code, void *addr); struct KVMState; typedef struct KVMState KVMState; +extern KVMState *kvm_state; int kvm_ioctl(KVMState *s, int type, ...); -- 1.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=57964 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pp0IS-0000En-Oz for qemu-devel@nongnu.org; Mon, 14 Feb 2011 10:25:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pp0IM-000429-Jh for qemu-devel@nongnu.org; Mon, 14 Feb 2011 10:25:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pp0IL-00040x-Oc for qemu-devel@nongnu.org; Mon, 14 Feb 2011 10:24:57 -0500 From: Marcelo Tosatti Date: Mon, 14 Feb 2011 13:23:05 -0200 Message-Id: <6a7af8cb04c345eb1ed9d95250ef3ad4400e65c5.1297696986.git.mtosatti@redhat.com> In-Reply-To: References: Subject: [Qemu-devel] [PATCH 36/37] kvm: Make kvm_state globally available List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org From: Jan Kiszka KVM-assisted devices need access to it but we have no clean channel to distribute a reference. As a workaround until there is a better solution, export kvm_state for global use, though use should remain restricted to the mentioned scenario. Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- kvm-all.c | 2 +- kvm.h | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index ecac0b3..e6a7de4 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -78,7 +78,7 @@ struct KVMState int many_ioeventfds; }; -static KVMState *kvm_state; +KVMState *kvm_state; static const KVMCapabilityInfo kvm_required_capabilites[] = { KVM_CAP_INFO(USER_MEMORY), diff --git a/kvm.h b/kvm.h index 4caa6ec..59b2c29 100644 --- a/kvm.h +++ b/kvm.h @@ -85,6 +85,7 @@ int kvm_on_sigbus(int code, void *addr); struct KVMState; typedef struct KVMState KVMState; +extern KVMState *kvm_state; int kvm_ioctl(KVMState *s, int type, ...); -- 1.7.4