savevm: Coding style line length fix

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
vmstate: Replace while (...) with for (...)

This will make it easier to add code that skips some fields, by simply
using "continue".

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
vmstate: Simplify field-skipping load/save logic

This makes the code more readable, making each condition that makes a
field be skipped much more visible, and reduces one level of indentation
in the code.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
vmstate: Use version_id when saving

This will allow fields to have version_id > vmsd->version_id, to allow
us to support loading data with higher version_id.

This patch alone is not useful by itself, but it will be useful when
introducing the max_version_id field to VMStateDescription.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
vmstate: Add max_version_id field to VMStateDescription

This will allow us to load data that has a high version_id, while using
a lower version_id when saving.

Useful in case we need to revert vmstate changes but keep compatibility
with QEMU versions that had a higher version_id.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>