aboutsummaryrefslogtreecommitdiff
path: root/hw/pckbd.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-12-02 12:36:46 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 10:05:58 -0600
commitbe73cfe2be9a41de4f97e4847b3f12a7d6d61159 (patch)
tree83419da906307e90aea6146c88f405aeeb32cf7d /hw/pckbd.c
parent70cca6d87261f3ab330e2be34fbe9596b13342ae (diff)
savevm: Port to qdev.vmsd all devices that have qdev
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pckbd.c')
-rw-r--r--hw/pckbd.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/hw/pckbd.c b/hw/pckbd.c
index a81b303dae..7e0d68df2b 100644
--- a/hw/pckbd.c
+++ b/hw/pckbd.c
@@ -414,6 +414,17 @@ typedef struct ISAKBDState {
KBDState kbd;
} ISAKBDState;
+const VMStateDescription vmstate_kbd_isa = {
+ .name = "pckbd",
+ .version_id = 3,
+ .minimum_version_id = 3,
+ .minimum_version_id_old = 3,
+ .fields = (VMStateField []) {
+ VMSTATE_STRUCT(kbd, ISAKBDState, 0, vmstate_kbd, KBDState),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
static int i8042_initfn(ISADevice *dev)
{
KBDState *s = &(DO_UPCAST(ISAKBDState, dev, dev)->kbd);
@@ -421,7 +432,6 @@ static int i8042_initfn(ISADevice *dev)
isa_init_irq(dev, &s->irq_kbd, 1);
isa_init_irq(dev, &s->irq_mouse, 12);
- vmstate_register(0, &vmstate_kbd, s);
register_ioport_read(0x60, 1, 1, kbd_read_data, s);
register_ioport_write(0x60, 1, 1, kbd_write_data, s);
register_ioport_read(0x64, 1, 1, kbd_read_status, s);
@@ -439,6 +449,7 @@ static int i8042_initfn(ISADevice *dev)
static ISADeviceInfo i8042_info = {
.qdev.name = "i8042",
.qdev.size = sizeof(ISAKBDState),
+ .qdev.vmsd = &vmstate_kbd_isa,
.qdev.no_user = 1,
.init = i8042_initfn,
};