aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-06-24 14:40:44 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-06-26 18:40:12 +0100
commit75877e9356638b6446f634298923be5c088a3a60 (patch)
tree98937e7b8d013fef3f7363779dd13b00fb12685f /hw
parent01d924dce88f6d43a0be36c0e626f058e68a9ea4 (diff)
downloadqemu-75877e9356638b6446f634298923be5c088a3a60.zip
qemu-75877e9356638b6446f634298923be5c088a3a60.tar.gz
qemu-75877e9356638b6446f634298923be5c088a3a60.tar.bz2
pckbd: more vmstate_register() from i8042_mm_init() to i8042_mmio_realize()
Note in this case it is not possible to register a (new) VMStateDescription in the DeviceClass without breaking migration compatibility for the MIPS magnum machine. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-30-mark.cave-ayland@ilande.co.uk> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/input/pckbd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index 8708595..1ab7679 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -682,6 +682,9 @@ static void i8042_mmio_realize(DeviceState *dev, Error **errp)
"i8042", s->size);
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->region);
+
+ /* Note we can't use dc->vmsd without breaking migration compatibility */
+ vmstate_register(NULL, 0, &vmstate_kbd, ks);
}
static void i8042_mmio_init(Object *obj)
@@ -723,8 +726,6 @@ MMIOKBDState *i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
s->irq_kbd = kbd_irq;
s->irq_mouse = mouse_irq;
- vmstate_register(NULL, 0, &vmstate_kbd, s);
-
s->kbd = ps2_kbd_init(kbd_update_kbd_irq, s);
s->mouse = ps2_mouse_init(kbd_update_aux_irq, s);