aboutsummaryrefslogtreecommitdiff
path: root/hw/i386
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-10-17 17:06:05 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2020-01-07 17:24:29 +0400
commit0fe4bb3241110fc9fbd1c5c457d58191fcdca5d3 (patch)
treef00c8403e2d98252c7eda24d84faa5f443377e84 /hw/i386
parent0ed40f16a17eaa3a53d62cc871779fa9d5b4447d (diff)
vmmouse: replace PROP_PTR with PROP_LINK
While at it, use the expected type. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'hw/i386')
-rw-r--r--hw/i386/pc.c6
-rw-r--r--hw/i386/vmmouse.c8
2 files changed, 6 insertions, 8 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index a4fda69b49..8054bc4147 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1156,9 +1156,9 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, bool no_vmport)
vmmouse = NULL;
}
if (vmmouse) {
- DeviceState *dev = DEVICE(vmmouse);
- qdev_prop_set_ptr(dev, "ps2_mouse", i8042);
- qdev_init_nofail(dev);
+ object_property_set_link(OBJECT(vmmouse), OBJECT(i8042),
+ "i8042", &error_abort);
+ qdev_init_nofail(DEVICE(vmmouse));
}
port92 = isa_create_simple(isa_bus, TYPE_PORT92);
diff --git a/hw/i386/vmmouse.c b/hw/i386/vmmouse.c
index 41ad91ad53..c0c329f817 100644
--- a/hw/i386/vmmouse.c
+++ b/hw/i386/vmmouse.c
@@ -66,7 +66,7 @@ typedef struct VMMouseState
uint16_t status;
uint8_t absolute;
QEMUPutMouseEntry *entry;
- void *ps2_mouse;
+ ISAKBDState *i8042;
} VMMouseState;
static uint32_t vmmouse_get_status(VMMouseState *s)
@@ -105,7 +105,7 @@ static void vmmouse_mouse_event(void *opaque, int x, int y, int dz, int buttons_
/* need to still generate PS2 events to notify driver to
read from queue */
- i8042_isa_mouse_fake_event(s->ps2_mouse);
+ i8042_isa_mouse_fake_event(s->i8042);
}
static void vmmouse_remove_handler(VMMouseState *s)
@@ -275,7 +275,7 @@ static void vmmouse_realizefn(DeviceState *dev, Error **errp)
}
static Property vmmouse_properties[] = {
- DEFINE_PROP_PTR("ps2_mouse", VMMouseState, ps2_mouse),
+ DEFINE_PROP_LINK("i8042", VMMouseState, i8042, TYPE_I8042, ISAKBDState *),
DEFINE_PROP_END_OF_LIST(),
};
@@ -287,8 +287,6 @@ static void vmmouse_class_initfn(ObjectClass *klass, void *data)
dc->reset = vmmouse_reset;
dc->vmsd = &vmstate_vmmouse;
dc->props = vmmouse_properties;
- /* Reason: pointer property "ps2_mouse" */
- dc->user_creatable = false;
}
static const TypeInfo vmmouse_info = {