[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 41/58] kvm: Move QOM macros to kvm.h
From: |
Eduardo Habkost |
Subject: |
[PATCH v2 41/58] kvm: Move QOM macros to kvm.h |
Date: |
Wed, 19 Aug 2020 20:12:19 -0400 |
Move QOM macros close to the KVMState typedef.
This will make future conversion to OBJECT_DECLARE* easier.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
Changes series v1 -> v2: new patch in series v2
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org
Cc: qemu-devel@nongnu.org
---
include/sysemu/kvm.h | 6 ++++++
include/sysemu/kvm_int.h | 5 -----
2 files changed, 6 insertions(+), 5 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;
diff --git a/include/sysemu/kvm_int.h b/include/sysemu/kvm_int.h
index c660a70c51..65740806da 100644
--- a/include/sysemu/kvm_int.h
+++ b/include/sysemu/kvm_int.h
@@ -33,11 +33,6 @@ typedef struct KVMMemoryListener {
int as_id;
} KVMMemoryListener;
-#define TYPE_KVM_ACCEL ACCEL_CLASS_NAME("kvm")
-
-#define KVM_STATE(obj) \
- OBJECT_CHECK(KVMState, (obj), TYPE_KVM_ACCEL)
-
void kvm_memory_listener_register(KVMState *s, KVMMemoryListener *kml,
AddressSpace *as, int as_id);
--
2.26.2
- Re: [PATCH v2 36/58] piix: Move QOM macros to header, (continued)
- [PATCH v2 37/58] auxbus: Move QOM macros to header, Eduardo Habkost, 2020/08/19
- [PATCH v2 38/58] rocker: Move QOM macros to header, Eduardo Habkost, 2020/08/19
- [PATCH v2 39/58] pxa2xx: Move QOM macros to header, Eduardo Habkost, 2020/08/19
- [PATCH v2 40/58] mptsas: Move QOM macros to header, Eduardo Habkost, 2020/08/19
- [PATCH v2 41/58] kvm: Move QOM macros to kvm.h,
Eduardo Habkost <=
- [PATCH v2 42/58] vfio/pci: Move QOM macros to header, Eduardo Habkost, 2020/08/19
- [PATCH v2 43/58] qom: make object_ref/unref use a void * instead of Object *., Eduardo Habkost, 2020/08/19
- [PATCH v2 45/58] qom: Allow class type name to be specified in OBJECT_DECLARE*, Eduardo Habkost, 2020/08/19
- [PATCH v2 47/58] qom: Make type checker functions accept const pointers, Eduardo Habkost, 2020/08/19
- [PATCH v2 46/58] qom: DECLARE_*_CHECKERS macros, Eduardo Habkost, 2020/08/19
- [PATCH v2 48/58] qom: TYPE_INFO macro, Eduardo Habkost, 2020/08/19