Skip to content

Commit

Permalink
pcspk: fix KVM
Browse files Browse the repository at this point in the history
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: 873b4d3
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>
  • Loading branch information
bonzini authored and pm215 committed Jun 30, 2016
1 parent 297e800 commit 8a0b4de
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion hw/audio/pcspk.c
Expand Up @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions include/hw/timer/i8254.h
Expand Up @@ -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"

Expand Down
8 changes: 0 additions & 8 deletions include/hw/timer/i8254_internal.h
Expand Up @@ -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;

Expand Down

0 comments on commit 8a0b4de

Please sign in to comment.