summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-02-07 12:19:25 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2011-02-14 12:39:47 -0200
commit6a7af8cb04c345eb1ed9d95250ef3ad4400e65c5 (patch)
treeef1238a5bdc92d641fd824a64f0c04d43798644f
parent638a84af9fced4b410243e45f755552303a17a3c (diff)
downloadhqemu-6a7af8cb04c345eb1ed9d95250ef3ad4400e65c5.zip
hqemu-6a7af8cb04c345eb1ed9d95250ef3ad4400e65c5.tar.gz
kvm: Make kvm_state globally available
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 <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--kvm-all.c2
-rw-r--r--kvm.h1
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, ...);
OpenPOWER on IntegriCloud