register_savevm etc.: make save function optional
PATCH 1/1 register_savevm etc.: make save function optional
register_savevm etc.: make save function optional
This allows a device to provide only a loading function, not a saving function.
This is useful if a later version of an emulation restores its state in some other way (eg by having a different device name, or by exploiting invariants in the state); when this happens it is still necessary to load or skip the information when it is found in old savefiles.
Signed-off-by Ian Jackson <[email protected]>
vl.c +4 -0
@@ -5988,6 +5988,10 @@ static int qemu_savevm_state(QEMUFile *f)qemu_put_be64 (f,0 );/* total size */ for (se = first_se; se !=NULL ; se = se->next) { +if (se->save_state ==NULL ) +/* this one has a loader only, for backwards compatibility */ +continue ; +/* ID string */ len =strlen (se->idstr);qemu_put_byte (f, len);