aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-06-30 16:57:37 +0200
committerPeter Maydell <peter.maydell@linaro.org>2016-06-30 19:00:02 +0100
commit8a0b4de048e20215415b24c7b42514c27b9d6ef3 (patch)
tree968295508f4c076fb290f4cbc16ed8d9445238c7
parent297e8005f88d4360480eaa2c07220fa8853f0448 (diff)
pcspk: fix KVM
The link property that was added to the pcspk device has the wrong type: it is only correct for TCG and for KVM's userspace or split irqchip options. The default KVM option (fully in-kernel irqchip) breaks because it uses a PIT whose type is a sibling of TYPE_I8254. Fixes: 873b4d3f0571a1e415cf089a67a230ea8a12d059 Tested-by: Peter Lieven <pl@kamp.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 1467298657-6588-1-git-send-email-pbonzini@redhat.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/audio/pcspk.c2
-rw-r--r--include/hw/timer/i8254.h8
-rw-r--r--include/hw/timer/i8254_internal.h8
3 files changed, 9 insertions, 9 deletions
diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c
index a7aa4e9c26..42a6f4885a 100644
--- a/hw/audio/pcspk.c
+++ b/hw/audio/pcspk.c
@@ -171,7 +171,7 @@ static void pcspk_initfn(Object *obj)
memory_region_init_io(&s->ioport, OBJECT(s), &pcspk_io_ops, s, "pcspk", 1);
- object_property_add_link(obj, "pit", TYPE_I8254,
+ object_property_add_link(obj, "pit", TYPE_PIT_COMMON,
(Object **)&s->pit,
qdev_prop_allow_set_link_before_realize,
0, &error_abort);
diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h
index 434903348c..27a0fb6c51 100644
--- a/include/hw/timer/i8254.h
+++ b/include/hw/timer/i8254.h
@@ -37,6 +37,14 @@ typedef struct PITChannelInfo {
int out;
} PITChannelInfo;
+#define TYPE_PIT_COMMON "pit-common"
+#define PIT_COMMON(obj) \
+ OBJECT_CHECK(PITCommonState, (obj), TYPE_PIT_COMMON)
+#define PIT_COMMON_CLASS(klass) \
+ OBJECT_CLASS_CHECK(PITCommonClass, (klass), TYPE_PIT_COMMON)
+#define PIT_COMMON_GET_CLASS(obj) \
+ OBJECT_GET_CLASS(PITCommonClass, (obj), TYPE_PIT_COMMON)
+
#define TYPE_I8254 "isa-pit"
#define TYPE_KVM_I8254 "kvm-pit"
diff --git a/include/hw/timer/i8254_internal.h b/include/hw/timer/i8254_internal.h
index 61a1bfbc4e..e7cb7573ca 100644
--- a/include/hw/timer/i8254_internal.h
+++ b/include/hw/timer/i8254_internal.h
@@ -57,14 +57,6 @@ typedef struct PITCommonState {
PITChannelState channels[3];
} PITCommonState;
-#define TYPE_PIT_COMMON "pit-common"
-#define PIT_COMMON(obj) \
- OBJECT_CHECK(PITCommonState, (obj), TYPE_PIT_COMMON)
-#define PIT_COMMON_CLASS(klass) \
- OBJECT_CLASS_CHECK(PITCommonClass, (klass), TYPE_PIT_COMMON)
-#define PIT_COMMON_GET_CLASS(obj) \
- OBJECT_GET_CLASS(PITCommonClass, (obj), TYPE_PIT_COMMON)
-
typedef struct PITCommonClass {
ISADeviceClass parent_class;