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>
diff --git a/hw/pckbd.c b/hw/pckbd.c
index a81b303..7e0d68d 100644
--- a/hw/pckbd.c
+++ b/hw/pckbd.c
@@ -414,6 +414,17 @@
     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 @@
     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 ISADeviceInfo i8042_info = {
     .qdev.name     = "i8042",
     .qdev.size     = sizeof(ISAKBDState),
+    .qdev.vmsd     = &vmstate_kbd_isa,
     .qdev.no_user  = 1,
     .init          = i8042_initfn,
 };