]> git.proxmox.com Git - qemu.git/commitdiff
kvm: Make kvm_state globally available
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 7 Feb 2011 11:19:25 +0000 (12:19 +0100)
committerMarcelo Tosatti <mtosatti@redhat.com>
Mon, 14 Feb 2011 14:39:47 +0000 (12:39 -0200)
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>
kvm-all.c
kvm.h

index ecac0b3552ded7350070db211460fb56848bc587..e6a7de47221251ba7b3ace48e6effbea8eb76311 100644 (file)
--- 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 4caa6ec19e6b4799b37e461a628756873b31cb47..59b2c29fd938ec8a405faefe625b8e6db5829f28 100644 (file)
--- 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, ...);