On 08/07/11 19:29, Michael Walle wrote:
This USB patchset moves the VM state stuff from usb-hid.c to hid.c, so it
can be reused by other devices.

Nice.

There is one major drawback: i need to increase the vmstate version_id of
the usb-hid device. I don't know if you agree with this change.
Alternatively, we could add a load_old function which just skips old
versions.

You don't have to change the version. The binary representation in the savevm format doesn't change if you move the fields from vmstate_usb_ptr to vmstate_hid_ptr_device.

For anything referenced via VMS_STRUCT the vmstate->name is just there to beautify the source code, it isn't used at all when reading/writing the state. No new section, no nothing. The savevm code only looks at ->fields and writes them out (and executes the hooks).

Reordering the fields (like you did with the keyboard) isn't going to work though.

cheers,
  Gerd

Reply via email to