Implements TYPE_X86_ACCEL.
Signed-off-by: Eduardo Habkost <[email protected]>
---
include/sysemu/kvm.h | 3 +++
kvm-all.c | 2 --
target-i386/kvm.c | 19 +++++++++++++++++++
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 7b95bfd..34b4dfe 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -414,4 +414,7 @@ int kvm_set_one_reg(CPUState *cs, uint64_t id, void
*source);
* Returns: 0 on success, or a negative errno on failure.
*/
int kvm_get_one_reg(CPUState *cs, uint64_t id, void *target);
+
+#define TYPE_KVM_ACCEL "kvm-accel"
+
#endif
diff --git a/kvm-all.c b/kvm-all.c
index 9185a62..c03b4e7 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -113,8 +113,6 @@ typedef struct KVMState
#endif
} KVMState;
-#define TYPE_KVM_ACCEL "kvm-accel"
-
#define KVM_STATE(obj) \
OBJECT_CHECK(KVMState, (obj), TYPE_KVM_ACCEL)
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 097fe11..6221794 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -28,6 +28,7 @@
#include "exec/gdbstub.h"
#include "qemu/host-utils.h"
#include "qemu/config-file.h"
+#include "hw/i386/accel.h"
#include "hw/i386/pc.h"
#include "hw/i386/apic.h"
#include "hw/i386/apic_internal.h"
@@ -2591,3 +2592,21 @@ int kvm_device_msix_deassign(KVMState *s, uint32_t
dev_id)
return kvm_deassign_irq_internal(s, dev_id, KVM_DEV_IRQ_GUEST_MSIX |
KVM_DEV_IRQ_HOST_MSIX);
}
+
+#define TYPE_X86_KVM_ACCEL TARGET_NAME "-kvm-accel"
+
+static const TypeInfo x86_kvm_accel_type = {
+ .name = TYPE_X86_KVM_ACCEL,
+ .parent = TYPE_KVM_ACCEL,
+ .interfaces = (InterfaceInfo[]) {
+ { TYPE_X86_ACCEL },
+ { }
+ },
+};
+
+static void x86_kvm_type_init(void)
+{
+ type_register_static(&x86_kvm_accel_type);
+}
+
+type_init(x86_kvm_type_init);
--
1.9.3