From patchwork Mon Feb 7 11:19:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 82165 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 45862B712B for ; Tue, 8 Feb 2011 09:00:27 +1100 (EST) Received: from localhost ([127.0.0.1]:40020 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmPA8-0006qY-UH for incoming@patchwork.ozlabs.org; Mon, 07 Feb 2011 06:21:45 -0500 Received: from [140.186.70.92] (port=45705 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmP80-0006nb-Fa for qemu-devel@nongnu.org; Mon, 07 Feb 2011 06:19:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmP7y-0007wg-9Q for qemu-devel@nongnu.org; Mon, 07 Feb 2011 06:19:32 -0500 Received: from goliath.siemens.de ([192.35.17.28]:23600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmP7x-0007vj-N6 for qemu-devel@nongnu.org; Mon, 07 Feb 2011 06:19:30 -0500 Received: from mail1.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.13.6/8.13.6) with ESMTP id p17BJSVW003832; Mon, 7 Feb 2011 12:19:28 +0100 Received: from mchn199C.mchp.siemens.de ([139.25.109.49]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id p17BJQKV027537; Mon, 7 Feb 2011 12:19:28 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Date: Mon, 7 Feb 2011 12:19:25 +0100 Message-Id: <7b6debdc9056ae53cfa98964ccf6a2d9edd3a6c4.1297077507.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 192.35.17.28 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 14/15] kvm: Make kvm_state globally available 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 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 --- 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, ...);