summaryrefslogtreecommitdiff
path: root/include/sysemu/kvm.h
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2020-08-25 15:20:37 -0400
committerEduardo Habkost <ehabkost@redhat.com>2020-08-27 14:04:55 -0400
commit97e622ded7f596f95915c32d5a92bf017ffa3959 (patch)
treebbb6a34a4406e0293b825c3e91fc9df1ed24de33 /include/sysemu/kvm.h
parent040c1fd35c7c352759e710a4caa01a633049ade6 (diff)
downloadqemu-97e622ded7f596f95915c32d5a92bf017ffa3959.zip
kvm: Move QOM macros to kvm.h
Move QOM macros close to the KVMState typedef. This will make future conversion to OBJECT_DECLARE* easier. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Tested-By: Roman Bolshakov <r.bolshakov@yadro.com> Message-Id: <20200825192110.3528606-42-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include/sysemu/kvm.h')
-rw-r--r--include/sysemu/kvm.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index b4174d941c..8445a88db1 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -17,6 +17,7 @@
#include "qemu/queue.h"
#include "hw/core/cpu.h"
#include "exec/memattrs.h"
+#include "sysemu/accel.h"
#ifdef NEED_CPU_H
# ifdef CONFIG_KVM
@@ -199,7 +200,12 @@ typedef struct KVMCapabilityInfo {
#define KVM_CAP_LAST_INFO { NULL, 0 }
struct KVMState;
+
+#define TYPE_KVM_ACCEL ACCEL_CLASS_NAME("kvm")
typedef struct KVMState KVMState;
+#define KVM_STATE(obj) \
+ OBJECT_CHECK(KVMState, (obj), TYPE_KVM_ACCEL)
+
extern KVMState *kvm_state;
typedef struct Notifier Notifier;