qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

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>

+12 -14
+3 -3
hw/i386/pc.c
··· 1156 1156 vmmouse = NULL; 1157 1157 } 1158 1158 if (vmmouse) { 1159 - DeviceState *dev = DEVICE(vmmouse); 1160 - qdev_prop_set_ptr(dev, "ps2_mouse", i8042); 1161 - qdev_init_nofail(dev); 1159 + object_property_set_link(OBJECT(vmmouse), OBJECT(i8042), 1160 + "i8042", &error_abort); 1161 + qdev_init_nofail(DEVICE(vmmouse)); 1162 1162 } 1163 1163 port92 = isa_create_simple(isa_bus, TYPE_PORT92); 1164 1164
+3 -5
hw/i386/vmmouse.c
··· 66 66 uint16_t status; 67 67 uint8_t absolute; 68 68 QEMUPutMouseEntry *entry; 69 - void *ps2_mouse; 69 + ISAKBDState *i8042; 70 70 } VMMouseState; 71 71 72 72 static uint32_t vmmouse_get_status(VMMouseState *s) ··· 105 105 106 106 /* need to still generate PS2 events to notify driver to 107 107 read from queue */ 108 - i8042_isa_mouse_fake_event(s->ps2_mouse); 108 + i8042_isa_mouse_fake_event(s->i8042); 109 109 } 110 110 111 111 static void vmmouse_remove_handler(VMMouseState *s) ··· 275 275 } 276 276 277 277 static Property vmmouse_properties[] = { 278 - DEFINE_PROP_PTR("ps2_mouse", VMMouseState, ps2_mouse), 278 + DEFINE_PROP_LINK("i8042", VMMouseState, i8042, TYPE_I8042, ISAKBDState *), 279 279 DEFINE_PROP_END_OF_LIST(), 280 280 }; 281 281 ··· 287 287 dc->reset = vmmouse_reset; 288 288 dc->vmsd = &vmstate_vmmouse; 289 289 dc->props = vmmouse_properties; 290 - /* Reason: pointer property "ps2_mouse" */ 291 - dc->user_creatable = false; 292 290 } 293 291 294 292 static const TypeInfo vmmouse_info = {
+3 -5
hw/input/pckbd.c
··· 482 482 483 483 #define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042) 484 484 485 - typedef struct ISAKBDState { 485 + struct ISAKBDState { 486 486 ISADevice parent_obj; 487 487 488 488 KBDState kbd; 489 489 MemoryRegion io[2]; 490 - } ISAKBDState; 490 + }; 491 491 492 - void i8042_isa_mouse_fake_event(void *opaque) 492 + void i8042_isa_mouse_fake_event(ISAKBDState *isa) 493 493 { 494 - ISADevice *dev = opaque; 495 - ISAKBDState *isa = I8042(dev); 496 494 KBDState *s = &isa->kbd; 497 495 498 496 ps2_mouse_fake_event(s->mouse);
+3 -1
include/hw/input/i8042.h
··· 14 14 15 15 #define I8042_A20_LINE "a20" 16 16 17 + typedef struct ISAKBDState ISAKBDState; 18 + 17 19 void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq, 18 20 MemoryRegion *region, ram_addr_t size, 19 21 hwaddr mask); 20 - void i8042_isa_mouse_fake_event(void *opaque); 22 + void i8042_isa_mouse_fake_event(ISAKBDState *isa); 21 23 void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out); 22 24 23 25 #endif /* HW_INPUT_I8042_H */