Hi,

+const VMStateDescription vmstate_isa_device = {
+    .name = "ISADevice",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .fields = (VMStateField []) {
+        VMSTATE_BOOL(enabled, ISADevice),
+        VMSTATE_END_OF_LIST()
+    }
+};

That alone isn't enougth. You also need to save iobase and irq. And have a pre-load callback which disables the device + a post-load callback which re-enables them with the new settings.

I get the feeling that doing all this in the pc87312 emulation is easier as it needs to have this logic anyway for config register writes and you can probably reuse the code for loadvm pre- and postprocessing.

cheers,
  Gerd


Reply via email to